Добавлен пример для работы прерывания по gpio
This commit is contained in:
5
examples/wfi.c
Normal file → Executable file
5
examples/wfi.c
Normal file → Executable file
@@ -58,6 +58,8 @@
|
||||
static volatile int globalCounter = 0 ;
|
||||
|
||||
|
||||
int waitForInterruptV1(int pin, int mS);
|
||||
|
||||
/*
|
||||
* waitForIt:
|
||||
* This is a thread created using the wiringPi simplified threading
|
||||
@@ -75,7 +77,8 @@ PI_THREAD (waitForIt)
|
||||
|
||||
for (;;)
|
||||
{
|
||||
if (waitForInterrupt (BUTTON_PIN, -1) > 0) // Got it
|
||||
struct WPIWfiStatus rc = waitForInterrupt2 (BUTTON_PIN, INT_EDGE_RISING, -1, 0);
|
||||
if (rc.statusOK > 0) // Got it
|
||||
{
|
||||
// Bouncing?
|
||||
|
||||
|
||||
Reference in New Issue
Block a user