Skip to content

Commit

Permalink
Fix Led Config
Browse files Browse the repository at this point in the history
  • Loading branch information
Scavanger committed Apr 26, 2024
1 parent 5e66e9e commit 9642e86
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions js/msp/MSPHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -922,7 +922,7 @@ var mspHelper = (function () {

directions = [];
for (directionLetterIndex = 0; directionLetterIndex < MSP.ledDirectionLetters.length; directionLetterIndex++) {
if (bit_check(directionMask, directionLetterIndex)) {
if (BitHelper.bit_check(directionMask, directionLetterIndex)) {
directions.push(MSP.ledDirectionLetters[directionLetterIndex]);
}
}
Expand All @@ -932,7 +932,7 @@ var mspHelper = (function () {

functions = [];
for (var functionLetterIndex = 0; functionLetterIndex < MSP.ledFunctionLetters.length; functionLetterIndex++) {
if (bit_check(functionMask, functionLetterIndex)) {
if (BitHelper.bit_check(functionMask, functionLetterIndex)) {
functions.push(MSP.ledFunctionLetters[functionLetterIndex]);
}
}
Expand Down Expand Up @@ -962,7 +962,7 @@ var mspHelper = (function () {

var overlayMask = (mask >> 12) & 0x3F;
for (var overlayLetterIndex = 0; overlayLetterIndex < MSP.ledOverlayLetters.length; overlayLetterIndex++) {
if (bit_check(overlayMask, overlayLetterIndex)) {
if (BitHelper.bit_check(overlayMask, overlayLetterIndex)) {
functions.push(MSP.ledOverlayLetters[overlayLetterIndex]);
}
}
Expand All @@ -971,7 +971,7 @@ var mspHelper = (function () {

directions = [];
for (directionLetterIndex = 0; directionLetterIndex < MSP.ledDirectionLetters.length; directionLetterIndex++) {
if (bit_check(directionMask, directionLetterIndex)) {
if (BitHelper.bit_check(directionMask, directionLetterIndex)) {
directions.push(MSP.ledDirectionLetters[directionLetterIndex]);
}
}
Expand Down Expand Up @@ -1017,7 +1017,7 @@ var mspHelper = (function () {

var overlayMask = (mask >> 16) & 0xFF;
for (var overlayLetterIndex = 0; overlayLetterIndex < MSP.ledOverlayLetters.length; overlayLetterIndex++) {
if (bit_check(overlayMask, overlayLetterIndex)) {
if (BitHelper.bit_check(overlayMask, overlayLetterIndex)) {
functions.push(MSP.ledOverlayLetters[overlayLetterIndex]);
}
}
Expand All @@ -1026,7 +1026,7 @@ var mspHelper = (function () {

directions = [];
for (directionLetterIndex = 0; directionLetterIndex < MSP.ledDirectionLetters.length; directionLetterIndex++) {
if (bit_check(directionMask, directionLetterIndex)) {
if (BitHelper.bit_check(directionMask, directionLetterIndex)) {
directions.push(MSP.ledDirectionLetters[directionLetterIndex]);
}
}
Expand Down Expand Up @@ -2260,7 +2260,7 @@ var mspHelper = (function () {
buffer.push(BitHelper.lowByte(servoConfiguration.middle));
buffer.push(BitHelper.highByte(servoConfiguration.middle));

buffer.push(lowByte(servoConfiguration.rate));
buffer.push(BitHelper.lowByte(servoConfiguration.rate));

// prepare for next iteration
servoIndex++;
Expand Down Expand Up @@ -2650,7 +2650,7 @@ var mspHelper = (function () {

bitIndex = MSP.ledOverlayLetters.indexOf(led.functions[overlayLetterIndex]);
if (bitIndex >= 0) {
mask |= bit_set(mask, bitIndex + 16);
mask |= BitHelper.bit_set(mask, bitIndex + 16);
}

}
Expand All @@ -2662,9 +2662,9 @@ var mspHelper = (function () {
bitIndex = MSP.ledDirectionLetters.indexOf(led.directions[directionLetterIndex]);
if (bitIndex >= 0) {
if(bitIndex < 4) {
mask |= bit_set(mask, bitIndex + 28);
mask |= BitHelper.bit_set(mask, bitIndex + 28);
} else {
extra |= bit_set(extra, bitIndex - 4);
extra |= BitHelper.bit_set(extra, bitIndex - 4);
}
}
}
Expand Down

0 comments on commit 9642e86

Please sign in to comment.