From: c vw Date: Thu, 25 Nov 2021 08:31:56 +0000 (+0100) Subject: Make millis() global to allow debouncing in i2c.c X-Git-Url: https://git.rkrishnan.org/listings/vdrive/index.php?a=commitdiff_plain;h=8e43e5e01c5b311a7365dfd56f86d148cb9bf8d0;p=pihpsdr.git Make millis() global to allow debouncing in i2c.c --- diff --git a/gpio.c b/gpio.c index 7499933..11267ab 100644 --- a/gpio.c +++ b/gpio.c @@ -348,7 +348,7 @@ static void initialiseEpoch() { epochMilli = (uint64_t)ts.tv_sec * (uint64_t)1000 + (uint64_t)(ts.tv_nsec / 1000000L) ; } -static unsigned int millis () { +unsigned int millis () { uint64_t now ; struct timespec ts ; clock_gettime (CLOCK_MONOTONIC_RAW, &ts) ; diff --git a/gpio.h b/gpio.h index 2276f81..04598af 100644 --- a/gpio.h +++ b/gpio.h @@ -79,6 +79,8 @@ extern void gpio_save_state(); extern void gpio_save_actions(); extern int gpio_init(); extern void gpio_close(); +extern void do_switch_action(enum ACTION action, enum ACTION_MODE mode) +extern unsigned int millis(); // to allow debouncing in i2c.c #ifdef LOCALCW extern int CWL_BUTTON;