Skip to content

Commit

Permalink
another try to fix this :(
Browse files Browse the repository at this point in the history
  • Loading branch information
usefulthink committed Apr 15, 2021
1 parent 03e49d3 commit 0f393db
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/rpi-ws281x.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ extern "C" {
}

using namespace v8;
using v8::FunctionTemplate;

#define DEFAULT_TARGET_FREQ 800000
#define DEFAULT_GPIO_PIN 18
Expand Down Expand Up @@ -224,20 +225,20 @@ void finalize(const Nan::FunctionCallbackInfo<v8::Value> &info) {
}

NAN_MODULE_INIT(InitAll) {
Set(target, New<String>("init").ToLocalChecked(),
GetFunction(New<FunctionTemplate>(init)).ToLocalChecked());
Nan::Set(target, Nan::New<String>("init").ToLocalChecked(),
GetFunction(Nan::New<FunctionTemplate>(init)).ToLocalChecked());

Set(target, New<String>("setBrightness").ToLocalChecked(),
GetFunction(New<FunctionTemplate>(setBrightness)).ToLocalChecked());
Nan::Set(target, Nan::New<String>("setBrightness").ToLocalChecked(),
GetFunction(Nan::New<FunctionTemplate>(setBrightness)).ToLocalChecked());

Set(target, New<String>("reset").ToLocalChecked(),
GetFunction(New<FunctionTemplate>(reset)).ToLocalChecked());
Nan::Set(target, Nan::New<String>("reset").ToLocalChecked(),
GetFunction(Nan::New<FunctionTemplate>(reset)).ToLocalChecked());

Set(target, New<String>("render").ToLocalChecked(),
GetFunction(New<FunctionTemplate>(render)).ToLocalChecked());
Nan::Set(target, Nan::New<String>("render").ToLocalChecked(),
GetFunction(Nan::New<FunctionTemplate>(render)).ToLocalChecked());

Set(target, New<String>("finalize").ToLocalChecked(),
GetFunction(New<FunctionTemplate>(finalize)).ToLocalChecked());
Nan::Set(target, Nan::New<String>("finalize").ToLocalChecked(),
GetFunction(Nan::New<FunctionTemplate>(finalize)).ToLocalChecked());
}

NODE_MODULE(addon, InitAll)
Expand Down

0 comments on commit 0f393db

Please sign in to comment.