mirror of
https://github.com/opentx/opentx.git
synced 2025-07-19 22:35:12 +03:00
FrSky X3 board support added
This commit is contained in:
parent
bc5c3587d8
commit
8ec797730e
22 changed files with 270 additions and 60 deletions
|
@ -53,6 +53,9 @@
|
|||
#define FIRST_ANALOG_ADC 0
|
||||
#define NUM_ANALOGS_ADC 10
|
||||
#define NUM_ANALOGS_ADC_EXT (NUM_ANALOGS - 10)
|
||||
#elif defined(PCBX3)
|
||||
#define FIRST_ANALOG_ADC 0
|
||||
#define NUM_ANALOGS_ADC NUM_ANALOGS
|
||||
#else
|
||||
#define FIRST_ANALOG_ADC 0
|
||||
#define NUM_ANALOGS_ADC NUM_ANALOGS
|
||||
|
@ -117,6 +120,8 @@ void adcInit()
|
|||
// TODO why do we invert POT1 and POT2 here?
|
||||
ADC_MAIN->SQR2 = (ADC_CHANNEL_BATT<<0); // conversions 7 and more
|
||||
ADC_MAIN->SQR3 = (ADC_CHANNEL_STICK_LH<<0) + (ADC_CHANNEL_STICK_LV<<5) + (ADC_CHANNEL_STICK_RV<<10) + (ADC_CHANNEL_STICK_RH<<15) + (ADC_CHANNEL_POT1<<25) + (ADC_CHANNEL_POT2<<20); // conversions 1 to 6
|
||||
#elif defined(PCBX3)
|
||||
ADC_MAIN->SQR3 = (ADC_CHANNEL_STICK_LH<<0) + (ADC_CHANNEL_STICK_LV<<5) + (ADC_CHANNEL_STICK_RV<<10) + (ADC_CHANNEL_STICK_RH<<15) + (ADC_CHANNEL_POT1<<20) + (ADC_CHANNEL_BATT<<25); // conversions 1 to 6
|
||||
#else
|
||||
ADC_MAIN->SQR2 = (ADC_CHANNEL_POT3<<0) + (ADC_CHANNEL_SLIDER1<<5) + (ADC_CHANNEL_SLIDER2<<10) + (ADC_CHANNEL_BATT<<15); // conversions 7 and more
|
||||
ADC_MAIN->SQR3 = (ADC_CHANNEL_STICK_LH<<0) + (ADC_CHANNEL_STICK_LV<<5) + (ADC_CHANNEL_STICK_RV<<10) + (ADC_CHANNEL_STICK_RH<<15) + (ADC_CHANNEL_POT1<<20) + (ADC_CHANNEL_POT2<<25); // conversions 1 to 6
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue