Fix addressing bug in _doSign bitfield

This commit is contained in:
Patrick Fallberg
2016-01-10 13:57:49 +01:00
parent 4e70a2ca0c
commit c5a9c2e033
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -24,9 +24,9 @@
#ifdef MY_SIGNING_FEATURE
// Macros for manipulating signing requirement table
#define DO_SIGN(node) (node == 0 ? (~doSign[0]&1) : (~doSign[node>>4]&(node%16)))
#define SET_SIGN(node) (node == 0 ? (doSign[0]&=~1) : (doSign[node>>4]&=~(node%16)))
#define CLEAR_SIGN(node) (node == 0 ? (doSign[0]|=1) : (doSign[node>>4]|=(node%16)))
#define DO_SIGN(node) (~_doSign[node>>3]&(1<<(node%8)))
#define SET_SIGN(node) (_doSign[node>>3]&=~(1<<(node%8)))
#define CLEAR_SIGN(node) (_doSign[node>>3]|=(1<<(node%8)))
#endif
// Inline function and macros
+1 -1
View File
@@ -366,7 +366,7 @@ class MySensor
MyTransport& radio;
#ifdef MY_SIGNING_FEATURE
uint16_t doSign[16]; // Bitfield indicating which sensors require signed communication
uint8_t doSign[32]; // Bitfield indicating which sensors require signed communication
MyMessage msgSign; // Buffer for message to sign.
MySigning& signer;
#endif