Skip to content

Commit

Permalink
Merge pull request #124 from FeBe95/master
Browse files Browse the repository at this point in the history
Fix building by updating available method names
  • Loading branch information
usefulthink authored Aug 28, 2022
2 parents 0f393db + 795a5f7 commit 832816b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lib/ws281x-native.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ module.exports = function(numLeds, options = {}) {
gpio = 18,
invert = false,
brightness = 255,
stripType = stripType.WS2812
stripType = DEFAULT_STRIP_TYPE
} = options;

const channelOptions = {count: numLeds, gpio, invert, brightness, stripType};
Expand Down
21 changes: 12 additions & 9 deletions src/rpi-ws281x.cc
Original file line number Diff line number Diff line change
Expand Up @@ -226,21 +226,24 @@ void finalize(const Nan::FunctionCallbackInfo<v8::Value> &info) {

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

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

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

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

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

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

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

NODE_MODULE(addon, InitAll)

// vi: ts=2 sw=2 expandtab
// vi: ts=2 sw=2 expandtab

0 comments on commit 832816b

Please sign in to comment.