From 6749206cbfd32f711e3fe90c5602d3f355351287 Mon Sep 17 00:00:00 2001 From: "k.yamasaki" Date: Mon, 22 May 2017 16:17:47 +0900 Subject: [PATCH 1/4] change wiringpi source and makefile patch --- install.sh | 2 +- patchs/devLib_Makefile.patch | 20 ++++++++++---------- patchs/gpio_Makefile.patch | 17 ++++++++++------- 3 files changed, 21 insertions(+), 18 deletions(-) diff --git a/install.sh b/install.sh index 89cee74..8126d11 100644 --- a/install.sh +++ b/install.sh @@ -40,7 +40,7 @@ rm ./install.log 2>/dev/null 1>&2 echo -n "Cloning libWiringPi ... " rm -Rf ./wiringpi 2>/dev/null 1>&2 -git clone https://github.com/nekuz0r/wiringpi.git -b 2.25 > ./install.log 2>&1 +git clone https://github.com/kohei0302/wiringpi.git wiringpi > ./install.log 2>&1 check_git_clone #git submodule init #check_git_clone diff --git a/patchs/devLib_Makefile.patch b/patchs/devLib_Makefile.patch index cb9fc41..4a865df 100644 --- a/patchs/devLib_Makefile.patch +++ b/patchs/devLib_Makefile.patch @@ -1,19 +1,19 @@ ---- Makefile_org 2014-07-04 09:48:18.000000000 +0200 -+++ Makefile 2014-07-04 10:12:15.000000000 +0200 -@@ -26,6 +26,7 @@ - VERSION=$(DYN_VERS_MAJ).$(DYN_VERS_MIN) - DESTDIR=/usr - PREFIX=/local +--- a/devLib/Makefile ++++ b/devLib/Makefile +@@ -24,6 +24,7 @@ + VERSION=$(shell cat ../VERSION) + DESTDIR?=/usr + PREFIX?=/local +PWD=`pwd` - STATIC=libwiringPiDev.a - DYNAMIC=libwiringPiDev.so.$(VERSION) -@@ -33,7 +34,7 @@ + LDCONFIG?=ldconfig + +@@ -37,7 +38,7 @@ DYNAMIC=libwiringPiDev.so.$(VERSION) #DEBUG = -g -O0 DEBUG = -O2 CC = gcc -INCLUDE = -I. +INCLUDE = -I. -I$(PWD)/../wiringPi DEFS = -D_GNU_SOURCE - CFLAGS = $(DEBUG) -Wformat=2 -Wall $(INCLUDE) -Winline -pipe -fPIC + CFLAGS = $(DEBUG) $(DEFS) -Wformat=2 -Wall -Winline $(INCLUDE) -pipe -fPIC diff --git a/patchs/gpio_Makefile.patch b/patchs/gpio_Makefile.patch index e50bfe0..542b141 100644 --- a/patchs/gpio_Makefile.patch +++ b/patchs/gpio_Makefile.patch @@ -1,20 +1,23 @@ ---- Makefile_org 2014-07-04 09:58:05.000000000 +0200 -+++ Makefile 2014-07-04 10:13:01.000000000 +0200 -@@ -25,14 +25,15 @@ +--- a/gpio/Makefile ++++ b/gpio/Makefile +@@ -25,6 +25,7 @@ - DESTDIR=/usr - PREFIX=/local + DESTDIR?=/usr + PREFIX?=/local +PWD=`pwd` + ifneq ($V,1) + Q ?= @ +@@ -33,10 +34,10 @@ endif #DEBUG = -g -O0 DEBUG = -O2 CC = gcc -INCLUDE = -I$(DESTDIR)$(PREFIX)/include +INCLUDE = -I$(PWD)/../wiringPi -I$(PWD)/../devLib - CFLAGS = $(DEBUG) -Wall $(INCLUDE) -Winline -pipe + CFLAGS = $(DEBUG) -Wall -Wextra $(INCLUDE) -Winline -pipe -LDFLAGS = -L$(DESTDIR)$(PREFIX)/lib +LDFLAGS = -L$(PWD)/../wiringPi -L$(PWD)/../devLib - LIBS = -lwiringPi -lwiringPiDev -lpthread -lm + LIBS = -lwiringPi -lwiringPiDev -lpthread -lrt -lm -lcrypt # May not need to alter anything below this line From bce68077bebd41009f9051b8e37b1a3e575932fd Mon Sep 17 00:00:00 2001 From: "k.yamasaki" Date: Mon, 22 May 2017 16:53:38 +0900 Subject: [PATCH 2/4] change constant parameter --- DOCUMENTATION.md | 30 ++++++++++++++++++------------ src/wiringPi.cc | 19 +++++++++++-------- 2 files changed, 29 insertions(+), 20 deletions(-) diff --git a/DOCUMENTATION.md b/DOCUMENTATION.md index 9c22a75..05aebe7 100644 --- a/DOCUMENTATION.md +++ b/DOCUMENTATION.md @@ -363,25 +363,33 @@ Returns an object with the following keys: Indexes of each string table have corresponding constants * `PI_MODEL_NAME` - * `PI_MODEL_UNKNOWN` - >= 2.0.0 * `PI_MODEL_A` >= 1.1.0 - * `PI_MODEL_AP` - >= 2.1.0 * `PI_MODEL_B` >= 1.1.0 + * `PI_MODEL_AP` + >= 2.1.0 * `PI_MODEL_BP` >= 2.0.0 + * `PI_MODEL_2` + >= 2.1.0 + * `PI_ALPHA` + >= 2.1.0 * `PI_MODEL_CM` >= 1.1.1 - * `PI_MODEL_2` + * `PI_MODEL_07` + >= 2.1.0 + * `PI_MODEL_3` + >= 2.1.0 + * `PI_MODEL_ZERO` + >= 2.1.0 + * `PI_MODEL_CM3` + >= 2.1.0 + * `PI_MODEL_ZERO_W` >= 2.1.0 * `PI_REVISION_NAMES` - * `PI_VERSION_UNKNOWN` - >= 2.0.0 * `PI_VERSION_1` >= 2.0.0 * `PI_VERSION_1_1` @@ -392,15 +400,13 @@ Indexes of each string table have corresponding constants >= 2.0.0 * `PI_MAKER_NAMES` - * `PI_MAKER_UNKNOWN` + * `PI_MAKER_SONY` >= 2.0.0 * `PI_MAKER_EGOMAN` >= 2.0.0 - * `PI_MAKER_MBEST` + * `PI_MAKER_EMBEST` >= 2.1.0 - * `PI_MAKER_SONY` - >= 2.0.0 - * `PI_MAKER_QISDA` + * `PI_MAKER_UNKNOWN` >= 2.0.0 ### wpiPinToGpio(pin) diff --git a/src/wiringPi.cc b/src/wiringPi.cc index 9fedf97..337cbb0 100644 --- a/src/wiringPi.cc +++ b/src/wiringPi.cc @@ -741,25 +741,28 @@ IMPLEMENT_EXPORT_INIT(wiringPi) { EXPORT_CONSTANT_INT(PWM_MODE_MS); // piBoardId - EXPORT_CONSTANT_INT(PI_MODEL_UNKNOWN); EXPORT_CONSTANT_INT(PI_MODEL_A); EXPORT_CONSTANT_INT(PI_MODEL_B); - EXPORT_CONSTANT_INT(PI_MODEL_BP); - EXPORT_CONSTANT_INT(PI_MODEL_CM); EXPORT_CONSTANT_INT(PI_MODEL_AP); + EXPORT_CONSTANT_INT(PI_MODEL_BP); EXPORT_CONSTANT_INT(PI_MODEL_2); + EXPORT_CONSTANT_INT(PI_ALPHA); + EXPORT_CONSTANT_INT(PI_MODEL_CM); + EXPORT_CONSTANT_INT(PI_MODEL_07); + EXPORT_CONSTANT_INT(PI_MODEL_3); + EXPORT_CONSTANT_INT(PI_MODEL_ZERO); + EXPORT_CONSTANT_INT(PI_MODEL_CM3); + EXPORT_CONSTANT_INT(PI_MODEL_ZERO_W); - EXPORT_CONSTANT_INT(PI_VERSION_UNKNOWN); EXPORT_CONSTANT_INT(PI_VERSION_1); EXPORT_CONSTANT_INT(PI_VERSION_1_1); EXPORT_CONSTANT_INT(PI_VERSION_1_2); EXPORT_CONSTANT_INT(PI_VERSION_2); - EXPORT_CONSTANT_INT(PI_MAKER_UNKNOWN); - EXPORT_CONSTANT_INT(PI_MAKER_EGOMAN); EXPORT_CONSTANT_INT(PI_MAKER_SONY); - EXPORT_CONSTANT_INT(PI_MAKER_QISDA); - EXPORT_CONSTANT_INT(PI_MAKER_MBEST); + EXPORT_CONSTANT_INT(PI_MAKER_EGOMAN); + EXPORT_CONSTANT_INT(PI_MAKER_EMBEST); + EXPORT_CONSTANT_INT(PI_MAKER_UNKNOWN); EXPORT_CONSTANT_STRING_ARRAY(PI_MODEL_NAMES, piModelNames, 7); EXPORT_CONSTANT_STRING_ARRAY(PI_REVISION_NAMES, piRevisionNames, 5); From 7b713cbbedc420971acdf1e3749256f1939c194f Mon Sep 17 00:00:00 2001 From: kohei yamasaki Date: Sat, 16 Sep 2017 17:07:45 +0900 Subject: [PATCH 3/4] fix document for 3.0.0 --- DOCUMENTATION.md | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/DOCUMENTATION.md b/DOCUMENTATION.md index 05aebe7..8112675 100644 --- a/DOCUMENTATION.md +++ b/DOCUMENTATION.md @@ -363,6 +363,8 @@ Returns an object with the following keys: Indexes of each string table have corresponding constants * `PI_MODEL_NAME` + * `PI_MODEL_UNKNOWN` + < 3.0.0 * `PI_MODEL_A` >= 1.1.0 * `PI_MODEL_B` @@ -374,22 +376,24 @@ Indexes of each string table have corresponding constants * `PI_MODEL_2` >= 2.1.0 * `PI_ALPHA` - >= 2.1.0 + >= 3.0.0 * `PI_MODEL_CM` >= 1.1.1 * `PI_MODEL_07` - >= 2.1.0 + >= 3.0.0 * `PI_MODEL_3` - >= 2.1.0 + >= 3.0.0 * `PI_MODEL_ZERO` - >= 2.1.0 + >= 3.0.0 * `PI_MODEL_CM3` - >= 2.1.0 + >= 3.0.0 * `PI_MODEL_ZERO_W` - >= 2.1.0 + >= 3.0.0 * `PI_REVISION_NAMES` + * `PI_VERSION_UNKNOWN` + < 3.0.0 * `PI_VERSION_1` >= 2.0.0 * `PI_VERSION_1_1` @@ -405,9 +409,14 @@ Indexes of each string table have corresponding constants * `PI_MAKER_EGOMAN` >= 2.0.0 * `PI_MAKER_EMBEST` - >= 2.1.0 + >= 3.0.0 * `PI_MAKER_UNKNOWN` >= 2.0.0 + * `PI_MAKER_MBEST` + < 3.0.0 + * `PI_MAKER_QISDA` + < 3.0.0 + ### wpiPinToGpio(pin) >= 1.0.0 From e245d3f07da20677b74f8b00df79a0011e756309 Mon Sep 17 00:00:00 2001 From: kohei yamasaki Date: Sat, 16 Sep 2017 17:28:11 +0900 Subject: [PATCH 4/4] change URL of clone --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 8126d11..52ae867 100644 --- a/install.sh +++ b/install.sh @@ -40,7 +40,7 @@ rm ./install.log 2>/dev/null 1>&2 echo -n "Cloning libWiringPi ... " rm -Rf ./wiringpi 2>/dev/null 1>&2 -git clone https://github.com/kohei0302/wiringpi.git wiringpi > ./install.log 2>&1 +git clone https://github.com/nekuz0r/wiringpi.git -b v2.44 --depth 1 > ./install.log 2>&1 check_git_clone #git submodule init #check_git_clone