From 5fe1e9674e94763c709623eb33a975aba99b0106 Mon Sep 17 00:00:00 2001 From: Pascal Langer Date: Mon, 10 Sep 2018 09:58:31 +0200 Subject: [PATCH] DSM functions and variables renamed --- Multiprotocol/DSM_cyrf6936.ino | 34 +++++++++++++++++----------------- Multiprotocol/Multiprotocol.h | 2 +- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Multiprotocol/DSM_cyrf6936.ino b/Multiprotocol/DSM_cyrf6936.ino index 5586227..dfe0cc6 100644 --- a/Multiprotocol/DSM_cyrf6936.ino +++ b/Multiprotocol/DSM_cyrf6936.ino @@ -44,7 +44,7 @@ enum { uint8_t sop_col; uint8_t DSM_num_ch=0; uint8_t ch_map[14]; -const uint8_t PROGMEM ch_map_progmem[][14] = { +const uint8_t PROGMEM DSM_ch_map_progmem[][14] = { //22+11ms for 4..7 channels {1, 0, 2, 3, 0xff, 0xff, 0xff, 1, 0, 2, 3, 0xff, 0xff, 0xff}, //4ch - Guess {1, 0, 2, 3, 4, 0xff, 0xff, 1, 0, 2, 3, 4, 0xff, 0xff}, //5ch - Guess @@ -62,7 +62,7 @@ const uint8_t PROGMEM ch_map_progmem[][14] = { {1, 5, 2, 3, 4, 8, 9, 1, 5, 2, 3, 0, 7, 6 }, //10ch - DX18 }; -const uint8_t PROGMEM pncodes[5][8][8] = { +const uint8_t PROGMEM DSM_pncodes[5][8][8] = { /* Note these are in order transmitted (LSB 1st) */ { /* Row 0 */ /* Col 0 */ {0x03, 0xBC, 0x6E, 0x8A, 0xEF, 0xBD, 0xFE, 0xF8}, @@ -123,18 +123,18 @@ const uint8_t PROGMEM pncodes[5][8][8] = { }, }; -static void __attribute__((unused)) read_code(uint8_t *buf, uint8_t row, uint8_t col, uint8_t len) +static void __attribute__((unused)) DSM_read_code(uint8_t *buf, uint8_t row, uint8_t col, uint8_t len) { for(uint8_t i=0;i7 && DSM_num_ch<11 && (sub_protocol==DSM2_11 || sub_protocol==DSMX_11)) idx+=5; // In 11ms mode change index only for channels 8..10 for(uint8_t i=0;i<14;i++) - ch_map[i]=pgm_read_byte_near(&ch_map_progmem[idx][i]); + ch_map[i]=pgm_read_byte_near(&DSM_ch_map_progmem[idx][i]); } static void __attribute__((unused)) DSM_build_data_packet(uint8_t upper) @@ -294,12 +294,12 @@ static void __attribute__((unused)) DSM_set_sop_data_crc() else CYRF_ConfigCRCSeed(~crc); //CH1 - uint8_t pn_row = get_pn_row(hopping_frequency[hopping_frequency_no]); + uint8_t pn_row = DSM_get_pn_row(hopping_frequency[hopping_frequency_no]); uint8_t code[16]; - read_code(code,pn_row,sop_col,8); // pn_row between 0 and 4, sop_col between 1 and 7 + DSM_read_code(code,pn_row,sop_col,8); // pn_row between 0 and 4, sop_col between 1 and 7 CYRF_ConfigSOPCode(code); - read_code(code,pn_row,7 - sop_col,8); // 7-sop_col between 0 and 6 - read_code(code+8,pn_row,7 - sop_col + 1,8); // 7-sop_col+1 between 1 and 7 + DSM_read_code(code,pn_row,7 - sop_col,8); // 7-sop_col between 0 and 6 + DSM_read_code(code+8,pn_row,7 - sop_col + 1,8); // 7-sop_col+1 between 1 and 7 CYRF_ConfigDataCode(code, 16); CYRF_ConfigRFChannel(hopping_frequency[hopping_frequency_no]); @@ -536,7 +536,7 @@ uint16_t initDsm() cyrfmfg_id[3]^=RX_num; //Calc sop_col sop_col = (cyrfmfg_id[0] + cyrfmfg_id[1] + cyrfmfg_id[2] + 2) & 0x07; - //Fix for OrangeRX using wrong pncodes by preventing access to "Col 8" + //Fix for OrangeRX using wrong DSM_pncodes by preventing access to "Col 8" if(sop_col==0) { cyrfmfg_id[rx_tx_addr[0]%3]^=0x01; //Change a bit so sop_col will be different from 0 diff --git a/Multiprotocol/Multiprotocol.h b/Multiprotocol/Multiprotocol.h index f3261ea..6d48c35 100644 --- a/Multiprotocol/Multiprotocol.h +++ b/Multiprotocol/Multiprotocol.h @@ -19,7 +19,7 @@ #define VERSION_MAJOR 1 #define VERSION_MINOR 2 #define VERSION_REVISION 0 -#define VERSION_PATCH_LEVEL 45 +#define VERSION_PATCH_LEVEL 46 //****************** // Protocols