Skip to content

Commit 573145f

Browse files
committed
Merge pull request #20 from nekuz0r/incoming-node-v0.12.x
v2.1.0
2 parents ca844c3 + e775bfa commit 573145f

21 files changed

+666
-354
lines changed

CHANGELOG.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,21 @@
11
# CHANGELOG
22

3-
## v2.1.0 *[not released yes]*
4-
* **Update:** libWiringPi to [custom][nekuz0r-libWiringPi] v2.21 `nekuz0r`
3+
## v2.1.0 *[not released yet]*
4+
* **Update:** libWiringPi to [custom][nekuz0r-libWiringPi] v2.25 `nekuz0r`
5+
* **Update:** wiringPiISR now keeps event loop running `nekuz0r`
6+
* **Update:** piModelNames string array `nekuz0r`
7+
* **Update:** piMakerNames string array `nekuz0r`
8+
* **Update:** install.sh now clone tagged version of the custom libWiringPi
9+
* **Add:** support for node 0.12.0
510
* **Add:** raspberry pi A+ support `nekuz0r`
11+
* **Add:** raspberry pi 2 support `nekuz0r`
12+
* **Add:** constant PI_MODEL_AP `nekuz0r`
13+
* **Add:** constant PI_MODEL_2 `nekuz0r`
14+
* **Add:** constant PI_MARKER_MBEST `nekuz0r`
15+
* **Add:** wiringPiISRCancel `nekuz0r`
16+
* **Add:** wiringPiSPISetupMode `nekuz0r`
17+
* **Fix:** blink.js example `louterrailloune`
18+
* **Fix:** SPI speed select argument `noddy76`
619

720
## v2.0.0 *[Jan 1 2015]*
821
* **Update:** libWiringPi to [custom][nekuz0r-libWiringPi] v2.20 `nekuz0r`

DOCUMENTATION.md

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -136,13 +136,23 @@ This is an un-documented special to let you set any pin to any mode.
136136

137137
`mode` can be one of the following values:
138138

139-
* `WPI_MODE_PINS`
140-
<span class="api-info-list"><code> >= 1.0.0 </code></span>
141-
* `WPI_MODE_PHYS`
142-
<span class="api-info-list"><code> >= 1.0.0 </code></span>
143-
* `WPI_MODE_GPIO`
144-
<span class="api-info-list"><code> >= 1.0.0 </code></span>
145-
139+
* `FSEL_INPT`
140+
<span class="api-info-list"><code> >= 2.1.0 </code></span>
141+
* `FSEL_OUTP`
142+
<span class="api-info-list"><code> >= 2.1.0 </code></span>
143+
* `FSEL_ALT0`
144+
<span class="api-info-list"><code> >= 2.1.0 </code></span>
145+
* `FSEL_ALT1`
146+
<span class="api-info-list"><code> >= 2.1.0 </code></span>
147+
* `FSEL_ALT2`
148+
<span class="api-info-list"><code> >= 2.1.0 </code></span>
149+
* `FSEL_ALT3`
150+
<span class="api-info-list"><code> >= 2.1.0 </code></span>
151+
* `FSEL_ALT4`
152+
<span class="api-info-list"><code> >= 2.1.0 </code></span>
153+
* `FSEL_ALT5`
154+
<span class="api-info-list"><code> >= 2.1.0 </code></span>
155+
146156
### pinMode(pin, mode)
147157
<span class="api-info"><code> >= 0.1.0 </code></span>
148158

@@ -176,7 +186,7 @@ If you need to change the pin mode, the you can do it with the gpio program in a
176186
<span class="api-info-list"><code> >= 1.1.0 </code></span>
177187
* `SOFT_TONE_OUTPUT`
178188
<span class="api-info-list"><code> >= 1.1.0 </code></span>
179-
189+
180190
### pullUpDnControl(pin, pud)
181191
<span class="api-info"><code> >= 0.2.0 </code></span>
182192

@@ -194,7 +204,7 @@ The internal pull up/down resistors have a value of approximately 50KΩ on the R
194204
<span class="api-info-list"><code> >= 0.2.0 </code></span>
195205
* `PUD_UP` *pull to 3.3v*
196206
<span class="api-info-list"><code> >= 0.2.0 </code></span>
197-
207+
198208
### digitalRead(pin)
199209
<span class="api-info"><code> >= 0.1.1 </code></span>
200210

@@ -258,7 +268,7 @@ Gives up and returns 0 if no pulse starts within a specified time out.
258268
<span class="api-info-list"><code> >= 0.1.2 </code></span>
259269
* `LOW`
260270
<span class="api-info-list"><code> >= 0.1.2 </code></span>
261-
271+
262272
### delay(milliseconds)
263273
<span class="api-info"><code> >= 1.1.0 </code></span>
264274

@@ -318,6 +328,8 @@ wpi.wiringPiISR(7, wpi.INT_EDGE_FALLING, function(delta) {
318328
console.log('Pin 7 changed to LOW (', delta, ')');
319329
});
320330
```
331+
### wiringPiISRCancel(pin)
332+
<span class="api-info"><code> >= 2.1.0 </code></span>
321333

322334
---
323335

@@ -355,12 +367,16 @@ Indexes of each string table have corresponding constants
355367
<span class="api-info-list"><code> >= 2.0.0 </code></span>
356368
* `PI_MODEL_A`
357369
<span class="api-info-list"><code> >= 1.1.0 </code></span>
370+
* `PI_MODEL_AP`
371+
<span class="api-info-list"><code> >= 2.1.0 </code></span>
358372
* `PI_MODEL_B`
359373
<span class="api-info-list"><code> >= 1.1.0 </code></span>
360374
* `PI_MODEL_BP`
361375
<span class="api-info-list"><code> >= 2.0.0 </code></span>
362376
* `PI_MODEL_CM`
363377
<span class="api-info-list"><code> >= 1.1.1 </code></span>
378+
* `PI_MODEL_2`
379+
<span class="api-info-list"><code> >= 2.1.0 </code></span>
364380

365381

366382
* `PI_REVISION_NAMES`
@@ -380,6 +396,8 @@ Indexes of each string table have corresponding constants
380396
<span class="api-info-list"><code> >= 2.0.0 </code></span>
381397
* `PI_MAKER_EGOMAN`
382398
<span class="api-info-list"><code> >= 2.0.0 </code></span>
399+
* `PI_MAKER_MBEST`
400+
<span class="api-info-list"><code> >= 2.1.0 </code></span>
383401
* `PI_MAKER_SONY`
384402
<span class="api-info-list"><code> >= 2.0.0 </code></span>
385403
* `PI_MAKER_QISDA`
@@ -429,7 +447,7 @@ The mark:space mode is traditional, however the default mode in the Pi is “bal
429447

430448
* `PWM_MODE_BAL` *balanced*
431449
* `PWM_MODE_MS` *mark:space*
432-
450+
433451
### pwmSetRange(range)
434452
<span class="api-info"><code> >= 0.1.1 </code></span>
435453

@@ -541,6 +559,9 @@ The returned value is the Linux file-descriptor for the device, or -1 on error.
541559

542560
If an error has happened, you may use the standard errno global variable to see why.
543561

562+
### wiringPiSPISetupMode(channel, speed, mode)
563+
<span class="apt-info"><code> >= 2.1.0 </code></span>
564+
544565
---
545566

546567
## Serial
@@ -556,7 +577,7 @@ The return value is the file descriptor or -1 for any error, in which case errno
556577

557578
**NOTE: The file descriptor (fd) returned is a standard Linux file descriptor.**
558579

559-
**You can use the standard read(), write(), etc. system calls on this file descriptor as required.**
580+
**You can use the standard read(), write(), etc. system calls on this file descriptor as required.**
560581

561582
**E.g. you may wish to write a larger block of binary data where the serialPutchar() or serialPuts() function may not be the most appropriate function to use, in which case, you can use write() to send the data.**
562583

install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ rm ./install.log 2>/dev/null 1>&2
4040

4141
echo -n "Cloning libWiringPi ... "
4242
rm -Rf ./wiringpi 2>/dev/null 1>&2
43-
git clone https://github.com/nekuz0r/wiringpi.git > ./install.log 2>&1
43+
git clone https://github.com/nekuz0r/wiringpi.git -b 2.25 > ./install.log 2>&1
4444
check_git_clone
4545
#git submodule init
4646
#check_git_clone

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "wiring-pi",
3-
"version": "2.0.0",
3+
"version": "2.1.0",
44
"description": "Bindings to wiringPi",
55
"main": "lib/exports.js",
66
"scripts": {

patchs/devLib_Makefile.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414
CC = gcc
1515
-INCLUDE = -I.
1616
+INCLUDE = -I. -I$(PWD)/../wiringPi
17+
DEFS = -D_GNU_SOURCE
1718
CFLAGS = $(DEBUG) -Wformat=2 -Wall $(INCLUDE) -Winline -pipe -fPIC
1819

19-
LIBS =

src/addon.cc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,20 @@ bool find_int(const int value, const int array[], size_t s) {
2020
return false;
2121
}
2222

23+
#if NODE_VERSION_AT_LEAST(0, 11, 0)
24+
void throw_error(v8::Isolate* isolate, const char* format, ...) {
25+
#else
2326
void throw_error(const char* format, ...) {
27+
#endif
2428
char buffer[256];
2529
va_list args;
2630
va_start(args, format);
2731
vsnprintf(buffer, 156, format, args);
2832
va_end(args);
2933

30-
v8::ThrowException(v8::Exception::Error(v8::String::New(buffer)));
34+
#if NODE_VERSION_AT_LEAST(0, 11, 0)
35+
isolate->ThrowException(v8::Exception::Error(v8::String::NewFromUtf8(isolate, buffer)));
36+
#else
37+
v8::ThrowException(v8::Exception::Error(v8::String::New(buffer)));
38+
#endif
3139
}

0 commit comments

Comments
 (0)