mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-16 18:13:49 +01:00
Merge pull request #21365 from fabian18/pr/lis2dh12_int32_lis2dh12_wait_event
drivers/lis2dh12: int32_t lis2dh12_wait_event()
This commit is contained in:
commit
d3d9afc9c5
@ -312,7 +312,7 @@ void lis2dh12_cfg_disable_event(const lis2dh12_t *dev, uint8_t event, uint8_t pi
|
|||||||
* @return negative error
|
* @return negative error
|
||||||
* @return positive LIS2DH12_INT_SRC bit mask on success
|
* @return positive LIS2DH12_INT_SRC bit mask on success
|
||||||
*/
|
*/
|
||||||
int lis2dh12_wait_event(const lis2dh12_t *dev, uint8_t pin, bool stale_events);
|
int32_t lis2dh12_wait_event(const lis2dh12_t *dev, uint8_t pin, bool stale_events);
|
||||||
#endif /* MODULE_LIS2DH12_INT */
|
#endif /* MODULE_LIS2DH12_INT */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -437,7 +437,7 @@ static uint32_t _merge_int_flags(const lis2dh12_t *dev, uint8_t events)
|
|||||||
((uint32_t)LIS2DH12_INT_SRC_IA << 8) | \
|
((uint32_t)LIS2DH12_INT_SRC_IA << 8) | \
|
||||||
((uint32_t)LIS2DH12_INT_SRC_IA << 16))
|
((uint32_t)LIS2DH12_INT_SRC_IA << 16))
|
||||||
|
|
||||||
int lis2dh12_wait_event(const lis2dh12_t *dev, uint8_t line, bool stale_events)
|
int32_t lis2dh12_wait_event(const lis2dh12_t *dev, uint8_t line, bool stale_events)
|
||||||
{
|
{
|
||||||
uint32_t int_src;
|
uint32_t int_src;
|
||||||
uint8_t events = 0;
|
uint8_t events = 0;
|
||||||
|
|||||||
@ -23,6 +23,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
#include <inttypes.h>
|
||||||
#include "fmt.h"
|
#include "fmt.h"
|
||||||
#include "thread.h"
|
#include "thread.h"
|
||||||
#include "shell.h"
|
#include "shell.h"
|
||||||
@ -79,10 +80,10 @@ void* lis2dh12_test_process(void* arg) {
|
|||||||
while (1) {
|
while (1) {
|
||||||
|
|
||||||
/* wait for interrupt */
|
/* wait for interrupt */
|
||||||
int int1_src = lis2dh12_wait_event(&dev, LIS2DH12_INT1, false);
|
int32_t int1_src = lis2dh12_wait_event(&dev, LIS2DH12_INT1, false);
|
||||||
|
|
||||||
if (int1_src <= 0) {
|
if (int1_src <= 0) {
|
||||||
printf("error: %d\n", int1_src);
|
printf("error: %" PRId32 "\n", int1_src);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user