How to use multiple flags for intra-thread signaling?

Yes, we can. Actually it’s a better solution because unlike defines constant expressions are check at compile time:

const uint32_t MOTOR_FLAG     = (1UL << 0);    // position 0
const uint32_t MAX_SPEED_FLAG = (1UL << 1);    // position 1
const uint32_t RELAY_ON_FLAG  = (1UL << 8);    // position 8
...
1 Like