From 302e19e14c7f33a54842f3fc3db29477733db48a Mon Sep 17 00:00:00 2001 From: Peter Gallagher Date: Sun, 9 Jun 2019 14:59:09 +0100 Subject: [PATCH 01/35] Change Git Repo to Official --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 89cee74..f772739 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/WiringPi/WiringPi.git > ./install.log 2>&1 check_git_clone #git submodule init #check_git_clone From d07b8980756b3956ebeb00ca1bbe9e2702336890 Mon Sep 17 00:00:00 2001 From: Peter Gallagher Date: Sun, 9 Jun 2019 15:09:11 +0100 Subject: [PATCH 02/35] Remove patches --- install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index f772739..8ca6230 100644 --- a/install.sh +++ b/install.sh @@ -48,8 +48,8 @@ check_git_clone #check_git_clone echo "done." -patch ./wiringpi/devLib/Makefile < ./patchs/devLib_Makefile.patch -patch ./wiringpi/gpio/Makefile < ./patchs/gpio_Makefile.patch +#patch ./wiringpi/devLib/Makefile < ./patchs/devLib_Makefile.patch +#patch ./wiringpi/gpio/Makefile < ./patchs/gpio_Makefile.patch echo -n "Making libWiringPi ... " cd ./wiringpi/wiringPi/ From 59c9d61a2fa9030391a503f4a2d8840d9e42c448 Mon Sep 17 00:00:00 2001 From: Peter Gallagher Date: Sun, 9 Jun 2019 15:16:09 +0100 Subject: [PATCH 03/35] Point at my git repo --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a47182d..9db8a0d 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ }, "repository": { "type": "git", - "url": "git@github.com:WiringPi/WiringPi-Node.git" + "url": "git@github.com:pjgpetecodes/WiringPi-Node.git" }, "keywords": [ "wiringPi", From 9884759a685382125f10847a3dd8cfd182246a47 Mon Sep 17 00:00:00 2001 From: Peter Gallagher Date: Sun, 9 Jun 2019 15:17:05 +0100 Subject: [PATCH 04/35] Update version number --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9db8a0d..904a071 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wiring-pi", - "version": "2.2.1", + "version": "2.5", "description": "Bindings to wiringPi", "main": "lib/exports.js", "scripts": { From 8b7e0735c554fdad0eb3d4cabe6cef366c61c311 Mon Sep 17 00:00:00 2001 From: Peter Gallagher Date: Sun, 9 Jun 2019 15:19:43 +0100 Subject: [PATCH 05/35] Update version to correct format --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 904a071..3a97271 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wiring-pi", - "version": "2.5", + "version": "2.5.0", "description": "Bindings to wiringPi", "main": "lib/exports.js", "scripts": { From 76e6feb33f18a98db637810d1a3f17cc783cae49 Mon Sep 17 00:00:00 2001 From: Peter Gallagher Date: Sun, 9 Jun 2019 15:25:15 +0100 Subject: [PATCH 06/35] Change directory name to match proper repo --- install.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/install.sh b/install.sh index 8ca6230..f3ea0a3 100644 --- a/install.sh +++ b/install.sh @@ -39,7 +39,7 @@ check_git_clone() { rm ./install.log 2>/dev/null 1>&2 echo -n "Cloning libWiringPi ... " -rm -Rf ./wiringpi 2>/dev/null 1>&2 +rm -Rf ./Wiringpi 2>/dev/null 1>&2 git clone https://github.com/WiringPi/WiringPi.git > ./install.log 2>&1 check_git_clone #git submodule init @@ -48,18 +48,18 @@ check_git_clone #check_git_clone echo "done." -#patch ./wiringpi/devLib/Makefile < ./patchs/devLib_Makefile.patch -#patch ./wiringpi/gpio/Makefile < ./patchs/gpio_Makefile.patch +patch ./Wiringpi/devLib/Makefile < ./patchs/devLib_Makefile.patch +patch ./Wiringpi/gpio/Makefile < ./patchs/gpio_Makefile.patch echo -n "Making libWiringPi ... " -cd ./wiringpi/wiringPi/ +cd ./Wiringpi/wiringPi/ make clean >> ../../install.log 2>&1 make static >> ../../install.log 2>&1 check_make_ok "libWiringPi" 1 cd ../../ echo "done." -cd ./wiringpi/devLib/ +cd ./Wiringpi/devLib/ echo -n "Making devLib ..." make clean >> ../../install.log 2>&1 make static >> ../../install.log 2>&1 @@ -67,7 +67,7 @@ check_make_ok "devLib" 0 cd ../../ echo "done." -cd ./wiringpi/gpio/ +cd ./Wiringpi/gpio/ echo -n "Unistalling gpio utility ... " sudo make uninstall >> ../../install.log 2>&1 echo "done." From f1f204a3f506f3b9c91ce462c8127d6ec9bc040c Mon Sep 17 00:00:00 2001 From: Peter Gallagher Date: Sun, 9 Jun 2019 15:27:46 +0100 Subject: [PATCH 07/35] Update directory name again --- install.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/install.sh b/install.sh index f3ea0a3..298bf88 100644 --- a/install.sh +++ b/install.sh @@ -39,7 +39,7 @@ check_git_clone() { rm ./install.log 2>/dev/null 1>&2 echo -n "Cloning libWiringPi ... " -rm -Rf ./Wiringpi 2>/dev/null 1>&2 +rm -Rf ./WiringPi 2>/dev/null 1>&2 git clone https://github.com/WiringPi/WiringPi.git > ./install.log 2>&1 check_git_clone #git submodule init @@ -48,18 +48,18 @@ check_git_clone #check_git_clone echo "done." -patch ./Wiringpi/devLib/Makefile < ./patchs/devLib_Makefile.patch -patch ./Wiringpi/gpio/Makefile < ./patchs/gpio_Makefile.patch +patch ./WiringPi/devLib/Makefile < ./patchs/devLib_Makefile.patch +patch ./WiringPi/gpio/Makefile < ./patchs/gpio_Makefile.patch echo -n "Making libWiringPi ... " -cd ./Wiringpi/wiringPi/ +cd ./WiringPi/wiringPi/ make clean >> ../../install.log 2>&1 make static >> ../../install.log 2>&1 check_make_ok "libWiringPi" 1 cd ../../ echo "done." -cd ./Wiringpi/devLib/ +cd ./WiringPi/devLib/ echo -n "Making devLib ..." make clean >> ../../install.log 2>&1 make static >> ../../install.log 2>&1 @@ -67,7 +67,7 @@ check_make_ok "devLib" 0 cd ../../ echo "done." -cd ./Wiringpi/gpio/ +cd ./WiringPi/gpio/ echo -n "Unistalling gpio utility ... " sudo make uninstall >> ../../install.log 2>&1 echo "done." From bab1f2e801f99f394a32a683a7f322c5f7a43c51 Mon Sep 17 00:00:00 2001 From: Peter Gallagher Date: Sun, 9 Jun 2019 16:03:05 +0100 Subject: [PATCH 08/35] Fix to match latest GPIO Make File --- patchs/gpio_Makefile.patch | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/patchs/gpio_Makefile.patch b/patchs/gpio_Makefile.patch index e50bfe0..ecd2b31 100644 --- a/patchs/gpio_Makefile.patch +++ b/patchs/gpio_Makefile.patch @@ -5,6 +5,10 @@ DESTDIR=/usr PREFIX=/local +PWD=`pwd` + +ifneq ($V,1) +Q ?= @ +endif #DEBUG = -g -O0 DEBUG = -O2 From 2e9b1a70a79ba34e086c49f831ed6cea5899f16f Mon Sep 17 00:00:00 2001 From: Peter Gallagher Date: Sun, 9 Jun 2019 16:05:29 +0100 Subject: [PATCH 09/35] Change to match latest DevLib --- patchs/devLib_Makefile.patch | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/patchs/devLib_Makefile.patch b/patchs/devLib_Makefile.patch index cb9fc41..f1340ac 100644 --- a/patchs/devLib_Makefile.patch +++ b/patchs/devLib_Makefile.patch @@ -6,6 +6,12 @@ PREFIX=/local +PWD=`pwd` +LDCONFIG?=ldconfig + +ifneq ($V,1) +Q ?= @ +endif + STATIC=libwiringPiDev.a DYNAMIC=libwiringPiDev.so.$(VERSION) @@ -33,7 +34,7 @@ From 2c62be120c450e7d984d1d814ee3dc2db603cf6b Mon Sep 17 00:00:00 2001 From: Peter Gallagher Date: Sun, 9 Jun 2019 16:09:36 +0100 Subject: [PATCH 10/35] Add spaces --- patchs/devLib_Makefile.patch | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/patchs/devLib_Makefile.patch b/patchs/devLib_Makefile.patch index f1340ac..1c24766 100644 --- a/patchs/devLib_Makefile.patch +++ b/patchs/devLib_Makefile.patch @@ -6,11 +6,11 @@ PREFIX=/local +PWD=`pwd` -LDCONFIG?=ldconfig + LDCONFIG?=ldconfig -ifneq ($V,1) -Q ?= @ -endif + ifneq ($V,1) + Q ?= @ + endif STATIC=libwiringPiDev.a DYNAMIC=libwiringPiDev.so.$(VERSION) From 3f4b79d14a1da5a3c36f083a65d85849e38c4763 Mon Sep 17 00:00:00 2001 From: Peter Gallagher Date: Sun, 9 Jun 2019 16:09:57 +0100 Subject: [PATCH 11/35] Add Spaces --- patchs/gpio_Makefile.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/patchs/gpio_Makefile.patch b/patchs/gpio_Makefile.patch index ecd2b31..12af3b8 100644 --- a/patchs/gpio_Makefile.patch +++ b/patchs/gpio_Makefile.patch @@ -6,9 +6,9 @@ PREFIX=/local +PWD=`pwd` -ifneq ($V,1) -Q ?= @ -endif + ifneq ($V,1) + Q ?= @ + endif #DEBUG = -g -O0 DEBUG = -O2 From d0ef2bc05ac4216696876ffdefd8cf04cc1649ee Mon Sep 17 00:00:00 2001 From: Peter Gallagher Date: Sun, 9 Jun 2019 16:13:12 +0100 Subject: [PATCH 12/35] Update gpio_Makefile.patch --- patchs/gpio_Makefile.patch | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/patchs/gpio_Makefile.patch b/patchs/gpio_Makefile.patch index 12af3b8..0936714 100644 --- a/patchs/gpio_Makefile.patch +++ b/patchs/gpio_Makefile.patch @@ -2,8 +2,8 @@ +++ Makefile 2014-07-04 10:13:01.000000000 +0200 @@ -25,14 +25,15 @@ - DESTDIR=/usr - PREFIX=/local + DESTDIR=?/usr + PREFIX=?/local +PWD=`pwd` ifneq ($V,1) @@ -15,10 +15,10 @@ 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 28b2164d36e8eb5a095f92ba049b8dd2c05a7b2f Mon Sep 17 00:00:00 2001 From: Peter Gallagher Date: Sun, 9 Jun 2019 16:17:26 +0100 Subject: [PATCH 13/35] Match to latest --- patchs/devLib_Makefile.patch | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/patchs/devLib_Makefile.patch b/patchs/devLib_Makefile.patch index 1c24766..ea24123 100644 --- a/patchs/devLib_Makefile.patch +++ b/patchs/devLib_Makefile.patch @@ -1,9 +1,9 @@ --- 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 + VERSION=$(shell cat ../VERSION) + DESTDIR?=/usr + PREFIX?=/local +PWD=`pwd` LDCONFIG?=ldconfig @@ -14,12 +14,12 @@ STATIC=libwiringPiDev.a DYNAMIC=libwiringPiDev.so.$(VERSION) -@@ -33,7 +34,7 @@ +@@ -40,7 +41,7 @@ #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 From f4c86e46efb39eaffc8c3dbc21ffcfaeabb9e950 Mon Sep 17 00:00:00 2001 From: Peter Gallagher Date: Sun, 9 Jun 2019 16:23:00 +0100 Subject: [PATCH 14/35] Fix typo --- patchs/gpio_Makefile.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patchs/gpio_Makefile.patch b/patchs/gpio_Makefile.patch index 0936714..2035970 100644 --- a/patchs/gpio_Makefile.patch +++ b/patchs/gpio_Makefile.patch @@ -2,8 +2,8 @@ +++ Makefile 2014-07-04 10:13:01.000000000 +0200 @@ -25,14 +25,15 @@ - DESTDIR=?/usr - PREFIX=?/local + DESTDIR?=/usr + PREFIX?=/local +PWD=`pwd` ifneq ($V,1) From 852c0d03a1a3a4d3ec8d94c7d461276e34cc508d Mon Sep 17 00:00:00 2001 From: Peter Gallagher Date: Sun, 9 Jun 2019 16:31:19 +0100 Subject: [PATCH 15/35] Remove PulseIn --- src/wiringPi.cc | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/wiringPi.cc b/src/wiringPi.cc index 9fedf97..7b94365 100644 --- a/src/wiringPi.cc +++ b/src/wiringPi.cc @@ -18,7 +18,7 @@ DECLARE(digitalWrite); DECLARE(pwmWrite); DECLARE(analogRead); DECLARE(analogWrite); -DECLARE(pulseIn); +//DECLARE(pulseIn); DECLARE(delay); DECLARE(delayMicroseconds); @@ -347,26 +347,26 @@ IMPLEMENT(analogWrite) { SCOPE_CLOSE(UNDEFINED()); } -IMPLEMENT(pulseIn) { - SCOPE_OPEN(); +//IMPLEMENT(pulseIn) { +// SCOPE_OPEN(); - SET_ARGUMENT_NAME(0, pin); - SET_ARGUMENT_NAME(1, state); +// SET_ARGUMENT_NAME(0, pin); +// SET_ARGUMENT_NAME(1, state); - CHECK_ARGUMENTS_LENGTH_EQUAL(2); +// CHECK_ARGUMENTS_LENGTH_EQUAL(2); - CHECK_ARGUMENT_TYPE_INT32(0); - CHECK_ARGUMENT_TYPE_INT32(1); +// CHECK_ARGUMENT_TYPE_INT32(0); +// CHECK_ARGUMENT_TYPE_INT32(1); - int pin = GET_ARGUMENT_AS_INT32(0); - int state = GET_ARGUMENT_AS_INT32(1); +// int pin = GET_ARGUMENT_AS_INT32(0); +// int state = GET_ARGUMENT_AS_INT32(1); - CHECK_ARGUMENT_IN_INTS(1, state, (HIGH, LOW)); +// CHECK_ARGUMENT_IN_INTS(1, state, (HIGH, LOW)); - int us = ::pulseIn(pin, state); +// int us = ::pulseIn(pin, state); - SCOPE_CLOSE(INT32(us)); -} +// SCOPE_CLOSE(INT32(us)); +// } IMPLEMENT(delay) { SCOPE_OPEN(); @@ -689,7 +689,7 @@ IMPLEMENT_EXPORT_INIT(wiringPi) { EXPORT_FUNCTION(pwmWrite); EXPORT_FUNCTION(analogRead); EXPORT_FUNCTION(analogWrite); - EXPORT_FUNCTION(pulseIn); + //EXPORT_FUNCTION(pulseIn); EXPORT_FUNCTION(delay); EXPORT_FUNCTION(delayMicroseconds); From e756dd9fd234bd6185a59314a6bea96a31e681f5 Mon Sep 17 00:00:00 2001 From: Peter Gallagher Date: Sun, 9 Jun 2019 16:42:04 +0100 Subject: [PATCH 16/35] Remove error exports --- src/wiringPi.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/wiringPi.cc b/src/wiringPi.cc index 7b94365..91d86a4 100644 --- a/src/wiringPi.cc +++ b/src/wiringPi.cc @@ -749,7 +749,7 @@ IMPLEMENT_EXPORT_INIT(wiringPi) { EXPORT_CONSTANT_INT(PI_MODEL_AP); EXPORT_CONSTANT_INT(PI_MODEL_2); - EXPORT_CONSTANT_INT(PI_VERSION_UNKNOWN); + //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); @@ -758,8 +758,8 @@ IMPLEMENT_EXPORT_INIT(wiringPi) { 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_QISDA); + //EXPORT_CONSTANT_INT(PI_MAKER_MBEST); EXPORT_CONSTANT_STRING_ARRAY(PI_MODEL_NAMES, piModelNames, 7); EXPORT_CONSTANT_STRING_ARRAY(PI_REVISION_NAMES, piRevisionNames, 5); From 8386a2138dd98bc12ace4f73b87c6b131a78202b Mon Sep 17 00:00:00 2001 From: Peter Gallagher Date: Sun, 9 Jun 2019 16:46:23 +0100 Subject: [PATCH 17/35] Remove PI_MODEL_UNKNOWN --- src/wiringPi.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wiringPi.cc b/src/wiringPi.cc index 91d86a4..ac600da 100644 --- a/src/wiringPi.cc +++ b/src/wiringPi.cc @@ -741,7 +741,7 @@ IMPLEMENT_EXPORT_INIT(wiringPi) { EXPORT_CONSTANT_INT(PWM_MODE_MS); // piBoardId - EXPORT_CONSTANT_INT(PI_MODEL_UNKNOWN); + //EXPORT_CONSTANT_INT(PI_MODEL_UNKNOWN); EXPORT_CONSTANT_INT(PI_MODEL_A); EXPORT_CONSTANT_INT(PI_MODEL_B); EXPORT_CONSTANT_INT(PI_MODEL_BP); From 7fec3137d9521c40a7fc95a4fced46a4082bb236 Mon Sep 17 00:00:00 2001 From: Peter Gallagher Date: Sun, 9 Jun 2019 16:49:08 +0100 Subject: [PATCH 18/35] Remove wiringPiISRCancel --- src/wiringPiISR.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/wiringPiISR.cc b/src/wiringPiISR.cc index 70fbede..4510283 100644 --- a/src/wiringPiISR.cc +++ b/src/wiringPiISR.cc @@ -170,6 +170,7 @@ IMPLEMENT(wiringPiISR) { SCOPE_CLOSE(UNDEFINED()); } + /* DECLARE(wiringPiISRCancel); IMPLEMENT(wiringPiISRCancel) { SCOPE_OPEN(); @@ -187,6 +188,7 @@ IMPLEMENT(wiringPiISRCancel) { SCOPE_CLOSE(UNDEFINED()); } +*/ IMPLEMENT_EXPORT_INIT(wiringPiISR) { REGISTER_NATIVE_INTERRUPT_HANDLER(0); @@ -255,7 +257,7 @@ IMPLEMENT_EXPORT_INIT(wiringPiISR) { REGISTER_NATIVE_INTERRUPT_HANDLER(63); EXPORT_FUNCTION(wiringPiISR); - EXPORT_FUNCTION(wiringPiISRCancel); + //EXPORT_FUNCTION(wiringPiISRCancel); EXPORT_CONSTANT_INT(INT_EDGE_FALLING); EXPORT_CONSTANT_INT(INT_EDGE_RISING); From 61208fe963ea2ba049cc8a147899cff687d2b0bb Mon Sep 17 00:00:00 2001 From: Peter Gallagher Date: Sun, 9 Jun 2019 16:57:52 +0100 Subject: [PATCH 19/35] Remove File --- src/devlib/tcs34725.cc | 259 ----------------------------------------- 1 file changed, 259 deletions(-) delete mode 100644 src/devlib/tcs34725.cc diff --git a/src/devlib/tcs34725.cc b/src/devlib/tcs34725.cc deleted file mode 100644 index b07b27a..0000000 --- a/src/devlib/tcs34725.cc +++ /dev/null @@ -1,259 +0,0 @@ -#include -#include "tcs34725.h" - -DECLARE(tcs34725ReadRGBC); -DECLARE(tcs34725ReadHSV); -DECLARE(tcs34725GetCorrelatedColorTemperature); -DECLARE(tcs34725GetIlluminance); -DECLARE(tcs34725SetInterrupt); -DECLARE(tcs34725ClearInterrupt); -DECLARE(tcs34725SetInterruptLimits); -DECLARE(tcs34725Enable); -DECLARE(tcs34725Disable); -DECLARE(tcs34725Setup); - -IMPLEMENT(tcs34725ReadRGBC) { - SCOPE_OPEN(); - - SET_ARGUMENT_NAME(0, id); - - CHECK_ARGUMENTS_LENGTH_EQUAL(1); - - CHECK_ARGUMENT_TYPE_INT32(0); - - int id = GET_ARGUMENT_AS_INT32(0); - unsigned char r, g, b, c; - - ::tcs34725ReadRGBC(id, &r, &g, &b, &c); - - #if NODE_VERSION_AT_LEAST(0, 11, 0) - Local obj = Object::New(isolate); - obj->Set(String::NewFromUtf8(isolate, "r", v8::String::kInternalizedString), UINT32(r)); - obj->Set(String::NewFromUtf8(isolate, "g", v8::String::kInternalizedString), UINT32(g)); - obj->Set(String::NewFromUtf8(isolate, "b", v8::String::kInternalizedString), UINT32(b)); - obj->Set(String::NewFromUtf8(isolate, "c", v8::String::kInternalizedString), UINT32(c)); - #else - Local obj = Object::New(); - obj->Set(String::NewSymbol("r"), UINT32(r)); - obj->Set(String::NewSymbol("g"), UINT32(g)); - obj->Set(String::NewSymbol("b"), UINT32(b)); - obj->Set(String::NewSymbol("c"), UINT32(c)); - #endif - - SCOPE_CLOSE(obj); -} - -IMPLEMENT(tcs34725ReadHSV) { - SCOPE_OPEN(); - - SET_ARGUMENT_NAME(0, id); - - CHECK_ARGUMENTS_LENGTH_EQUAL(1); - - CHECK_ARGUMENT_TYPE_INT32(0); - - int id = GET_ARGUMENT_AS_INT32(0); - unsigned short h; - unsigned char s, v; - - ::tcs34725ReadHSV(id, &h, &s, &v); - - #if NODE_VERSION_AT_LEAST(0, 11, 0) - Local obj = Object::New(isolate); - obj->Set(String::NewFromUtf8(isolate, "h", v8::String::kInternalizedString), UINT32(h)); - obj->Set(String::NewFromUtf8(isolate, "s", v8::String::kInternalizedString), UINT32(s)); - obj->Set(String::NewFromUtf8(isolate, "v", v8::String::kInternalizedString), UINT32(v)); - #else - Local obj = Object::New(); - obj->Set(String::NewSymbol("h"), UINT32(h)); - obj->Set(String::NewSymbol("s"), UINT32(s)); - obj->Set(String::NewSymbol("v"), UINT32(v)); - #endif - - SCOPE_CLOSE(obj); -} - -IMPLEMENT(tcs34725GetCorrelatedColorTemperature) { - SCOPE_OPEN(); - - SET_ARGUMENT_NAME(0, r); - SET_ARGUMENT_NAME(1, g); - SET_ARGUMENT_NAME(2, b); - - CHECK_ARGUMENTS_LENGTH_EQUAL(3); - - CHECK_ARGUMENT_TYPE_UINT32(0); - CHECK_ARGUMENT_TYPE_UINT32(1); - CHECK_ARGUMENT_TYPE_UINT32(2); - - unsigned short r = GET_ARGUMENT_AS_UINT32(0); - unsigned short g = GET_ARGUMENT_AS_UINT32(1); - unsigned short b = GET_ARGUMENT_AS_UINT32(2); - - unsigned short k = ::tcs34725GetCorrelatedColorTemperature(r, g, b); - - SCOPE_CLOSE(UINT32(k)); -} - -IMPLEMENT(tcs34725GetIlluminance) { - SCOPE_OPEN(); - - SET_ARGUMENT_NAME(0, r); - SET_ARGUMENT_NAME(1, g); - SET_ARGUMENT_NAME(2, b); - - CHECK_ARGUMENTS_LENGTH_EQUAL(3); - - CHECK_ARGUMENT_TYPE_UINT32(0); - CHECK_ARGUMENT_TYPE_UINT32(1); - CHECK_ARGUMENT_TYPE_UINT32(2); - - unsigned short r = GET_ARGUMENT_AS_UINT32(0); - unsigned short g = GET_ARGUMENT_AS_UINT32(1); - unsigned short b = GET_ARGUMENT_AS_UINT32(2); - - unsigned short i = ::tcs34725GetIlluminance(r, g, b); - - SCOPE_CLOSE(UINT32(i)); -} - -IMPLEMENT(tcs34725SetInterrupt) { - SCOPE_OPEN(); - - SET_ARGUMENT_NAME(0, id); - SET_ARGUMENT_NAME(1, aien); - - CHECK_ARGUMENTS_LENGTH_EQUAL(2); - - CHECK_ARGUMENT_TYPE_INT32(0); - CHECK_ARGUMENT_TYPE_INT32(1); - - int id = GET_ARGUMENT_AS_INT32(0); - int aien = GET_ARGUMENT_AS_INT32(1); - - ::tcs34725SetInterrupt(id, aien); - - SCOPE_CLOSE(UNDEFINED()); -} - -IMPLEMENT(tcs34725ClearInterrupt) { - SCOPE_OPEN(); - - SET_ARGUMENT_NAME(0, id); - - CHECK_ARGUMENTS_LENGTH_EQUAL(1); - - CHECK_ARGUMENT_TYPE_INT32(0); - - int id = GET_ARGUMENT_AS_INT32(0); - - ::tcs34725ClearInterrupt(id); - - SCOPE_CLOSE(UNDEFINED()); -} - -IMPLEMENT(tcs34725SetInterruptLimits) { - SCOPE_OPEN(); - - SET_ARGUMENT_NAME(0, id); - SET_ARGUMENT_NAME(1, low); - SET_ARGUMENT_NAME(2, high); - - CHECK_ARGUMENTS_LENGTH_EQUAL(3); - - CHECK_ARGUMENT_TYPE_INT32(0); - CHECK_ARGUMENT_TYPE_UINT32(1); - CHECK_ARGUMENT_TYPE_UINT32(2); - - int id = GET_ARGUMENT_AS_INT32(0); - int low = GET_ARGUMENT_AS_UINT32(1) & 0xFFFF; - int high = GET_ARGUMENT_AS_UINT32(2) & 0xFFFF; - - ::tcs34725SetInterruptLimits(id, low, high); - - SCOPE_CLOSE(UNDEFINED()); -} - -IMPLEMENT(tcs34725Enable) { - SCOPE_OPEN(); - - SET_ARGUMENT_NAME(0, id); - - CHECK_ARGUMENTS_LENGTH_EQUAL(1); - - CHECK_ARGUMENT_TYPE_INT32(0); - - int id = GET_ARGUMENT_AS_INT32(0); - - ::tcs34725Enable(id); - - SCOPE_CLOSE(UNDEFINED()); -} - -IMPLEMENT(tcs34725Disable) { - SCOPE_OPEN(); - - SET_ARGUMENT_NAME(0, id); - - CHECK_ARGUMENTS_LENGTH_EQUAL(1); - - CHECK_ARGUMENT_TYPE_INT32(0); - - int id = GET_ARGUMENT_AS_INT32(0); - - ::tcs34725Disable(id); - - SCOPE_CLOSE(UNDEFINED()); -} - -IMPLEMENT(tcs34725Setup) { - SCOPE_OPEN(); - - SET_ARGUMENT_NAME(0, i2cAddress); - SET_ARGUMENT_NAME(1, integrationTime); - SET_ARGUMENT_NAME(2, gain); - - CHECK_ARGUMENTS_LENGTH_EQUAL(3); - - CHECK_ARGUMENT_TYPE_INT32(0); - CHECK_ARGUMENT_TYPE_INT32(1); - CHECK_ARGUMENT_TYPE_INT32(2); - - int i2cAddress = GET_ARGUMENT_AS_INT32(0); - int integrationTime = GET_ARGUMENT_AS_INT32(1); - int gain = GET_ARGUMENT_AS_INT32(2); - - CHECK_ARGUMENT_IN_INTS(1, integrationTime, (TCS34725_ATIME_2_4MS, TCS34725_ATIME_24MS, TCS34725_ATIME_50MS, TCS34725_ATIME_101MS, TCS34725_ATIME_154MS, TCS34725_ATIME_700MS)); - CHECK_ARGUMENT_IN_INTS(2, gain, (TCS34725_GAIN_1, TCS34725_GAIN_4, TCS34725_GAIN_16, TCS34725_GAIN_60)); - - int id = ::tcs34725Setup(i2cAddress, integrationTime, gain); - - SCOPE_CLOSE(INT32(id)); -} - -IMPLEMENT_EXPORT_INIT(tcs34725) { - EXPORT_FUNCTION(tcs34725ReadRGBC); - EXPORT_FUNCTION(tcs34725ReadHSV); - EXPORT_FUNCTION(tcs34725GetCorrelatedColorTemperature); - EXPORT_FUNCTION(tcs34725GetIlluminance); - EXPORT_FUNCTION(tcs34725SetInterrupt); - EXPORT_FUNCTION(tcs34725ClearInterrupt); - EXPORT_FUNCTION(tcs34725SetInterruptLimits); - EXPORT_FUNCTION(tcs34725Enable); - EXPORT_FUNCTION(tcs34725Disable); - EXPORT_FUNCTION(tcs34725Setup); - - EXPORT_CONSTANT_INT(TCS34725_ATIME_2_4MS); - EXPORT_CONSTANT_INT(TCS34725_ATIME_24MS); - EXPORT_CONSTANT_INT(TCS34725_ATIME_50MS); - EXPORT_CONSTANT_INT(TCS34725_ATIME_101MS); - EXPORT_CONSTANT_INT(TCS34725_ATIME_154MS); - EXPORT_CONSTANT_INT(TCS34725_ATIME_700MS); - - EXPORT_CONSTANT_INT(TCS34725_GAIN_1); - EXPORT_CONSTANT_INT(TCS34725_GAIN_4); - EXPORT_CONSTANT_INT(TCS34725_GAIN_16); - EXPORT_CONSTANT_INT(TCS34725_GAIN_60); - - EXPORT_CONSTANT_INT(TCS34725_MAX_TCS34725); -} \ No newline at end of file From 9b86b8cabe453a27520f31cfa0cee7b0b0eb9d5d Mon Sep 17 00:00:00 2001 From: Peter Gallagher Date: Sun, 9 Jun 2019 16:59:24 +0100 Subject: [PATCH 20/35] Remove tcs34725 --- src/devlib/devlib.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/devlib/devlib.cc b/src/devlib/devlib.cc index ae4ec04..cb9c609 100644 --- a/src/devlib/devlib.cc +++ b/src/devlib/devlib.cc @@ -8,7 +8,7 @@ #include "piFace.h" #include "piGlow.h" #include "piNes.h" -#include "tcs34725.h" +//#include "tcs34725.h" IMPLEMENT_EXPORT_INIT(devlib) { INIT(ds1302); @@ -19,5 +19,5 @@ IMPLEMENT_EXPORT_INIT(devlib) { INIT(piFace); INIT(piGlow); INIT(piNes); - INIT(tcs34725); -} \ No newline at end of file + //INIT(tcs34725); +} From fb181744421de83149b82ac018cd9ba3c3e58ee8 Mon Sep 17 00:00:00 2001 From: Peter Gallagher Date: Sun, 9 Jun 2019 17:04:46 +0100 Subject: [PATCH 21/35] remove tcs34725 --- src/devlib/tcs34725.h | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 src/devlib/tcs34725.h diff --git a/src/devlib/tcs34725.h b/src/devlib/tcs34725.h deleted file mode 100644 index 7655481..0000000 --- a/src/devlib/tcs34725.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef _WPI_TCS34725_H_ -#define _WPI_TCS34725_H_ - - #include "../addon.h" - - DECLARE_EXPORT_INIT(tcs34725); - -#endif \ No newline at end of file From 44946469dc8fae1012682ecd5a701aa054e0a187 Mon Sep 17 00:00:00 2001 From: Peter Gallagher Date: Sun, 9 Jun 2019 17:10:01 +0100 Subject: [PATCH 22/35] Remove tcs34725 --- binding.gyp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/binding.gyp b/binding.gyp index 682c95e..d0c8904 100644 --- a/binding.gyp +++ b/binding.gyp @@ -44,8 +44,7 @@ 'src/devlib/maxdetect.cc', 'src/devlib/piFace.cc', 'src/devlib/piGlow.cc', - 'src/devlib/piNes.cc', - 'src/devlib/tcs34725.cc' + 'src/devlib/piNes.cc' ], 'include_dirs': [ 'wiringpi/wiringPi', From 8fa138547f3bf44616aca71c0634dff3e8c9d6e0 Mon Sep 17 00:00:00 2001 From: Peter Gallagher Date: Sun, 9 Jun 2019 22:55:09 +0100 Subject: [PATCH 23/35] Create wiringPi_Makefile Patch --- patchs/wiringpi_Makefile.patch | 35 ++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 patchs/wiringpi_Makefile.patch diff --git a/patchs/wiringpi_Makefile.patch b/patchs/wiringpi_Makefile.patch new file mode 100644 index 0000000..e97f9c8 --- /dev/null +++ b/patchs/wiringpi_Makefile.patch @@ -0,0 +1,35 @@ +--- Makefile 2019-06-09 16:11:11.208024572 +0000 ++++ Makefile_new 2019-06-09 21:53:22.894082583 +0000 +@@ -69,9 +69,13 @@ + + all: $(DYNAMIC) + +-.PHONY: static +-static: +- $Q cat noMoreStatic ++static: $(STATIC) ++ ++$(STATIC): $(OBJ) ++ $Q echo "[Link (Static)]" ++ $Q ar rcs $(STATIC) $(OBJ) ++ $Q ranlib $(STATIC) ++# @size $(STATIC) + + $(DYNAMIC): $(OBJ) + $Q echo "[Link (Dynamic)]" +@@ -104,6 +108,15 @@ + $Q ln -sf $(DESTDIR)$(PREFIX)/lib/libwiringPi.so.$(VERSION) $(DESTDIR)/lib/libwiringPi.so + $Q $(LDCONFIG) + ++.PHONY: install-static ++install-static: $(STATIC) ++ $Q echo "[Install Headers]" ++ $Q install -m 0755 -d $(DESTDIR)$(PREFIX)/include ++ $Q install -m 0644 $(HEADERS) $(DESTDIR)$(PREFIX)/include ++ $Q echo "[Install Static Lib]" ++ $Q install -m 0755 -d $(DESTDIR)$(PREFIX)/lib ++ $Q install -m 0755 libwiringPi.a $(DESTDIR)$(PREFIX)/lib ++ + .PHONY: install-deb + install-deb: $(DYNAMIC) + $Q echo "[Install Headers: deb]" From 27db01075455e9b811a7b4f5a370c842c5e93249 Mon Sep 17 00:00:00 2001 From: Peter Gallagher Date: Sun, 9 Jun 2019 22:56:35 +0100 Subject: [PATCH 24/35] Add wiringPi MakeFile Patch --- install.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/install.sh b/install.sh index 298bf88..c5b19d8 100644 --- a/install.sh +++ b/install.sh @@ -50,6 +50,7 @@ echo "done." patch ./WiringPi/devLib/Makefile < ./patchs/devLib_Makefile.patch patch ./WiringPi/gpio/Makefile < ./patchs/gpio_Makefile.patch +patch ./WiringPi/wiringPi/Makefile < ./patchs/wiringpi_Makefile.patch echo -n "Making libWiringPi ... " cd ./WiringPi/wiringPi/ From 745ad4b80af09a68b777d6020bee53010fc43fd5 Mon Sep 17 00:00:00 2001 From: Peter Gallagher Date: Sun, 9 Jun 2019 23:44:54 +0100 Subject: [PATCH 25/35] Fix WiringPi Path --- binding.gyp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/binding.gyp b/binding.gyp index d0c8904..6a5cb89 100644 --- a/binding.gyp +++ b/binding.gyp @@ -51,8 +51,8 @@ 'wiringpi/devLib' ], 'libraries': [ - ' Date: Sun, 9 Jun 2019 23:50:29 +0100 Subject: [PATCH 26/35] Fix Wiring Pi Include Casing --- binding.gyp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/binding.gyp b/binding.gyp index 6a5cb89..51c55ab 100644 --- a/binding.gyp +++ b/binding.gyp @@ -47,8 +47,8 @@ 'src/devlib/piNes.cc' ], 'include_dirs': [ - 'wiringpi/wiringPi', - 'wiringpi/devLib' + 'WiringPi/wiringPi', + 'WiringPi/devLib' ], 'libraries': [ ' Date: Mon, 10 Jun 2019 00:15:26 +0100 Subject: [PATCH 27/35] Set version to match WiringPi Version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3a97271..23bbc68 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wiring-pi", - "version": "2.5.0", + "version": "2.46.0", "description": "Bindings to wiringPi", "main": "lib/exports.js", "scripts": { From 01f08d4a8b20dde0a4c3cead6bdf639f371f2b7a Mon Sep 17 00:00:00 2001 From: Peter Gallagher Date: Mon, 10 Jun 2019 00:18:00 +0100 Subject: [PATCH 28/35] Swap github repo back to WiringPi --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 23bbc68..eaa87fb 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ }, "repository": { "type": "git", - "url": "git@github.com:pjgpetecodes/WiringPi-Node.git" + "url": "git@github.com:WiringPi/WiringPi-Node.git" }, "keywords": [ "wiringPi", From f3a6776cf318a8213ba527292f8942b833d62c36 Mon Sep 17 00:00:00 2001 From: Peter Gallagher Date: Wed, 12 Jun 2019 21:39:44 +0100 Subject: [PATCH 29/35] Set Github address back to mine. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index eaa87fb..23bbc68 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ }, "repository": { "type": "git", - "url": "git@github.com:WiringPi/WiringPi-Node.git" + "url": "git@github.com:pjgpetecodes/WiringPi-Node.git" }, "keywords": [ "wiringPi", From de02fc2a2195ab33295917c1aaa61668acb3c162 Mon Sep 17 00:00:00 2001 From: pjgpetecodes Date: Sun, 6 Oct 2019 23:28:20 +0100 Subject: [PATCH 30/35] Updated to publish new NPM module --- README.md | 7 ++++++- package.json | 12 +++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 494d423..8f68438 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,10 @@ Node.js bindings to [wiringPi](http://www.wiringpi.com) Based on the awesome work of [Soarez](https://github.com/Soarez/node-wiring-pi) +This version fixes the BCM identification issue present in the original Wiring-Pi node Module. + +The original version relied on a very old version of Wiring-Pi. + ## Install ``` @@ -11,7 +15,7 @@ npm install wiring-pi ## Usage ```javascript -var wpi = require('wiring-pi'); +var wpi = require('wiring-pi-2019'); ``` ## Documentation @@ -39,3 +43,4 @@ Chris Continanza | [csquared](https://github.com/csquared) | [@csquared](https:/ Tao Yuan | [taoyuan](https://github.com/taoyuan) | [@taoyvan](https://twitter.com/taoyvan) Tom Janson | [tjanson](https://github.com/tjanson) | Vincent Terraillon | [LouTerrailloune](https://github.com/LouTerrailloune) | [@pure74vincent](https://twitter.com/pure74vincent) +Pete Gallagher | [pjgpetecodes](https://github.com/pjgpetecodes) | [@pete_codes](https://twitter.com/pete_codes) diff --git a/package.json b/package.json index 23bbc68..e479d46 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { - "name": "wiring-pi", - "version": "2.46.0", - "description": "Bindings to wiringPi", + "name": "wiring-pi-2019", + "version": "1.0.0", + "description": "Bindings to latest wiringPi (Solves BCM Issue)", "main": "lib/exports.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", @@ -19,10 +19,12 @@ "raspberrypi", "bcm2835" ], - "author": "Igor Soarez ", + "author": "Pete Gallagher ", "contributors": [ "Leandre Gohy ", - "Eugene Ware " + "Eugene Ware ", + "Igor Soarez ", + "Pete Gallagher " ], "license": "BSD" } From 048766a366d6fcfea32d221c6b967fb33d5f7c48 Mon Sep 17 00:00:00 2001 From: pjgpetecodes Date: Mon, 7 Oct 2019 08:07:42 +0100 Subject: [PATCH 31/35] Added note about note contacting Gordon Henderson for Support --- README.md | 16 ++++++++++++++-- package.json | 2 +- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8f68438..1552274 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -Node.js bindings to [wiringPi](http://www.wiringpi.com) +Node.js bindings to [wiringPi](http://www.wiringpi.com) (See note below!) Based on the awesome work of [Soarez](https://github.com/Soarez/node-wiring-pi) @@ -6,10 +6,22 @@ This version fixes the BCM identification issue present in the original Wiring-P The original version relied on a very old version of Wiring-Pi. +**************************************************** + +Please note: + +This statically linked version of Wiring Pi is not supported in anyway by Gordon Henderson. + +Do not email Gordon with any issues you find with this Package as it is not his responsibility. + +Thanks! + +***************************************************** + ## Install ``` -npm install wiring-pi +npm install wiring-pi-2019 ``` ## Usage diff --git a/package.json b/package.json index e479d46..d284c21 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wiring-pi-2019", - "version": "1.0.0", + "version": "1.0.1", "description": "Bindings to latest wiringPi (Solves BCM Issue)", "main": "lib/exports.js", "scripts": { From 506a0fdc302426bdbbfc29f6d625042db75249cf Mon Sep 17 00:00:00 2001 From: pjgpetecodes Date: Mon, 7 Oct 2019 08:48:31 +0100 Subject: [PATCH 32/35] Change to LF from CRLF --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d284c21..dbaca62 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wiring-pi-2019", - "version": "1.0.1", + "version": "1.0.2", "description": "Bindings to latest wiringPi (Solves BCM Issue)", "main": "lib/exports.js", "scripts": { From 0a34083b824f21e24363e197c2465344f2eccde8 Mon Sep 17 00:00:00 2001 From: pjgpetecodes Date: Mon, 7 Oct 2019 09:14:25 +0100 Subject: [PATCH 33/35] Add note that only supports node V6 --- README.md | 2 ++ package.json | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1552274..e13e3df 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,8 @@ This version fixes the BCM identification issue present in the original Wiring-P The original version relied on a very old version of Wiring-Pi. +Note: This version currently only supports Node V6... What this space for a version which supports later versions + **************************************************** Please note: diff --git a/package.json b/package.json index dbaca62..66b2f34 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "wiring-pi-2019", - "version": "1.0.2", - "description": "Bindings to latest wiringPi (Solves BCM Issue)", + "version": "1.0.3", + "description": "Bindings to latest wiringPi (Solves BCM Issue) (Node v6 only)", "main": "lib/exports.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", From 22b9c0314de3bb89f5f36cc9afbcb1e5daa07ab0 Mon Sep 17 00:00:00 2001 From: pjgpetecodes Date: Mon, 7 Oct 2019 12:28:24 +0100 Subject: [PATCH 34/35] Change add.h ForceSet to DefineOwnProperty --- src/addon.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/addon.h b/src/addon.h index 091973e..54c5679 100644 --- a/src/addon.h +++ b/src/addon.h @@ -42,11 +42,11 @@ v8::FunctionTemplate::New(isolate, nodemodule::name)->GetFunction()) #define EXPORT_CONSTANT_INT(name) \ - target->ForceSet(v8::String::NewFromUtf8(isolate, #name, v8::String::kInternalizedString), \ + target->DefineOwnProperty(target->CreationContext(), v8::String::NewFromUtf8(isolate, #name, v8::String::kInternalizedString), \ v8::Int32::New(isolate, name), static_cast(v8::ReadOnly | v8::DontDelete)); #define EXPORT_CONSTANT_STRING(name) \ - target->ForceSet(v8::String::NewFrontUtf8(isolate, #name, v8::String::kInternalizedString), \ + target->DefineOwnProperty(target->CreationContext(), v8::String::NewFromUtf8(isolate, #name, v8::String::kInternalizedString), \ v8::String::NewFromUtf8(isolate, name), static_cast(v8::ReadOnly | v8::DontDelete)); #define EXPORT_CONSTANT_INT_ARRAY(name, array, length) \ @@ -55,7 +55,7 @@ for (int i = 0; i < length; i++) { \ arr->Set(i, v8::Int32::New(isolate, array[i])); \ } \ - target->ForceSet(v8::String::NewFromUtf8(isolate, #name, v8::String::kInternalizedString), \ + target->DefineOwnProperty(target->CreationContext(), v8::String::NewFromUtf8(isolate, #name, v8::String::kInternalizedString), \ arr, static_cast(v8::ReadOnly | v8::DontDelete)); \ } @@ -65,7 +65,7 @@ for (int i = 0; i < length; i++) { \ arr->Set(i, v8::String::NewFromUtf8(isolate, array[i])); \ } \ - target->ForceSet(v8::String::NewFromUtf8(isolate, #name, v8::String::kInternalizedString), \ + target->DefineOwnProperty(target->CreationContext(), v8::String::NewFromUtf8(isolate, #name, v8::String::kInternalizedString), \ arr, static_cast(v8::ReadOnly | v8::DontDelete)); \ } From a6cabb5cb03986780db7e691d0f34f8398e5ad96 Mon Sep 17 00:00:00 2001 From: pjgpetecodes Date: Mon, 7 Oct 2019 12:28:48 +0100 Subject: [PATCH 35/35] Update Version Number --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 66b2f34..a818e8d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wiring-pi-2019", - "version": "1.0.3", + "version": "1.0.4", "description": "Bindings to latest wiringPi (Solves BCM Issue) (Node v6 only)", "main": "lib/exports.js", "scripts": {