mirror of
https://github.com/pascallanger/DIY-Multiprotocol-TX-Module.git
synced 2025-02-04 22:48:12 +00:00
_MyConfig.h
This commit is contained in:
parent
01bef23ac9
commit
28868e4c78
@ -165,6 +165,33 @@ void A7105_Strobe(uint8_t address) {
|
|||||||
SPI_Write(address);
|
SPI_Write(address);
|
||||||
A7105_CSN_on;
|
A7105_CSN_on;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Fine tune A7105 LO base frequency
|
||||||
|
// this is required for some A7105 modules and/or RXs with inaccurate crystal oscillator
|
||||||
|
// arg: offset in +/-kHz
|
||||||
|
void A7105_AdjustLOBaseFreq(int16_t offset)
|
||||||
|
{
|
||||||
|
// LO base frequency = 32e6*(bip+(bfp/(2^16)))
|
||||||
|
uint8_t bip; // LO base frequency integer part
|
||||||
|
uint32_t bfp; // LO base frequency fractional part
|
||||||
|
if(offset < 0)
|
||||||
|
{
|
||||||
|
bip = 0x4a; // 2368 MHz
|
||||||
|
bfp = 0xffff+((offset<<11)/1000)+1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
bip = 0x4b; // 2400 MHz (default)
|
||||||
|
bfp = (offset<<11)/1000;
|
||||||
|
}
|
||||||
|
if(offset == 0)
|
||||||
|
bfp = 0x0002; // as per datasheet, not sure why recommended, but that's a +1kHz drift only ...
|
||||||
|
A7105_WriteReg( A7105_11_PLL_III, bip);
|
||||||
|
A7105_WriteReg( A7105_12_PLL_IV, (bfp >> 8) & 0xff);
|
||||||
|
A7105_WriteReg( A7105_13_PLL_V, bfp & 0xff);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef HUBSAN_A7105_INO
|
#ifdef HUBSAN_A7105_INO
|
||||||
const uint8_t PROGMEM HUBSAN_A7105_regs[] = {
|
const uint8_t PROGMEM HUBSAN_A7105_regs[] = {
|
||||||
0xFF, 0x63, 0xFF, 0x0F, 0xFF, 0xFF, 0xFF ,0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x05, 0x04, 0xFF,
|
0xFF, 0x63, 0xFF, 0x0F, 0xFF, 0xFF, 0xFF ,0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x05, 0x04, 0xFF,
|
||||||
|
@ -84,7 +84,7 @@ static void __attribute__((unused)) flysky_apply_extension_flags()
|
|||||||
packet[13] |= FLAG_V6X6_HLESS1;
|
packet[13] |= FLAG_V6X6_HLESS1;
|
||||||
packet[14] |= FLAG_V6X6_HLESS2;
|
packet[14] |= FLAG_V6X6_HLESS2;
|
||||||
}
|
}
|
||||||
if(Servo_AUX6) //use option to manipulate these bytes
|
if(Servo_AUX6)
|
||||||
packet[14] |= FLAG_V6X6_RTH;
|
packet[14] |= FLAG_V6X6_RTH;
|
||||||
if(Servo_AUX7)
|
if(Servo_AUX7)
|
||||||
packet[14] |= FLAG_V6X6_XCAL;
|
packet[14] |= FLAG_V6X6_XCAL;
|
||||||
|
@ -194,17 +194,17 @@ uint16_t H8_3D_callback()
|
|||||||
return packet_period;
|
return packet_period;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __attribute__((unused)) H8_3D_initialize_txid()
|
// captured from H20H stock transmitters
|
||||||
{
|
const uint8_t PROGMEM h20h_tx_rf_map[3][6] = {{/*ID*/0x83, 0x3c, 0x60, 0x00, /*RF*/0x47, 0x3e},
|
||||||
// captured from H20H stock transmitters
|
|
||||||
const uint8_t PROGMEM h20h_tx_rf_map[3][6] = {{/*ID*/0x83, 0x3c, 0x60, 0x00, /*RF*/0x47, 0x3e},
|
|
||||||
{/*ID*/0x5c, 0x2b, 0x60, 0x00, /*RF*/0x4a, 0x3c},
|
{/*ID*/0x5c, 0x2b, 0x60, 0x00, /*RF*/0x4a, 0x3c},
|
||||||
{/*ID*/0x57, 0x07, 0x00, 0x00, /*RF*/0x41, 0x48} };
|
{/*ID*/0x57, 0x07, 0x00, 0x00, /*RF*/0x41, 0x48} };
|
||||||
// captured from H20 Mini / H30 Mini stock transmitters
|
// captured from H20 Mini / H30 Mini stock transmitters
|
||||||
const uint8_t PROGMEM h20mini_tx_rf_map[4][8] = {{/*ID*/0xb4, 0xbb, 0x09, 0x00, /*RF*/0x3e, 0x45, 0x47, 0x4a},
|
const uint8_t PROGMEM h20mini_tx_rf_map[4][8] = {{/*ID*/0xb4, 0xbb, 0x09, 0x00, /*RF*/0x3e, 0x45, 0x47, 0x4a},
|
||||||
{/*ID*/0x94, 0x9d, 0x0b, 0x00, /*RF*/0x3e, 0x43, 0x49, 0x4a},
|
{/*ID*/0x94, 0x9d, 0x0b, 0x00, /*RF*/0x3e, 0x43, 0x49, 0x4a},
|
||||||
{/*ID*/0xd1, 0xd0, 0x00, 0x00, /*RF*/0x3f, 0x42, 0x46, 0x4a},
|
{/*ID*/0xd1, 0xd0, 0x00, 0x00, /*RF*/0x3f, 0x42, 0x46, 0x4a},
|
||||||
{/*ID*/0xcb, 0xcd, 0x04, 0x00, /*RF*/0x41, 0x43, 0x46, 0x4a}};
|
{/*ID*/0xcb, 0xcd, 0x04, 0x00, /*RF*/0x41, 0x43, 0x46, 0x4a}};
|
||||||
|
static void __attribute__((unused)) H8_3D_initialize_txid()
|
||||||
|
{
|
||||||
uint8_t id_num=rx_tx_addr[4];
|
uint8_t id_num=rx_tx_addr[4];
|
||||||
switch(sub_protocol)
|
switch(sub_protocol)
|
||||||
{
|
{
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
#define VERSION_MAJOR 1
|
#define VERSION_MAJOR 1
|
||||||
#define VERSION_MINOR 1
|
#define VERSION_MINOR 1
|
||||||
#define VERSION_REVISION 6
|
#define VERSION_REVISION 6
|
||||||
#define VERSION_PATCH_LEVEL 34
|
#define VERSION_PATCH_LEVEL 35
|
||||||
//******************
|
//******************
|
||||||
// Protocols
|
// Protocols
|
||||||
//******************
|
//******************
|
||||||
|
@ -25,8 +25,6 @@
|
|||||||
//#define DEBUG_TX
|
//#define DEBUG_TX
|
||||||
//#define SERIAL_DEBUG // Only for STM32_BOARD compiled with Upload method "Serial"->usart1, "STM32duino bootloader"->USB serial
|
//#define SERIAL_DEBUG // Only for STM32_BOARD compiled with Upload method "Serial"->usart1, "STM32duino bootloader"->USB serial
|
||||||
|
|
||||||
#define USE_MY_CONFIG
|
|
||||||
|
|
||||||
#ifdef __arm__// Let's automatically select the board if arm is selected
|
#ifdef __arm__// Let's automatically select the board if arm is selected
|
||||||
#define STM32_BOARD
|
#define STM32_BOARD
|
||||||
#endif
|
#endif
|
||||||
@ -40,7 +38,7 @@
|
|||||||
#include "_Config.h"
|
#include "_Config.h"
|
||||||
|
|
||||||
//Personal config file
|
//Personal config file
|
||||||
#if defined USE_MY_CONFIG
|
#if __has_include("_MyConfig.h")
|
||||||
#include "_MyConfig.h"
|
#include "_MyConfig.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -147,7 +147,7 @@
|
|||||||
/*** FAILSAFE SETTINGS ***/
|
/*** FAILSAFE SETTINGS ***/
|
||||||
/**************************/
|
/**************************/
|
||||||
//SHFSS failsafe is by default set to all channels hold their positions except throttle forced to low (980µs)
|
//SHFSS failsafe is by default set to all channels hold their positions except throttle forced to low (980µs)
|
||||||
//You can uncomment the setting below to use channels 9(1) to 16(8) instead
|
//You can uncomment the setting below to use channels 9(1) to 16(8) as failsafe instead
|
||||||
//#define SFHSS_FAILSAFE_CH9_16
|
//#define SFHSS_FAILSAFE_CH9_16
|
||||||
|
|
||||||
#define AFHDS2A_FAILSAFE
|
#define AFHDS2A_FAILSAFE
|
||||||
|
@ -1,24 +0,0 @@
|
|||||||
//#define FORCE_GLOBAL_ID 0x12345678
|
|
||||||
|
|
||||||
#if not defined STM32_BOARD
|
|
||||||
// #undef AFHDS2A_A7105_INO
|
|
||||||
|
|
||||||
// #undef DEVO_CYRF6936_INO
|
|
||||||
// #undef J6PRO_CYRF6936_INO
|
|
||||||
// #undef WK2x01_CYRF6936_INO
|
|
||||||
|
|
||||||
// #undef FRSKYV_CC2500_INO
|
|
||||||
// #undef FRSKYX_CC2500_INO
|
|
||||||
|
|
||||||
// #undef KN_NRF24L01_INO
|
|
||||||
// #undef SLT_NRF24L01_INO
|
|
||||||
|
|
||||||
// #undef FY326_NRF24L01_INO
|
|
||||||
// #undef FQ777_NRF24L01_INO
|
|
||||||
// #undef ASSAN_NRF24L01_INO
|
|
||||||
// #undef HONTAI_NRF24L01_INO
|
|
||||||
// #undef Q303_NRF24L01_INO
|
|
||||||
// #undef GW008_NRF24L01_INO
|
|
||||||
// #undef DM002_NRF24L01_INO
|
|
||||||
// #undef CABELL_NRF24L01_INO
|
|
||||||
#endif
|
|
27
Multiprotocol/_MyConfig.h.example
Normal file
27
Multiprotocol/_MyConfig.h.example
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
//#define FORCE_GLOBAL_ID 0x12345678
|
||||||
|
|
||||||
|
#if not defined STM32_BOARD
|
||||||
|
// Atmega328p board list of unwanted protocols to fit in flash
|
||||||
|
#undef AFHDS2A_A7105_INO
|
||||||
|
|
||||||
|
#undef DEVO_CYRF6936_INO
|
||||||
|
#undef J6PRO_CYRF6936_INO
|
||||||
|
#undef WK2x01_CYRF6936_INO
|
||||||
|
|
||||||
|
#undef FRSKYV_CC2500_INO
|
||||||
|
#undef FRSKYX_CC2500_INO
|
||||||
|
|
||||||
|
#undef KN_NRF24L01_INO
|
||||||
|
#undef SLT_NRF24L01_INO
|
||||||
|
|
||||||
|
#undef FY326_NRF24L01_INO
|
||||||
|
#undef FQ777_NRF24L01_INO
|
||||||
|
#undef ASSAN_NRF24L01_INO
|
||||||
|
#undef HONTAI_NRF24L01_INO
|
||||||
|
#undef Q303_NRF24L01_INO
|
||||||
|
#undef GW008_NRF24L01_INO
|
||||||
|
#undef DM002_NRF24L01_INO
|
||||||
|
#undef CABELL_NRF24L01_INO
|
||||||
|
#undef ESKY150_NRF24L01_INO
|
||||||
|
#undef H8_3D_NRF24L01_INO
|
||||||
|
#endif
|
Loading…
x
Reference in New Issue
Block a user