diff --git a/Multiprotocol/Microzone_a7105.ino b/Multiprotocol/Microzone_a7105.ino index 523ab19..4454144 100644 --- a/Multiprotocol/Microzone_a7105.ino +++ b/Multiprotocol/Microzone_a7105.ino @@ -135,7 +135,7 @@ uint16_t MICROZONE_callback() if (bind_counter==0) { BIND_DONE; - if(sub_protocol==MICROZONE_HYPE) + if(sub_protocol==MICROZONE_M1) { A7105_WriteID(MProtocol_id); A7105_WriteReg(A7105_03_FIFOI,0x05); @@ -150,9 +150,9 @@ uint16_t MICROZONE_callback() telemetry_set_input_sync(packet_period); #endif } - if(sub_protocol==MICROZONE_FHSS) - MICROZONE_send_packet(); - else//HYPE +// if(sub_protocol==MICROZONE_FHSS) +// MICROZONE_send_packet(); +// else//HYPE MICROZONE_hype_send_packet(); return packet_period; } @@ -162,23 +162,16 @@ void MICROZONE_init() A7105_Init(); // compute channels from ID - calc_fh_channels(sub_protocol==MICROZONE_FHSS?32:15); + calc_fh_channels(15); hopping_frequency_no=0; - #ifdef MICROZONE_FORCE_ID_FHSS - if(sub_protocol==MICROZONE_FHSS) - { - memcpy(rx_tx_addr,"\x3A\x39\x37\x00",4); - memcpy(hopping_frequency,"\x29\x4C\x67\x92\x31\x1C\x77\x18\x23\x6E\x81\x5C\x8F\x5A\x51\x94\x7A\x12\x45\x6C\x7F\x1E\x0D\x88\x63\x8C\x4F\x37\x26\x61\x2C\x8A",32); - } - #endif - if(sub_protocol==MICROZONE_HYPE) + if(sub_protocol==MICROZONE_M1) { MProtocol_id &= 0x00FF00FF; rx_tx_addr[0] = 0xAF - (rx_tx_addr[1]&0x0F); rx_tx_addr[2] = 0xFF - rx_tx_addr[3]; MProtocol_id |= (rx_tx_addr[0]<<24) + (rx_tx_addr[2]<<8); - #ifdef MICROZONE_FORCE_ID_HYPE + #ifdef MICROZONE_FORCE_ID MProtocol_id=0xAF90738C; set_rx_tx_addr(MProtocol_id); memcpy(hopping_frequency,"\x27\x1B\x63\x75\x03\x39\x57\x69\x87\x0F\x7B\x3F\x33\x51\x6F",15); diff --git a/Multiprotocol/Multi_Protos.ino b/Multiprotocol/Multi_Protos.ino index daa3c87..5138d0e 100644 --- a/Multiprotocol/Multi_Protos.ino +++ b/Multiprotocol/Multi_Protos.ino @@ -105,6 +105,7 @@ const char STR_CONFIG[] ="Config"; const char STR_LOSI[] ="Losi"; const char STR_MOULDKG[] ="MouldKg"; const char STR_XERALL[] ="Xerall"; +const char STR_MICROZONE[] ="Microzone"; const char STR_SUBTYPE_FLYSKY[] = "\x04""Std\0""V9x9""V6x6""V912""CX20"; const char STR_SUBTYPE_HUBSAN[] = "\x04""H107""H301""H501"; @@ -174,6 +175,7 @@ const char STR_SUBTYPE_MOULKG[] = "\x06""Analog""Digit\0"; const char STR_SUBTYPE_KF606[] = "\x06""KF606\0""MIG320""ZCZ50\0"; const char STR_SUBTYPE_E129[] = "\x04""E129""C186"; const char STR_SUBTYPE_FX[] = "\x04""816\0""620\0""9630"; +const char STR_SUBTYPE_MICROZONE[] = "\x02""M1""M2"; #define NO_SUBTYPE nullptr #ifdef SEND_CPPM @@ -377,6 +379,9 @@ const mm_protocol_definition multi_protocols[] = { #if defined(LOSI_CYRF6936_INO) {PROTO_LOSI, STR_LOSI, NO_SUBTYPE, 0, OPTION_NONE, 0, 0, SW_CYRF, LOSI_init, LOSI_callback }, #endif + #if defined(MICROZONE_A7105_INO) + {PROTO_MICROZONE, STR_MICROZONE, STR_SUBTYPE_MICROZONE, 2, OPTION_NONE, 0, 1, SW_A7105, MICROZONE_init, MICROZONE_callback }, + #endif #if defined(MJXQ_CCNRF_INO) {PROTO_MJXQ, STR_MJXQ, STR_SUBTYPE_MJXQ, 7, OPTION_NONE, 0, 0, SW_NRF, MJXQ_init, MJXQ_callback }, #endif diff --git a/Multiprotocol/Multiprotocol.h b/Multiprotocol/Multiprotocol.h index 939e7b4..a6bdd34 100644 --- a/Multiprotocol/Multiprotocol.h +++ b/Multiprotocol/Multiprotocol.h @@ -121,6 +121,7 @@ enum PROTOCOLS PROTO_XERALL = 91, // =>NRF24L01 PROTO_MT99XX2 = 92, // =>NRF24L01, extension of MT99XX protocol PROTO_KYOSHO2 = 93, // =>NRF24L01 + PROTO_MICROZONE = 94, // =>A7105 PROTO_NANORF = 126, // =>NRF24L01 PROTO_TEST = 127, // =>CC2500 @@ -463,6 +464,11 @@ enum FX FX620 = 1, FX9630 = 2, }; +enum MICROZONE +{ + MICROZONE_M1 = 0, + MICROZONE_M2 = 1, +}; #define NONE 0 #define P_HIGH 1 diff --git a/Multiprotocol/_Config.h b/Multiprotocol/_Config.h index 60e5d97..6aa5b57 100644 --- a/Multiprotocol/_Config.h +++ b/Multiprotocol/_Config.h @@ -182,6 +182,7 @@ #define KYOSHO_A7105_INO #define PELIKAN_A7105_INO #define WFLY2_A7105_INO +#define MICROZONE_A7105_INO //The protocols below need a CYRF6936 to be installed #define DEVO_CYRF6936_INO