From 595511979b36dd68810a3c52bb8f9907b0c7ae0e Mon Sep 17 00:00:00 2001 From: pascallanger Date: Mon, 27 Nov 2023 20:07:12 +0100 Subject: [PATCH] Update Losi_cyrf6936.ino --- Multiprotocol/Losi_cyrf6936.ino | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Multiprotocol/Losi_cyrf6936.ino b/Multiprotocol/Losi_cyrf6936.ino index 4930d3a..336f008 100644 --- a/Multiprotocol/Losi_cyrf6936.ino +++ b/Multiprotocol/Losi_cyrf6936.ino @@ -33,7 +33,7 @@ const uint8_t LOSI_data_code[][16] = { static uint16_t __attribute__((unused)) LOSI_check(uint16_t val) { const uint8_t PROGMEM tab[] = { 0xF1, 0xDA, 0xB6, 0xC8 }; - uint8_t res = 0x0B, tmp; + uint8_t res = crc8, tmp; uint16_t calc = val>>2; // don't care about the 2 first bits for(uint8_t i=0; i<5; i++) { @@ -64,7 +64,7 @@ static void __attribute__((unused)) LOSI_send_packet() { for(uint8_t i=0; i<3; i++) { - uint16_t val = LOSI_check(Channel_data[i]<<1); + uint16_t val = LOSI_check(LOSI_check(Channel_data[i]<<1); packet[4+i*2] = val >> 8; packet[5+i*2] = val; } @@ -132,6 +132,7 @@ void LOSI_init() rx_tx_addr[1] = 0x52; rx_tx_addr[2] = 0xAE; rx_tx_addr[3] = 0xAA; + crc8 = 0x0B; hopping_frequency[0] = 0x27; /* { 0xE1, 0xD6, 0x31, 0x26, 0x5F, 0xBD, 0x40, 0x93, 0xDC, 0x68, 0x08, 0x99, 0x97, 0xAE, 0xAF, 0x8C }, { 0xDC, 0x68, 0x08, 0x99, 0x97, 0xAE, 0xAF, 0x8C, 0xC3, 0x0E, 0x01, 0x16, 0x0E, 0x32, 0x06, 0xBA }, @@ -146,6 +147,7 @@ void LOSI_init() rx_tx_addr[1] = 0x52; rx_tx_addr[2] = 0x22; rx_tx_addr[3] = 0x8A; + crc8 = 0x0F; /* DATA Code RF freq % 5 { 0xF1, 0x94, 0x30, 0x21, 0xA1, 0x1C, 0x88, 0xA9, 0xD0, 0xD2, 0x8E, 0xBC, 0x82, 0x2F, 0xE3, 0xB4 }, { 0x17, 0xFF, 0x9E, 0x21, 0x36, 0x90, 0xC7, 0x82, 0xBC, 0x5D, 0x9A, 0x5B, 0xEE, 0x7F, 0x42, 0xEB }, @@ -156,6 +158,7 @@ void LOSI_init() #endif CYRF_ConfigRFChannel(hopping_frequency[0]); + bind_counter = IS_BIND_IN_PROGRESS?300:1; packet_period = 8763; }