mirror of https://github.com/joan2937/pigpio
Merge branch 'MaitreDede-lib-signals'
This commit is contained in:
commit
59f63d832a
2
Makefile
2
Makefile
|
@ -40,6 +40,8 @@ mandir = $(prefix)/man
|
|||
|
||||
all: $(ALL)
|
||||
|
||||
lib: $(LIB)
|
||||
|
||||
pigpio.o: pigpio.c pigpio.h command.h custom.cext
|
||||
$(CC) $(CFLAGS) -fpic -c -o pigpio.o pigpio.c
|
||||
|
||||
|
|
11
pigpio.c
11
pigpio.c
|
@ -203,7 +203,8 @@ bit 0 READ_LAST_NOT_SET_ERROR
|
|||
|
||||
#define DO_DBG(level, format, arg...) \
|
||||
{ \
|
||||
if (gpioCfg.dbgLevel >= level) \
|
||||
if (gpioCfg.dbgLevel >= level && \
|
||||
(gpioCfg.internals & PI_CFG_SIGHANDLER)) \
|
||||
fprintf(stderr, "%s %s: " format "\n" , \
|
||||
myTimeStamp(), __FUNCTION__ , ## arg); \
|
||||
}
|
||||
|
@ -1344,7 +1345,7 @@ static volatile gpioCfg_t gpioCfg =
|
|||
PI_DEFAULT_MEM_ALLOC_MODE,
|
||||
0, /* dbgLevel */
|
||||
0, /* alertFreq */
|
||||
0, /* internals */
|
||||
PI_CFG_SIGHANDLER, /* internals */
|
||||
};
|
||||
|
||||
/* no initialisation required */
|
||||
|
@ -8113,6 +8114,7 @@ int initInitialise(void)
|
|||
}
|
||||
|
||||
#ifndef EMBEDDED_IN_VM
|
||||
if(gpioCfg.internals & PI_CFG_SIGHANDLER)
|
||||
sigSetHandler();
|
||||
#endif
|
||||
|
||||
|
@ -8510,7 +8512,8 @@ void gpioTerminate(void)
|
|||
if (dmaReg != MAP_FAILED) dmaOut[DMA_CS] = DMA_CHANNEL_RESET;
|
||||
|
||||
#ifndef EMBEDDED_IN_VM
|
||||
if (gpioCfg.internals & PI_CFG_STATS)
|
||||
if ((gpioCfg.internals & PI_CFG_STATS) &&
|
||||
(gpioCfg.internals & PI_CFG_SIGHANDLER))
|
||||
{
|
||||
fprintf(stderr,
|
||||
"\n#####################################################\n");
|
||||
|
@ -8543,8 +8546,8 @@ void gpioTerminate(void)
|
|||
fprintf(stderr,
|
||||
"\n#####################################################\n\n\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
initReleaseResources();
|
||||
|
||||
fflush(NULL);
|
||||
|
|
4
pigpio.h
4
pigpio.h
|
@ -865,8 +865,10 @@ typedef void *(gpioThreadFunc_t) (void *);
|
|||
#define PI_CFG_ALERT_FREQ 4 /* bits 4-7 */
|
||||
#define PI_CFG_RT_PRIORITY (1<<8)
|
||||
#define PI_CFG_STATS (1<<9)
|
||||
#define PI_CFG_SIGHANDLER (1<<10)
|
||||
|
||||
#define PI_CFG_ILLEGAL_VAL (1<<11)
|
||||
|
||||
#define PI_CFG_ILLEGAL_VAL (1<<10)
|
||||
|
||||
/* gpioISR */
|
||||
|
||||
|
|
Loading…
Reference in New Issue