Use or instead of plus since the header bits can be set multiple times.
This commit is contained in:
parent
1151396912
commit
7ecc1fd19a
46
StenoFW.ino
46
StenoFW.ino
@ -262,63 +262,63 @@ void sendChordTxBolt() {
|
|||||||
|
|
||||||
// byte 1
|
// byte 1
|
||||||
// S-
|
// S-
|
||||||
if (currentChord[0][0] || currentChord[1][0]) chordBytes[0] += B00000001;
|
if (currentChord[0][0] || currentChord[1][0]) chordBytes[0] |= B00000001;
|
||||||
// T-
|
// T-
|
||||||
if (currentChord[0][1]) chordBytes[index] += B00000010;
|
if (currentChord[0][1]) chordBytes[index] |= B00000010;
|
||||||
// K-
|
// K-
|
||||||
if (currentChord[1][1]) chordBytes[index] += B00000100;
|
if (currentChord[1][1]) chordBytes[index] |= B00000100;
|
||||||
// P-
|
// P-
|
||||||
if (currentChord[0][2]) chordBytes[index] += B00001000;
|
if (currentChord[0][2]) chordBytes[index] |= B00001000;
|
||||||
// W-
|
// W-
|
||||||
if (currentChord[1][2]) chordBytes[index] += B00010000;
|
if (currentChord[1][2]) chordBytes[index] |= B00010000;
|
||||||
// H-
|
// H-
|
||||||
if (currentChord[0][3]) chordBytes[index] += B00100000;
|
if (currentChord[0][3]) chordBytes[index] |= B00100000;
|
||||||
// Increment the index if the current byte has any keys set.
|
// Increment the index if the current byte has any keys set.
|
||||||
if (chordBytes[index]) index++;
|
if (chordBytes[index]) index++;
|
||||||
|
|
||||||
// byte 2
|
// byte 2
|
||||||
// R-
|
// R-
|
||||||
if (currentChord[1][3]) chordBytes[index] += B01000001;
|
if (currentChord[1][3]) chordBytes[index] |= B01000001;
|
||||||
// A
|
// A
|
||||||
if (currentChord[2][0]) chordBytes[index] += B01000010;
|
if (currentChord[2][0]) chordBytes[index] |= B01000010;
|
||||||
// O
|
// O
|
||||||
if (currentChord[2][1]) chordBytes[index] += B01000100;
|
if (currentChord[2][1]) chordBytes[index] |= B01000100;
|
||||||
// *
|
// *
|
||||||
if (currentChord[0][4] || currentChord[1][4]) chordBytes[index] += B01001000;
|
if (currentChord[0][4] || currentChord[1][4]) chordBytes[index] |= B01001000;
|
||||||
// E
|
// E
|
||||||
if (currentChord[2][2]) chordBytes[index] += B01010000;
|
if (currentChord[2][2]) chordBytes[index] |= B01010000;
|
||||||
// U
|
// U
|
||||||
if (currentChord[2][3]) chordBytes[index] += B01100000;
|
if (currentChord[2][3]) chordBytes[index] |= B01100000;
|
||||||
// Increment the index if the current byte has any keys set.
|
// Increment the index if the current byte has any keys set.
|
||||||
if (chordBytes[index]) index++;
|
if (chordBytes[index]) index++;
|
||||||
|
|
||||||
// byte 3
|
// byte 3
|
||||||
// -F
|
// -F
|
||||||
if (currentChord[3][0]) chordBytes[index] += B10000001;
|
if (currentChord[3][0]) chordBytes[index] |= B10000001;
|
||||||
// -R
|
// -R
|
||||||
if (currentChord[4][0]) chordBytes[index] += B10000010;
|
if (currentChord[4][0]) chordBytes[index] |= B10000010;
|
||||||
// -P
|
// -P
|
||||||
if (currentChord[3][1]) chordBytes[index] += B10000100;
|
if (currentChord[3][1]) chordBytes[index] |= B10000100;
|
||||||
// -B
|
// -B
|
||||||
if (currentChord[4][1]) chordBytes[index] += B10001000;
|
if (currentChord[4][1]) chordBytes[index] |= B10001000;
|
||||||
// -L
|
// -L
|
||||||
if (currentChord[3][2]) chordBytes[index] += B10010000;
|
if (currentChord[3][2]) chordBytes[index] |= B10010000;
|
||||||
// -G
|
// -G
|
||||||
if (currentChord[4][2]) chordBytes[index] += B10100000;
|
if (currentChord[4][2]) chordBytes[index] |= B10100000;
|
||||||
// Increment the index if the current byte has any keys set.
|
// Increment the index if the current byte has any keys set.
|
||||||
if (chordBytes[index]) index++;
|
if (chordBytes[index]) index++;
|
||||||
|
|
||||||
// byte 4
|
// byte 4
|
||||||
// -T
|
// -T
|
||||||
if (currentChord[3][3]) chordBytes[index] += B11000001;
|
if (currentChord[3][3]) chordBytes[index] |= B11000001;
|
||||||
// -S
|
// -S
|
||||||
if (currentChord[4][3]) chordBytes[index] += B11000010;
|
if (currentChord[4][3]) chordBytes[index] |= B11000010;
|
||||||
// -D
|
// -D
|
||||||
if (currentChord[3][4]) chordBytes[index] += B11000100;
|
if (currentChord[3][4]) chordBytes[index] |= B11000100;
|
||||||
// -Z
|
// -Z
|
||||||
if (currentChord[4][3]) chordBytes[index] += B11001000;
|
if (currentChord[4][3]) chordBytes[index] |= B11001000;
|
||||||
// #
|
// #
|
||||||
if (currentChord[2][4]) chordBytes[index] += B11010000;
|
if (currentChord[2][4]) chordBytes[index] |= B11010000;
|
||||||
// Increment the index if the current byte has any keys set.
|
// Increment the index if the current byte has any keys set.
|
||||||
if (chordBytes[index]) index++;
|
if (chordBytes[index]) index++;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user