Добавлен пример для работы прерывания по gpio

This commit is contained in:
sasha80
2026-04-15 11:34:36 +03:00
parent 99f2780c1f
commit ade3b26942
235 changed files with 366 additions and 2 deletions

5
examples/wfi.c Normal file → Executable file
View 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?