21 void alert(
int gpio,
int level, uint32_t tick)
23 static uint32_t lastTick=0;
25 if (lastTick) printf(
"%d %.2f\n", level, (
float)(tick-lastTick)/1000000.0);
26 else printf(
"%d 0.00\n", level);
31 int main(
int argc,
char *argv[])
35 if (argc>1) secs = atoi(argv[1]);
37 if ((secs<1) || (secs>3600)) secs = 3600;
int gpioSetAlertFunc(unsigned gpio, gpioAlertFunc_t f)
void alert(int gpio, int level, uint32_t tick)
int gpioSetMode(unsigned gpio, unsigned mode)
int main(int argc, char *argv[])
int gpioSetPullUpDown(unsigned gpio, unsigned pud)