mirror of https://github.com/joan2937/pigpio
parent
d5f32d3301
commit
a41d63493b
11
pigpio.3
11
pigpio.3
|
@ -6936,8 +6936,11 @@ and 611 control blocks on a lite channel.
|
|||
|
||||
.IP "\fBint gpioCfgPermissions(uint64_t updateMask)\fP"
|
||||
.IP "" 4
|
||||
Configures pigpio to only allow updates (writes or mode changes) for the
|
||||
GPIO specified by the mask.
|
||||
Configures pigpio to restrict GPIO updates via the socket or pipe
|
||||
interfaces to the GPIO specified by the mask. Programs directly
|
||||
calling the pigpio library (i.e. linked with -lpigpio are not
|
||||
affected). A GPIO update is a write to a GPIO or a GPIO mode
|
||||
change or any function which would force such an action.
|
||||
|
||||
.br
|
||||
|
||||
|
@ -6963,7 +6966,7 @@ added to the mask.
|
|||
.br
|
||||
|
||||
.br
|
||||
If the board revision is not recognised then GPIO 0-31 are allowed.
|
||||
If the board revision is not recognised then GPIO 2-27 are allowed.
|
||||
|
||||
.br
|
||||
|
||||
|
@ -10259,7 +10262,7 @@ A 16-bit word value.
|
|||
.br
|
||||
#define PI_DEFAULT_SOCKET_ADDR_STR "127.0.0.1"
|
||||
.br
|
||||
#define PI_DEFAULT_UPDATE_MASK_UNKNOWN 0xFFFFFFFF
|
||||
#define PI_DEFAULT_UPDATE_MASK_UNKNOWN 0x0000000FFFFFFCLL
|
||||
.br
|
||||
#define PI_DEFAULT_UPDATE_MASK_B1 0x03E7CF93
|
||||
.br
|
||||
|
|
6
pigpio.c
6
pigpio.c
|
@ -205,7 +205,7 @@ bit 0 READ_LAST_NOT_SET_ERROR
|
|||
#define DO_DBG(level, format, arg...) \
|
||||
{ \
|
||||
if ((gpioCfg.dbgLevel >= level) && \
|
||||
(!(gpioCfg.internals & PI_CFG_SIGHANDLER))) \
|
||||
(!(gpioCfg.internals & PI_CFG_NOSIGHANDLER))) \
|
||||
fprintf(stderr, "%s %s: " format "\n" , \
|
||||
myTimeStamp(), __FUNCTION__ , ## arg); \
|
||||
}
|
||||
|
@ -8135,7 +8135,7 @@ int initInitialise(void)
|
|||
}
|
||||
|
||||
#ifndef EMBEDDED_IN_VM
|
||||
if (!(gpioCfg.internals & PI_CFG_SIGHANDLER))
|
||||
if (!(gpioCfg.internals & PI_CFG_NOSIGHANDLER))
|
||||
sigSetHandler();
|
||||
#endif
|
||||
|
||||
|
@ -8534,7 +8534,7 @@ void gpioTerminate(void)
|
|||
|
||||
#ifndef EMBEDDED_IN_VM
|
||||
if ((gpioCfg.internals & PI_CFG_STATS) &&
|
||||
(!(gpioCfg.internals & PI_CFG_SIGHANDLER)))
|
||||
(!(gpioCfg.internals & PI_CFG_NOSIGHANDLER)))
|
||||
{
|
||||
fprintf(stderr,
|
||||
"\n#####################################################\n");
|
||||
|
|
15
pigpio.h
15
pigpio.h
|
@ -31,7 +31,7 @@ For more information, please refer to <http://unlicense.org/>
|
|||
#include <stdint.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#define PIGPIO_VERSION 6507
|
||||
#define PIGPIO_VERSION 6509
|
||||
|
||||
/*TEXT
|
||||
|
||||
|
@ -865,7 +865,7 @@ 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_NOSIGHANDLER (1<<10)
|
||||
|
||||
#define PI_CFG_ILLEGAL_VAL (1<<11)
|
||||
|
||||
|
@ -4712,8 +4712,11 @@ D*/
|
|||
/*F*/
|
||||
int gpioCfgPermissions(uint64_t updateMask);
|
||||
/*D
|
||||
Configures pigpio to only allow updates (writes or mode changes) for the
|
||||
GPIO specified by the mask.
|
||||
Configures pigpio to restrict GPIO updates via the socket or pipe
|
||||
interfaces to the GPIO specified by the mask. Programs directly
|
||||
calling the pigpio library (i.e. linked with -lpigpio are not
|
||||
affected). A GPIO update is a write to a GPIO or a GPIO mode
|
||||
change or any function which would force such an action.
|
||||
|
||||
This function is only effective if called before [*gpioInitialise*].
|
||||
|
||||
|
@ -4724,7 +4727,7 @@ updateMask: bit (1<<n) is set for each GPIO n which may be updated
|
|||
The default setting depends upon the Pi model. The user GPIO are
|
||||
added to the mask.
|
||||
|
||||
If the board revision is not recognised then GPIO 0-31 are allowed.
|
||||
If the board revision is not recognised then GPIO 2-27 are allowed.
|
||||
|
||||
Unknown board @ PI_DEFAULT_UPDATE_MASK_UNKNOWN @ 0xFFFFFFFF
|
||||
Type 1 board @ PI_DEFAULT_UPDATE_MASK_B1 @ 0x03E6CF93
|
||||
|
@ -6373,7 +6376,7 @@ after this command is issued.
|
|||
#define PI_DEFAULT_SOCKET_PORT 8888
|
||||
#define PI_DEFAULT_SOCKET_PORT_STR "8888"
|
||||
#define PI_DEFAULT_SOCKET_ADDR_STR "127.0.0.1"
|
||||
#define PI_DEFAULT_UPDATE_MASK_UNKNOWN 0xFFFFFFFF
|
||||
#define PI_DEFAULT_UPDATE_MASK_UNKNOWN 0x0000000FFFFFFCLL
|
||||
#define PI_DEFAULT_UPDATE_MASK_B1 0x03E7CF93
|
||||
#define PI_DEFAULT_UPDATE_MASK_A_B2 0xFBC7CF9C
|
||||
#define PI_DEFAULT_UPDATE_MASK_APLUS_BPLUS 0x0080480FFFFFFCLL
|
||||
|
|
21
pigpio.py
21
pigpio.py
|
@ -3,7 +3,7 @@ pigpio is a Python module for the Raspberry which talks to
|
|||
the pigpio daemon to allow control of the general purpose
|
||||
input outputs (GPIO).
|
||||
|
||||
[http://abyz.co.uk/rpi/pigpio/python.html]
|
||||
[http://abyz.me.uk/rpi/pigpio/python.html]
|
||||
|
||||
*Features*
|
||||
|
||||
|
@ -299,7 +299,7 @@ import threading
|
|||
import os
|
||||
import atexit
|
||||
|
||||
VERSION = "1.38"
|
||||
VERSION = "1.39"
|
||||
|
||||
exceptions = True
|
||||
|
||||
|
@ -1114,17 +1114,19 @@ class _callback_thread(threading.Thread):
|
|||
|
||||
lastLevel = self.lastLevel
|
||||
|
||||
RECV_SIZ = 4096
|
||||
MSG_SIZ = 12
|
||||
|
||||
buf = bytes()
|
||||
while self.go:
|
||||
|
||||
buf = self.sl.s.recv(MSG_SIZ)
|
||||
buf += self.sl.s.recv(RECV_SIZ)
|
||||
offset = 0
|
||||
|
||||
while self.go and len(buf) < MSG_SIZ:
|
||||
buf += self.sl.s.recv(MSG_SIZ-len(buf))
|
||||
|
||||
if self.go:
|
||||
seq, flags, tick, level = (struct.unpack('HHII', buf))
|
||||
while self.go and (len(buf) - offset) >= MSG_SIZ:
|
||||
msgbuf = buf[offset:offset + MSG_SIZ]
|
||||
offset += MSG_SIZ
|
||||
seq, flags, tick, level = (struct.unpack('HHII', msgbuf))
|
||||
|
||||
if flags == 0:
|
||||
changed = level ^ lastLevel
|
||||
|
@ -1147,6 +1149,7 @@ class _callback_thread(threading.Thread):
|
|||
for cb in self.events:
|
||||
if cb.event == event:
|
||||
cb.func(event, tick)
|
||||
buf = buf[offset:]
|
||||
|
||||
self.sl.s.close()
|
||||
|
||||
|
@ -4163,7 +4166,7 @@ class pi():
|
|||
"""
|
||||
Store a script for later execution.
|
||||
|
||||
See [[http://abyz.co.uk/rpi/pigpio/pigs.html#Scripts]] for
|
||||
See [[http://abyz.me.uk/rpi/pigpio/pigs.html#Scripts]] for
|
||||
details.
|
||||
|
||||
script:= the script text as a series of bytes.
|
||||
|
|
Loading…
Reference in New Issue