Skip to content

Commit

Permalink
bug fixes
Browse files Browse the repository at this point in the history
Fix: missing constant in pinModeCheck
Fix: missing constant PI_MODEL_CM
Add: serialPrintf (alias to serialPuts)
  • Loading branch information
nekuz0r committed Jul 4, 2014
1 parent 6a156eb commit 19bee7d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
1 change: 1 addition & 0 deletions lib/exports.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ exports = {
// PI Model type
PI_MODEL_A: 0,
PI_MODEL_B: 1,
PI_MODEL_CM: 2,

// PI Model names
PI_MODEL_NAMES: [
Expand Down
7 changes: 2 additions & 5 deletions src/bindings.cc
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ IMPLEMENT(pinMode) {
mode = args[1]->NumberValue();

// CHECK: Allowed values
if (mode != INPUT && mode != OUTPUT && mode != PWM_OUTPUT && mode != GPIO_CLOCK) {
if (mode != INPUT && mode != OUTPUT && mode != PWM_OUTPUT && mode != GPIO_CLOCK && mode != SOFT_PWM_OUTPUT && mode != SOFT_TONE_OUTPUT) {
ThrowException(Exception::TypeError(
String::New("Incorrect mode value. INPUT, OUTPUT, PWM_OUTPUT or GPIO_CLOCK expected.")));
return scope.Close(Undefined());
Expand Down Expand Up @@ -2243,10 +2243,7 @@ IMPLEMENT(serialPuts) {
// Func : void serialPrintf(const int fd, const char* message, ...)

IMPLEMENT(serialPrintf) {
HandleScope scope;
ThrowException(Exception::TypeError(
String::New("Not implemented")));
return scope.Close(Undefined());
return serialPuts(args);
}

// Func : int serialDataAvail(const int fd)
Expand Down

0 comments on commit 19bee7d

Please sign in to comment.