summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cygpio/cygpio.pyx12
-rw-r--r--default.nix11
2 files changed, 19 insertions, 4 deletions
diff --git a/cygpio/cygpio.pyx b/cygpio/cygpio.pyx
index 9049cda..dd0a931 100644
--- a/cygpio/cygpio.pyx
+++ b/cygpio/cygpio.pyx
@@ -20,6 +20,10 @@ cdef extern from "pigpio.h":
int gpioWaveAddSerial(unsigned user_gpio, unsigned baud, unsigned data_bits, unsigned stop_bits, unsigned offset, unsigned numBytes, char *str)
+ int gpioCfgMemAlloc(unsigned memAllocMode)
+ unsigned int gpioCfgGetInternals()
+ int gpioCfgSetInternals(unsigned int cfgVal)
+
cdef int INPUT "PI_INPUT"
cdef int OUTPUT "PI_OUTPUT"
cdef int PI_DISABLE_FIFO_IF
@@ -27,6 +31,8 @@ cdef extern from "pigpio.h":
cdef int PI_WAVE_MODE_ONE_SHOT
+ cdef unsigned PI_MEM_ALLOC_PAGEMAP
+
cdef extern from "unistd.h" nogil:
unsigned int sleep(unsigned int seconds)
unsigned int usleep(unsigned int usecs)
@@ -46,6 +52,12 @@ cdef class CythonRaspiBackend(object):
self.tx_pin = tx_pin
cpdef open(self):
+ # Enable full on debug
+ gpioCfgSetInternals(gpioCfgGetInternals() | 8);
+
+ # Force usage of non-mailbox DMA
+ gpioCfgMemAlloc(PI_MEM_ALLOC_PAGEMAP);
+
gpioCfgInterfaces(PI_DISABLE_FIFO_IF | PI_DISABLE_SOCK_IF);
gpioInitialise()
gpioWaveClear()
diff --git a/default.nix b/default.nix
index 3afa202..b83484f 100644
--- a/default.nix
+++ b/default.nix
@@ -18,6 +18,7 @@ let
inherit pyjwt;
inherit pytest;
inherit qrcode;
+ inherit raspberrypi-tools;
inherit requests;
inherit six;
};
@@ -92,15 +93,17 @@ in with upstream; let
pigpio = stdenv.mkDerivation rec {
pname = "pigpio";
- version = "74";
+ version = "74-q3k";
installFlags = [ "DESTDIR=$(out)" "prefix=" ];
src = pkgs.fetchFromGitHub {
- owner = "joan2937";
+ owner = "q3k";
repo = "pigpio";
- rev = "v${version}";
- sha256 = "1arq051dbki50rwhzdxjba3ispnl4vdw7mr244f5hmrk0p34frcy";
+ rev = "5a0b27c997631b3ba1a7778a176b6f5462233be4";
+ sha256 = "1b55bzfsyghd2lrfqmz6g935zsmwnhbcscb4g11hxm3g7a68g9vv";
};
+
+ propagatedBuildInputs = [ raspberrypi-tools ];
};
cygpio = buildPythonPackage {