Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merging kohei0302/WiringPi-Node #82

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 18 additions & 12 deletions DOCUMENTATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
<span class="api-info-list"><code> >= 2.0.0 </code></span>
* `PI_MODEL_A`
<span class="api-info-list"><code> >= 1.1.0 </code></span>
* `PI_MODEL_AP`
<span class="api-info-list"><code> >= 2.1.0 </code></span>
* `PI_MODEL_B`
<span class="api-info-list"><code> >= 1.1.0 </code></span>
* `PI_MODEL_AP`
<span class="api-info-list"><code> >= 2.1.0 </code></span>
* `PI_MODEL_BP`
<span class="api-info-list"><code> >= 2.0.0 </code></span>
* `PI_MODEL_2`
<span class="api-info-list"><code> >= 2.1.0 </code></span>
* `PI_ALPHA`
<span class="api-info-list"><code> >= 2.1.0 </code></span>
* `PI_MODEL_CM`
<span class="api-info-list"><code> >= 1.1.1 </code></span>
* `PI_MODEL_2`
* `PI_MODEL_07`
<span class="api-info-list"><code> >= 2.1.0 </code></span>
* `PI_MODEL_3`
<span class="api-info-list"><code> >= 2.1.0 </code></span>
* `PI_MODEL_ZERO`
Copy link
Collaborator

@nekuz0r nekuz0r Sep 8, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since new constants are added the version should be bumped, and the documentation should reflect it accordingly.

Also since some are renamed/removed, it's a breaking change, i suggest 2.2.0 then

<span class="api-info-list"><code> >= 2.1.0 </code></span>
* `PI_MODEL_CM3`
<span class="api-info-list"><code> >= 2.1.0 </code></span>
* `PI_MODEL_ZERO_W`
<span class="api-info-list"><code> >= 2.1.0 </code></span>


* `PI_REVISION_NAMES`
* `PI_VERSION_UNKNOWN`
<span class="api-info-list"><code> >= 2.0.0 </code></span>
* `PI_VERSION_1`
<span class="api-info-list"><code> >= 2.0.0 </code></span>
* `PI_VERSION_1_1`
Expand All @@ -392,15 +400,13 @@ Indexes of each string table have corresponding constants
<span class="api-info-list"><code> >= 2.0.0 </code></span>

* `PI_MAKER_NAMES`
* `PI_MAKER_UNKNOWN`
* `PI_MAKER_SONY`
<span class="api-info-list"><code> >= 2.0.0 </code></span>
* `PI_MAKER_EGOMAN`
<span class="api-info-list"><code> >= 2.0.0 </code></span>
* `PI_MAKER_MBEST`
* `PI_MAKER_EMBEST`
<span class="api-info-list"><code> >= 2.1.0 </code></span>
* `PI_MAKER_SONY`
<span class="api-info-list"><code> >= 2.0.0 </code></span>
* `PI_MAKER_QISDA`
* `PI_MAKER_UNKNOWN`
<span class="api-info-list"><code> >= 2.0.0 </code></span>

### wpiPinToGpio(pin)
Expand Down
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 10 additions & 10 deletions patchs/devLib_Makefile.patch
Original file line number Diff line number Diff line change
@@ -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

17 changes: 10 additions & 7 deletions patchs/gpio_Makefile.patch
Original file line number Diff line number Diff line change
@@ -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
19 changes: 11 additions & 8 deletions src/wiringPi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down