summaryrefslogtreecommitdiffstats
path: root/recipes-devtools/python/rpi-gpio/0001-Remove-nested-functions.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-devtools/python/rpi-gpio/0001-Remove-nested-functions.patch')
-rw-r--r--recipes-devtools/python/rpi-gpio/0001-Remove-nested-functions.patch33
1 files changed, 2 insertions, 31 deletions
diff --git a/recipes-devtools/python/rpi-gpio/0001-Remove-nested-functions.patch b/recipes-devtools/python/rpi-gpio/0001-Remove-nested-functions.patch
index bd97179..5c94bc2 100644
--- a/recipes-devtools/python/rpi-gpio/0001-Remove-nested-functions.patch
+++ b/recipes-devtools/python/rpi-gpio/0001-Remove-nested-functions.patch
@@ -30,6 +30,8 @@ silence this warning
30 uint32_t peri_base; 30 uint32_t peri_base;
31 31
32Signed-off-by: Khem Raj <raj.khem@gmail.com> 32Signed-off-by: Khem Raj <raj.khem@gmail.com>
33[Pierre-Jean: update for version 0.7.0]
34Signed-off-by: Pierre-Jean Texier <pjtexier@koncepto.io>
33--- 35---
34Upstream-Status: Submitted 36Upstream-Status: Submitted
35 37
@@ -37,37 +39,6 @@ Upstream-Status: Submitted
37 source/py_gpio.c | 135 ++++++++++++++++++++++++++++--------------------------- 39 source/py_gpio.c | 135 ++++++++++++++++++++++++++++---------------------------
38 2 files changed, 71 insertions(+), 70 deletions(-) 40 2 files changed, 71 insertions(+), 70 deletions(-)
39 41
40diff --git a/source/c_gpio.c b/source/c_gpio.c
41index c96a2b0..b69880f 100644
42--- a/source/c_gpio.c
43+++ b/source/c_gpio.c
44@@ -61,7 +61,7 @@ int setup(void)
45 {
46 int mem_fd;
47 uint8_t *gpio_mem;
48- uint32_t peri_base;
49+ uint32_t peri_base = 0;
50 uint32_t gpio_base;
51 unsigned char buf[4];
52 FILE *fp;
53@@ -73,7 +73,7 @@ int setup(void)
54 if ((mem_fd = open("/dev/gpiomem", O_RDWR|O_SYNC)) > 0)
55 {
56 gpio_map = (uint32_t *)mmap(NULL, BLOCK_SIZE, PROT_READ|PROT_WRITE, MAP_SHARED, mem_fd, 0);
57- if ((uint32_t)gpio_map < 0) {
58+ if (gpio_map == MAP_FAILED) {
59 return SETUP_MMAP_FAIL;
60 } else {
61 return SETUP_OK;
62@@ -127,7 +127,7 @@ int setup(void)
63
64 gpio_map = (uint32_t *)mmap( (void *)gpio_mem, BLOCK_SIZE, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_FIXED, mem_fd, gpio_base);
65
66- if ((uint32_t)gpio_map < 0)
67+ if (gpio_map == MAP_FAILED)
68 return SETUP_MMAP_FAIL;
69
70 return SETUP_OK;
71diff --git a/source/py_gpio.c b/source/py_gpio.c 42diff --git a/source/py_gpio.c b/source/py_gpio.c
72index d54cc7f..007bad5 100644 43index d54cc7f..007bad5 100644
73--- a/source/py_gpio.c 44--- a/source/py_gpio.c