Adding flag to disable alerts (polling of GPIOs)

This commit is contained in:
Maurus Erni 2017-04-25 13:50:01 +02:00
parent c4c8ce50c6
commit 29bbd99b0e
3 changed files with 11 additions and 3 deletions

View File

@ -8115,10 +8115,13 @@ int initInitialise(void)
if (pthread_attr_setstacksize(&pthAttr, STACK_SIZE))
SOFT_ERROR(PI_INIT_FAILED, "pthread_attr_setstacksize failed (%m)");
if (!(gpioCfg.ifFlags & PI_DISABLE_ALERT))
{
if (pthread_create(&pthAlert, &pthAttr, pthAlertThread, &i))
SOFT_ERROR(PI_INIT_FAILED, "pthread_create alert failed (%m)");
pthAlertRunning = 1;
}
if (!(gpioCfg.ifFlags & PI_DISABLE_FIFO_IF))
{

View File

@ -846,6 +846,7 @@ typedef void *(gpioThreadFunc_t) (void *);
#define PI_DISABLE_FIFO_IF 1
#define PI_DISABLE_SOCK_IF 2
#define PI_LOCALHOST_SOCK_IF 4
#define PI_DISABLE_ALERT 8
/* memAllocMode */

View File

@ -217,6 +217,10 @@ static void initOpts(int argc, char *argv[])
ifFlags |= PI_LOCALHOST_SOCK_IF;
break;
case 'm':
ifFlags |= PI_DISABLE_ALERT;
break;
case 'n':
addr = checkAddr(optarg);
if (addr && (numSockNetAddr<MAX_CONNECT_ADDRESSES))