Skip to content

Commit

Permalink
devlib support fix compilation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
nekuz0r committed Jul 4, 2014
1 parent d996265 commit a7f7ac4
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 19 deletions.
3 changes: 2 additions & 1 deletion binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@
'src/devlib/piNes.cc'
],
'include_dirs': [
'wiringpi/wiringPi'
'wiringpi/wiringPi',
'wiringpi/devLib'
],
'libraries': [
'<!(pwd)/wiringpi/wiringPi/libwiringPi.a',
Expand Down
3 changes: 2 additions & 1 deletion src/devlib/ds1302.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#EXPORT_FUNCTION "ds1302.h"
#include "ds1302.h"
#include <ds1302.h>

DECLARE(ds1302rtcRead);
Expand Down Expand Up @@ -41,6 +41,7 @@ IMPLEMENT(ds1302rtcWrite) {
CHECK_ARGUMENTS_LENGTH_EQUAL(2);

CHECK_ARGUMENT_TYPE_INT32(0);
CHECK_ARGUMENT_TYPE_INT32(1);

int reg = GET_ARGUMENT_AS_INT32(0);
unsigned int data = GET_ARGUMENT_AS_UINT32(1);
Expand Down
2 changes: 1 addition & 1 deletion src/devlib/gertboard.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ IMPLEMENT(gertboardAnalogSetup) {

int pinBase = GET_ARGUMENT_AS_INT32(0);

int res = ::getboardAnalogSetup(pinBase);
int res = ::gertboardAnalogSetup(pinBase);

SCOPE_CLOSE(INT32(res));
}
Expand Down
6 changes: 3 additions & 3 deletions src/devlib/lcd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,15 @@ IMPLEMENT(lcdCharDef) {
CHECK_ARGUMENT_TYPE_INT32(0);
CHECK_ARGUMENT_TYPE_INT32(1);
CHECK_ARGUMENT_TYPE_ARRAY(2);
CHECK_ARGUMENT_ARRAY_LENGTH(8);
CHECK_ARGUMENT_ARRAY_LENGTH(2, 8);

int fd = GET_ARGUMENT_AS_INT32(0);
int index = GET_ARGUMENT_AS_INT32(1);
v8::Local<v8::Array> data = v8::Local<v8::Array>::Cast(args[2]);

unsigned int ar[8];
unsigned char ar[8];
for (int i = 0; i < 8; i++) {
ar[i] = data->Get(i)->Uint32Value();
ar[i] = data->Get(i)->Uint32Value() & 0xFF;
}

::lcdCharDef(fd, index, ar);
Expand Down
16 changes: 8 additions & 8 deletions src/devlib/lcd128x64.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ IMPLEMENT(lcd128x64setOrigin) {
SCOPE_OPEN();

SET_ARGUMENT_NAME(0, x);
SET_ARGUMENT_NAME(0, y);
SET_ARGUMENT_NAME(1, y);

CHECK_ARGUMENTS_LENGTH_EQUAL(2);

Expand Down Expand Up @@ -61,8 +61,8 @@ IMPLEMENT(lcd128x64orientCoordinates) {
::lcd128x64orientCoordinates(&x, &y);

v8::Local<v8::Array> res = v8::Array::New(2);
res->Set(i, v8::Int32::New(x));
res->Set(i, v8::Int32::New(y));
res->Set(0, v8::Int32::New(x));
res->Set(1, v8::Int32::New(y));

SCOPE_CLOSE(res);
}
Expand All @@ -73,11 +73,11 @@ IMPLEMENT(lcd128x64getScreenSize) {
CHECK_ARGUMENTS_LENGTH_EQUAL(0);

int x, y;
::lcd128x64screenSize(&x, &y);
::lcd128x64getScreenSize(&x, &y);

v8::Local<v8::Array> res = v8::Array::New(2);
res->Set(i, v8::Int32::New(x));
res->Set(i, v8::Int32::New(y));
res->Set(0, v8::Int32::New(x));
res->Set(1, v8::Int32::New(y));

SCOPE_CLOSE(res);
}
Expand Down Expand Up @@ -291,11 +291,11 @@ IMPLEMENT(lcd128x64puts) {

int x = GET_ARGUMENT_AS_INT32(0);
int y = GET_ARGUMENT_AS_INT32(1);
v8::String::AsciiValue(GET_ARGUMENT_AS_STRING(2))
v8::String::AsciiValue string(GET_ARGUMENT_AS_STRING(2));
int bgColor = GET_ARGUMENT_AS_INT32(3);
int fgColor = GET_ARGUMENT_AS_INT32(4);

::lcd128x64puts(x, y, c, bgColor, fgColor);
::lcd128x64puts(x, y, *string, bgColor, fgColor);

SCOPE_CLOSE(UNDEFINED());
}
Expand Down
4 changes: 2 additions & 2 deletions src/devlib/maxdetect.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ IMPLEMENT(readRHT03) {

CHECK_ARGUMENT_TYPE_INT32(0);

int pin = GET_ARGUMENT_AS_INT32;
int pin = GET_ARGUMENT_AS_INT32(0);

int temp, int rh;
int temp, rh;
int res = ::readRHT03(pin, &temp, &rh);

v8::Local<v8::Array> ret = v8::Array::New(3);
Expand Down
6 changes: 3 additions & 3 deletions src/devlib/piGlow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ DECLARE(piGlowRing);
DECLARE(piGlowSetup);

IMPLEMENT(piGlow1) {
OPEN_SCOPE();
SCOPE_OPEN();

SET_ARGUMENT_NAME(0, leg);
SET_ARGUMENT_NAME(1, ring);
Expand All @@ -29,7 +29,7 @@ IMPLEMENT(piGlow1) {
}

IMPLEMENT(piGlowLeg) {
OPEN_SCOPE();
SCOPE_OPEN();

SET_ARGUMENT_NAME(0, leg);
SET_ARGUMENT_NAME(1, intensity);
Expand All @@ -48,7 +48,7 @@ IMPLEMENT(piGlowLeg) {
}

IMPLEMENT(piGlowRing) {
OPEN_SCOPE();
SCOPE_OPEN();

SET_ARGUMENT_NAME(0, ring);
SET_ARGUMENT_NAME(1, intensity);
Expand Down

0 comments on commit a7f7ac4

Please sign in to comment.