Skip to content

Commit

Permalink
Merge pull request #20 from nekuz0r/incoming-node-v0.12.x
Browse files Browse the repository at this point in the history
v2.1.0
  • Loading branch information
nekuz0r committed Jul 31, 2015
2 parents ca844c3 + e775bfa commit 573145f
Show file tree
Hide file tree
Showing 21 changed files with 666 additions and 354 deletions.
17 changes: 15 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
# CHANGELOG

## v2.1.0 *[not released yes]*
* **Update:** libWiringPi to [custom][nekuz0r-libWiringPi] v2.21 `nekuz0r`
## v2.1.0 *[not released yet]*
* **Update:** libWiringPi to [custom][nekuz0r-libWiringPi] v2.25 `nekuz0r`
* **Update:** wiringPiISR now keeps event loop running `nekuz0r`
* **Update:** piModelNames string array `nekuz0r`
* **Update:** piMakerNames string array `nekuz0r`
* **Update:** install.sh now clone tagged version of the custom libWiringPi
* **Add:** support for node 0.12.0
* **Add:** raspberry pi A+ support `nekuz0r`
* **Add:** raspberry pi 2 support `nekuz0r`
* **Add:** constant PI_MODEL_AP `nekuz0r`
* **Add:** constant PI_MODEL_2 `nekuz0r`
* **Add:** constant PI_MARKER_MBEST `nekuz0r`
* **Add:** wiringPiISRCancel `nekuz0r`
* **Add:** wiringPiSPISetupMode `nekuz0r`
* **Fix:** blink.js example `louterrailloune`
* **Fix:** SPI speed select argument `noddy76`

## v2.0.0 *[Jan 1 2015]*
* **Update:** libWiringPi to [custom][nekuz0r-libWiringPi] v2.20 `nekuz0r`
Expand Down
45 changes: 33 additions & 12 deletions DOCUMENTATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,23 @@ This is an un-documented special to let you set any pin to any mode.

`mode` can be one of the following values:

* `WPI_MODE_PINS`
<span class="api-info-list"><code> >= 1.0.0 </code></span>
* `WPI_MODE_PHYS`
<span class="api-info-list"><code> >= 1.0.0 </code></span>
* `WPI_MODE_GPIO`
<span class="api-info-list"><code> >= 1.0.0 </code></span>

* `FSEL_INPT`
<span class="api-info-list"><code> >= 2.1.0 </code></span>
* `FSEL_OUTP`
<span class="api-info-list"><code> >= 2.1.0 </code></span>
* `FSEL_ALT0`
<span class="api-info-list"><code> >= 2.1.0 </code></span>
* `FSEL_ALT1`
<span class="api-info-list"><code> >= 2.1.0 </code></span>
* `FSEL_ALT2`
<span class="api-info-list"><code> >= 2.1.0 </code></span>
* `FSEL_ALT3`
<span class="api-info-list"><code> >= 2.1.0 </code></span>
* `FSEL_ALT4`
<span class="api-info-list"><code> >= 2.1.0 </code></span>
* `FSEL_ALT5`
<span class="api-info-list"><code> >= 2.1.0 </code></span>

### pinMode(pin, mode)
<span class="api-info"><code> >= 0.1.0 </code></span>

Expand Down Expand Up @@ -176,7 +186,7 @@ If you need to change the pin mode, the you can do it with the gpio program in a
<span class="api-info-list"><code> >= 1.1.0 </code></span>
* `SOFT_TONE_OUTPUT`
<span class="api-info-list"><code> >= 1.1.0 </code></span>

### pullUpDnControl(pin, pud)
<span class="api-info"><code> >= 0.2.0 </code></span>

Expand All @@ -194,7 +204,7 @@ The internal pull up/down resistors have a value of approximately 50KΩ on the R
<span class="api-info-list"><code> >= 0.2.0 </code></span>
* `PUD_UP` *pull to 3.3v*
<span class="api-info-list"><code> >= 0.2.0 </code></span>

### digitalRead(pin)
<span class="api-info"><code> >= 0.1.1 </code></span>

Expand Down Expand Up @@ -258,7 +268,7 @@ Gives up and returns 0 if no pulse starts within a specified time out.
<span class="api-info-list"><code> >= 0.1.2 </code></span>
* `LOW`
<span class="api-info-list"><code> >= 0.1.2 </code></span>

### delay(milliseconds)
<span class="api-info"><code> >= 1.1.0 </code></span>

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

---

Expand Down Expand Up @@ -355,12 +367,16 @@ Indexes of each string table have corresponding constants
<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_BP`
<span class="api-info-list"><code> >= 2.0.0 </code></span>
* `PI_MODEL_CM`
<span class="api-info-list"><code> >= 1.1.1 </code></span>
* `PI_MODEL_2`
<span class="api-info-list"><code> >= 2.1.0 </code></span>


* `PI_REVISION_NAMES`
Expand All @@ -380,6 +396,8 @@ Indexes of each string table have corresponding constants
<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`
<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`
Expand Down Expand Up @@ -429,7 +447,7 @@ The mark:space mode is traditional, however the default mode in the Pi is “bal

* `PWM_MODE_BAL` *balanced*
* `PWM_MODE_MS` *mark:space*

### pwmSetRange(range)
<span class="api-info"><code> >= 0.1.1 </code></span>

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

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

### wiringPiSPISetupMode(channel, speed, mode)
<span class="apt-info"><code> >= 2.1.0 </code></span>

---

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

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

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

**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.**

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 > ./install.log 2>&1
git clone https://github.com/nekuz0r/wiringpi.git -b 2.25 > ./install.log 2>&1
check_git_clone
#git submodule init
#check_git_clone
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wiring-pi",
"version": "2.0.0",
"version": "2.1.0",
"description": "Bindings to wiringPi",
"main": "lib/exports.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion patchs/devLib_Makefile.patch
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
CC = gcc
-INCLUDE = -I.
+INCLUDE = -I. -I$(PWD)/../wiringPi
DEFS = -D_GNU_SOURCE
CFLAGS = $(DEBUG) -Wformat=2 -Wall $(INCLUDE) -Winline -pipe -fPIC

LIBS =
10 changes: 9 additions & 1 deletion src/addon.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,20 @@ bool find_int(const int value, const int array[], size_t s) {
return false;
}

#if NODE_VERSION_AT_LEAST(0, 11, 0)
void throw_error(v8::Isolate* isolate, const char* format, ...) {
#else
void throw_error(const char* format, ...) {
#endif
char buffer[256];
va_list args;
va_start(args, format);
vsnprintf(buffer, 156, format, args);
va_end(args);

v8::ThrowException(v8::Exception::Error(v8::String::New(buffer)));
#if NODE_VERSION_AT_LEAST(0, 11, 0)
isolate->ThrowException(v8::Exception::Error(v8::String::NewFromUtf8(isolate, buffer)));
#else
v8::ThrowException(v8::Exception::Error(v8::String::New(buffer)));
#endif
}
Loading

0 comments on commit 573145f

Please sign in to comment.