From a0cf447c7f144675e69e1b5c397633a57c8214fd Mon Sep 17 00:00:00 2001 From: "Jau-Shiuan(Jason) Shiao" Date: Thu, 26 May 2022 14:40:10 +0800 Subject: [PATCH 1/3] Fix compile error for gcc 10 --- source/py_gpio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/py_gpio.c b/source/py_gpio.c index 545f10c..97fe3ee 100644 --- a/source/py_gpio.c +++ b/source/py_gpio.c @@ -280,11 +280,11 @@ static PyObject *py_setup_channel(PyObject *self, PyObject *args, PyObject *kwar return NULL; chanlist = NULL; } - else if PyList_Check(chanlist) + else if (PyList_Check(chanlist)) { // do nothing } - else if PyTuple_Check(chanlist) + else if (PyTuple_Check(chanlist)) { chantuple = chanlist; chanlist = NULL; From ee04fcaf22e7a71caed4c3ab91c19b70e7136236 Mon Sep 17 00:00:00 2001 From: "Jau-Shiuan(Jason) Shiao" Date: Thu, 26 May 2022 14:40:45 +0800 Subject: [PATCH 2/3] Fix compile error for gcc 10 --- source/py_gpio_RPi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/py_gpio_RPi.c b/source/py_gpio_RPi.c index a1c739c..527d98b 100644 --- a/source/py_gpio_RPi.c +++ b/source/py_gpio_RPi.c @@ -273,11 +273,11 @@ static PyObject *py_setup_channel(PyObject *self, PyObject *args, PyObject *kwar return NULL; chanlist = NULL; } - else if PyList_Check(chanlist) + else if (PyList_Check(chanlist)) { // do nothing } - else if PyTuple_Check(chanlist) + else if (PyTuple_Check(chanlist)) { chantuple = chanlist; chanlist = NULL; From c3a75e751d29cfde583a286312bdef814c7ee93c Mon Sep 17 00:00:00 2001 From: "Jau-Shiuan(Jason) Shiao" Date: Thu, 26 May 2022 14:49:47 +0800 Subject: [PATCH 3/3] Add workaround for multiple definition error --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index bc96b8b..d0450ed 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,8 @@ git clone https://github.com/TinkerBoard/gpio_lib_python.git sudo apt-get install python-dev python2.7-dev python3-dev\ cd ASUS_GPIO_PYTHON_PATH/gpio/\ sudo python setup.py install + * if encounter multiple definition error, use + `CFLAGS="-fcommon" python setup.py install` #A Simple Python Program\ import ASUS.GPIO as GPIO\