mirror of
https://github.com/pascallanger/DIY-Multiprotocol-TX-Module.git
synced 2025-02-04 21:08:12 +00:00
Update Losi_cyrf6936.ino
This commit is contained in:
parent
7e7b555809
commit
a682b0e604
@ -34,12 +34,12 @@ const uint8_t LOSI_data_code[][16] = {
|
|||||||
|
|
||||||
static uint16_t __attribute__((unused)) LOSI_check(uint16_t val)
|
static uint16_t __attribute__((unused)) LOSI_check(uint16_t val)
|
||||||
{
|
{
|
||||||
uint8_t tab[] = { 0xF1, 0xDA, 0xB6, 0xC8 };
|
const uint8_t PROGMEM tab[] = { 0xF1, 0xDA, 0xB6, 0xC8 };
|
||||||
uint8_t res = 0x0B, tmp;
|
uint8_t res = 0x0B, tmp;
|
||||||
uint16_t calc = val>>2; // don't care about the 2 first bits
|
uint16_t calc = val>>2; // don't care about the 2 first bits
|
||||||
for(uint8_t i=0; i<5; i++)
|
for(uint8_t i=0; i<5; i++)
|
||||||
{
|
{
|
||||||
tmp=tab[i&0x03];
|
tmp=pgm_read_byte_near(&tab[i&0x03]);
|
||||||
if(calc&0x0001)
|
if(calc&0x0001)
|
||||||
res ^= tmp>>4;
|
res ^= tmp>>4;
|
||||||
calc >>= 1;
|
calc >>= 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user