source/libs/firefly_blecast/src/firefly_blecast.c
// Reverse the bits in a byte (BLE bytes are backward)
Reverse the bits in a byte (BLE bytes are backward)
Reverse the bits in a byte ( BLE bytes are backward )
static uint8_t reverse(uint8_t v) {
    uint8_t result = 0;
    if (v & (1 << 0)) { result |= (1 << 7); }
    if (v & (1 << 1)) { result |= (1 << 6); }
    if (v & (1 << 2)) { result |= (1 << 5); }
    if (v & (1 << 3)) { result |= (1 << 4); }
    if (v & (1 << 4)) { result |= (1 << 3); }
    if (v & (1 << 5)) { result |= (1 << 2); }
    if (v & (1 << 6)) { result |= (1 << 1); }
    if (v & (1 << 7)) { result |= (1 << 0); }
    return result;
}
static uint8_t reverse ( uint8_t v ) { uint8_t result = 0 ; if ( v & ( 1 << 0 ) ) { result |= ( 1 << 7 ) ; } if ( v & ( 1 << 1 ) ) { result |= ( 1 << 6 ) ; } if ( v & ( 1 << 2 ) ) { result |= ( 1 << 5 ) ; } if ( v & ( 1 << 3 ) ) { result |= ( 1 << 4 ) ; } if ( v & ( 1 << 4 ) ) { result |= ( 1 << 3 ) ; } if ( v & ( 1 << 5 ) ) { result |= ( 1 << 2 ) ; } if ( v & ( 1 << 6 ) ) { result |= ( 1 << 1 ) ; } if ( v & ( 1 << 7 ) ) { result |= ( 1 << 0 ) ; } return result ; }
Reverse the bits in a byte (BLE bytes are backward)
Reverse the bits in a byte ( BLE bytes are backward )