mirror of https://github.com/joan2937/pigpio
Merge branch 'lib-signals' of https://github.com/MaitreDede/pigpio into MaitreDede-lib-signals
This commit is contained in:
commit
748d9cebf8
2
Makefile
2
Makefile
|
@ -40,6 +40,8 @@ mandir = $(prefix)/man
|
||||||
|
|
||||||
all: $(ALL)
|
all: $(ALL)
|
||||||
|
|
||||||
|
lib: $(LIB)
|
||||||
|
|
||||||
pigpio.o: pigpio.c pigpio.h command.h custom.cext
|
pigpio.o: pigpio.c pigpio.h command.h custom.cext
|
||||||
$(CC) $(CFLAGS) -fpic -c -o pigpio.o pigpio.c
|
$(CC) $(CFLAGS) -fpic -c -o pigpio.o pigpio.c
|
||||||
|
|
||||||
|
|
27
pigpio.c
27
pigpio.c
|
@ -195,17 +195,11 @@ bit 0 READ_LAST_NOT_SET_ERROR
|
||||||
|
|
||||||
#define BIT (1<<(gpio&0x1F))
|
#define BIT (1<<(gpio&0x1F))
|
||||||
|
|
||||||
#ifndef EMBEDDED_IN_VM
|
#define DBG(level, format, arg...) \
|
||||||
#define DBG(level, format, arg...) DO_DBG(level, format, ## arg)
|
{ \
|
||||||
#else
|
if (gpioCfg.dbgLevel >= level && (gpioCfg.internals & PI_CFG_SIGHANDLER)) \
|
||||||
#define DBG(level, format, arg...)
|
fprintf(stderr, "%s %s: " format "\n" , \
|
||||||
#endif
|
myTimeStamp(), __FUNCTION__ , ## arg); \
|
||||||
|
|
||||||
#define DO_DBG(level, format, arg...) \
|
|
||||||
{ \
|
|
||||||
if (gpioCfg.dbgLevel >= level) \
|
|
||||||
fprintf(stderr, "%s %s: " format "\n" , \
|
|
||||||
myTimeStamp(), __FUNCTION__ , ## arg); \
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef DISABLE_SER_CHECK_INITED
|
#ifndef DISABLE_SER_CHECK_INITED
|
||||||
|
@ -1344,7 +1338,7 @@ static volatile gpioCfg_t gpioCfg =
|
||||||
PI_DEFAULT_MEM_ALLOC_MODE,
|
PI_DEFAULT_MEM_ALLOC_MODE,
|
||||||
0, /* dbgLevel */
|
0, /* dbgLevel */
|
||||||
0, /* alertFreq */
|
0, /* alertFreq */
|
||||||
0, /* internals */
|
PI_CFG_SIGHANDLER, /* internals */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* no initialisation required */
|
/* no initialisation required */
|
||||||
|
@ -8112,9 +8106,8 @@ int initInitialise(void)
|
||||||
gpioMaskSet = 1;
|
gpioMaskSet = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef EMBEDDED_IN_VM
|
if(gpioCfg.internals & PI_CFG_SIGHANDLER)
|
||||||
sigSetHandler();
|
sigSetHandler();
|
||||||
#endif
|
|
||||||
|
|
||||||
if (initPeripherals() < 0) return PI_INIT_FAILED;
|
if (initPeripherals() < 0) return PI_INIT_FAILED;
|
||||||
|
|
||||||
|
@ -8509,8 +8502,7 @@ void gpioTerminate(void)
|
||||||
if (dmaReg != MAP_FAILED) dmaIn[DMA_CS] = DMA_CHANNEL_RESET;
|
if (dmaReg != MAP_FAILED) dmaIn[DMA_CS] = DMA_CHANNEL_RESET;
|
||||||
if (dmaReg != MAP_FAILED) dmaOut[DMA_CS] = DMA_CHANNEL_RESET;
|
if (dmaReg != MAP_FAILED) dmaOut[DMA_CS] = DMA_CHANNEL_RESET;
|
||||||
|
|
||||||
#ifndef EMBEDDED_IN_VM
|
if ((gpioCfg.internals & PI_CFG_STATS) && (gpioCfg.internals & PI_CFG_SIGHANDLER))
|
||||||
if (gpioCfg.internals & PI_CFG_STATS)
|
|
||||||
{
|
{
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"\n#####################################################\n");
|
"\n#####################################################\n");
|
||||||
|
@ -8543,7 +8535,6 @@ void gpioTerminate(void)
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"\n#####################################################\n\n\n");
|
"\n#####################################################\n\n\n");
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
initReleaseResources();
|
initReleaseResources();
|
||||||
|
|
||||||
|
|
6
pigpio.h
6
pigpio.h
|
@ -31,7 +31,7 @@ For more information, please refer to <http://unlicense.org/>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
|
||||||
#define PIGPIO_VERSION 64
|
#define PIGPIO_VERSION 65
|
||||||
|
|
||||||
/*TEXT
|
/*TEXT
|
||||||
|
|
||||||
|
@ -865,8 +865,10 @@ typedef void *(gpioThreadFunc_t) (void *);
|
||||||
#define PI_CFG_ALERT_FREQ 4 /* bits 4-7 */
|
#define PI_CFG_ALERT_FREQ 4 /* bits 4-7 */
|
||||||
#define PI_CFG_RT_PRIORITY (1<<8)
|
#define PI_CFG_RT_PRIORITY (1<<8)
|
||||||
#define PI_CFG_STATS (1<<9)
|
#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 */
|
/* gpioISR */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue