1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-23 16:25:16 +03:00

No more REV9E and REVPLUS

This commit is contained in:
Bertrand Songis 2016-07-29 14:44:04 +02:00
parent 0f740358f2
commit 51223a5864
60 changed files with 248 additions and 249 deletions

View file

@ -50,7 +50,7 @@ if (inputs.rotenc) pind |= 0x20;
if (inputs.rotenc) PIOB->PIO_PDSR &= ~0x40; else PIOB->PIO_PDSR |= 0x40;
#endif
#if defined(PCBFLAMENCO) || (defined(PCBTARANIS) && defined(REV9E))
#if defined(PCBFLAMENCO) || defined(PCBX9E)
if (inputs.rotenc) simuSetKey(KEY_ENTER, true);
#endif
#endif

View file

@ -502,7 +502,7 @@ int cliDisplay(const char ** argv)
name[len] = '\0';
serialPrint("[%s] = %s", name, switchState(EnumKeys(i)) ? "on" : "off");
}
#if defined(ROTARY_ENCODER_NAVIGATION) || defined(REV9E) || defined(PCBHORUS) || defined(PCBFLAMENCO)
#if defined(ROTARY_ENCODER_NAVIGATION) || defined(PCBX9E) || defined(PCBHORUS) || defined(PCBFLAMENCO)
serialPrint("[Enc.] = %d", rotencValue / 2);
#endif
for (int i=TRM_BASE; i<=TRM_LAST; i++) {

View file

@ -73,7 +73,7 @@
#define MAX_SCRIPTS 7
#define MAX_INPUTS 32
#define NUM_TRAINER 16
#if defined(REV9E)
#if defined(PCBX9E)
#define NUM_POTS 8
#define NUM_XPOTS 4
#else
@ -207,7 +207,7 @@ enum CurveType {
#if defined(PCBFLAMENCO)
#define NUM_SWITCHES 5
#elif defined(PCBTARANIS) && defined(REV9E)
#elif defined(PCBX9E)
#define NUM_SWITCHES 18 // yes, it's a lot!
#elif defined(PCBTARANIS) || defined(PCBHORUS)
#define NUM_SWITCHES 8
@ -606,7 +606,7 @@ enum SwitchSources {
SWSRC_SH1,
SWSRC_SH2,
SWSRC_TRAINER = SWSRC_SH2,
#if defined(REV9E)
#if defined(PCBX9E)
SWSRC_SI0,
SWSRC_SI1,
SWSRC_SI2,
@ -773,13 +773,13 @@ enum MixSources {
MIXSRC_POT1 = MIXSRC_FIRST_POT, LUA_EXPORT("s1", "Potentiometer 1")
MIXSRC_POT2, LUA_EXPORT("s2", "Potentiometer 2")
MIXSRC_POT3, LUA_EXPORT("s3", "Potentiometer 3")
#if defined(REV9E)
#if defined(PCBX9E)
MIXSRC_POT4, LUA_EXPORT("s4", "Potentiometer 4 (X9E only)")
#endif
MIXSRC_FIRST_SLIDER,
MIXSRC_SLIDER1 = MIXSRC_FIRST_SLIDER, LUA_EXPORT("ls", "Left slider")
MIXSRC_SLIDER2, LUA_EXPORT("rs", "Right slider")
#if defined(REV9E)
#if defined(PCBX9E)
MIXSRC_SLIDER3, LUA_EXPORT("lcs", "Left center slider (X9E only)")
MIXSRC_SLIDER4, LUA_EXPORT("rcs", "Right center slider (X9E only)")
MIXSRC_LAST_POT = MIXSRC_SLIDER4,
@ -851,7 +851,7 @@ enum MixSources {
MIXSRC_SF, LUA_EXPORT("sf", "Switch F")
MIXSRC_SG, LUA_EXPORT("sg", "Switch G")
MIXSRC_SH, LUA_EXPORT("sh", "Switch H")
#if defined(REV9E)
#if defined(PCBX9E)
MIXSRC_SI, LUA_EXPORT("si", "Switch I (X9E only)")
MIXSRC_SJ, LUA_EXPORT("sj", "Switch J (X9E only)")
MIXSRC_SK, LUA_EXPORT("sk", "Switch K (X9E only)")

View file

@ -46,10 +46,10 @@
#define TARANIS_FIELD(x)
#endif
#if defined(PCBTARANIS) && defined(REV9E)
#define TARANIS_REV9E_FIELD(x) x;
#if defined(PCBX9E)
#define TARANIS_PCBX9E_FIELD(x) x;
#else
#define TARANIS_REV9E_FIELD(x)
#define TARANIS_PCBX9E_FIELD(x)
#endif
#if defined(PCBHORUS)
@ -728,7 +728,7 @@ PACK(struct ModelHeader {
#if defined(COLORLCD)
typedef uint16_t swconfig_t;
typedef uint32_t swarnstate_t;
#elif defined(PCBTARANIS) && defined(REV9E)
#elif defined(PCBX9E)
typedef uint64_t swconfig_t;
typedef uint64_t swarnstate_t;
typedef uint32_t swarnenable_t;
@ -842,7 +842,7 @@ PACK(struct ModelData {
ARM_FIELD(NOBACKUP(TelemetrySensor telemetrySensors[MAX_SENSORS]))
TARANIS_REV9E_FIELD(uint8_t toplcdTimer)
TARANIS_PCBX9E_FIELD(uint8_t toplcdTimer)
CUSTOM_SCREENS_DATA
@ -929,7 +929,7 @@ PACK(struct TrainerData {
char switchNames[NUM_SWITCHES][LEN_SWITCH_NAME]; \
char anaNames[NUM_STICKS+NUM_POTS][LEN_ANA_NAME];
#elif defined(PCBTARANIS)
#if defined(REV9E)
#if defined(PCBX9E)
#define BLUETOOTH_FIELDS \
uint8_t bluetoothEnable; \
char bluetoothName[LEN_BLUETOOTH_NAME];
@ -1078,7 +1078,7 @@ static inline void check_struct()
CHKSIZE(ModelHeader, 24);
CHKSIZE(CurveData, 4);
#if defined(REV9E)
#if defined(PCBX9E)
CHKSIZE(RadioData, 952);
CHKSIZE(ModelData, 6520);
#else

View file

@ -21,7 +21,7 @@
#include "opentx.h"
#include "timers.h"
#if defined(REVPLUS) && defined(LCD_DUAL_BUFFER)
#if (defined(PCBX9E) || defined(PCBX9DP)) && defined(LCD_DUAL_BUFFER)
display_t displayBuf1[DISPLAY_BUFFER_SIZE] __DMA;
display_t displayBuf2[DISPLAY_BUFFER_SIZE] __DMA;
display_t * displayBuf = displayBuf1;

View file

@ -89,7 +89,7 @@
#define display_t uint8_t
#define DISPLAY_BUFFER_SIZE (LCD_W*LCD_H*4/8)
#if defined(REVPLUS) && defined(LCD_DUAL_BUFFER)
#if (defined(PCBX9E) || defined(PCBX9DP)) && defined(LCD_DUAL_BUFFER)
extern display_t displayBuf1[DISPLAY_BUFFER_SIZE];
extern display_t displayBuf2[DISPLAY_BUFFER_SIZE];
extern display_t * displayBuf;
@ -97,7 +97,7 @@
extern display_t displayBuf[DISPLAY_BUFFER_SIZE];
#endif
#if defined(REVPLUS) && !defined(LCD_DUAL_BUFFER) && !defined(SIMU)
#if (defined(PCBX9E) || defined(PCBX9DP)) && !defined(LCD_DUAL_BUFFER) && !defined(SIMU)
void lcdRefreshWait();
#else
#define lcdRefreshWait()
@ -203,7 +203,7 @@ void lcdSetRefVolt(unsigned char val);
void lcdClear();
void lcdSetContrast();
#if defined(REVPLUS) && !defined(SIMU)
#if (defined(PCBX9E) || defined(PCBX9DP)) && !defined(SIMU)
void lcdRefresh(bool wait=true);
#else
void lcdRefresh();

View file

@ -413,7 +413,7 @@ void menuChannelsView(uint8_t event);
#define LABEL(...) (uint8_t)-1
#if defined(REV9E) && !defined(SIMU)
#if defined(PCBX9E) && !defined(SIMU)
#define KEY_UP KEY_MINUS
#define KEY_DOWN KEY_PLUS
#define KEY_RIGHT KEY_PLUS

View file

@ -45,7 +45,7 @@ enum menuModelSetupItems {
ITEM_MODEL_TIMER3_MINUTE_BEEP,
ITEM_MODEL_TIMER3_COUNTDOWN_BEEP,
#endif
#if defined(REV9E)
#if defined(PCBX9E)
ITEM_MODEL_TOP_LCD_TIMER,
#endif
ITEM_MODEL_EXTENDED_LIMITS,
@ -60,12 +60,12 @@ enum menuModelSetupItems {
ITEM_MODEL_CHECKLIST_DISPLAY,
ITEM_MODEL_THROTTLE_WARNING,
ITEM_MODEL_SWITCHES_WARNING,
#if defined(REV9E)
#if defined(PCBX9E)
ITEM_MODEL_SWITCHES_WARNING2,
ITEM_MODEL_SWITCHES_WARNING3,
#endif
ITEM_MODEL_POTS_WARNING,
#if defined(REV9E)
#if defined(PCBX9E)
ITEM_MODEL_POTS_WARNING2,
#endif
ITEM_MODEL_BEEP_CENTER,
@ -248,7 +248,7 @@ int getSwitchWarningsCount()
#elif TIMERS == 3
#define TIMERS_ROWS TIMER_ROWS(0), TIMER_ROWS(1), TIMER_ROWS(2)
#endif
#if defined(REV9E)
#if defined(PCBX9E)
#define SW_WARN_ITEMS() uint8_t(NAVIGATION_LINE_BY_LINE|(getSwitchWarningsCount()-1)), uint8_t(getSwitchWarningsCount() > 8 ? TITLE_ROW : HIDDEN_ROW), uint8_t(getSwitchWarningsCount() > 16 ? TITLE_ROW : HIDDEN_ROW)
#define POT_WARN_ITEMS() uint8_t(g_model.potsWarnMode ? NAVIGATION_LINE_BY_LINE|NUM_POTS : 0), uint8_t(g_model.potsWarnMode ? TITLE_ROW : HIDDEN_ROW)
#define TOPLCD_ROWS 0,
@ -402,7 +402,7 @@ void menuModelSetup(uint8_t event)
break;
#endif
#if defined(REV9E)
#if defined(PCBX9E)
case ITEM_MODEL_TOP_LCD_TIMER:
lcd_putsLeft(y, STR_TOPLCDTIMER);
drawStringWithIndex(MODEL_SETUP_2ND_COLUMN, y, STR_TIMER, g_model.toplcdTimer+1, attr);
@ -477,7 +477,7 @@ void menuModelSetup(uint8_t event)
g_model.disableThrottleWarning = !editCheckBox(!g_model.disableThrottleWarning, MODEL_SETUP_2ND_COLUMN, y, STR_THROTTLEWARNING, attr, event);
break;
#if defined(REV9E)
#if defined(PCBX9E)
case ITEM_MODEL_SWITCHES_WARNING2:
case ITEM_MODEL_SWITCHES_WARNING3:
case ITEM_MODEL_POTS_WARNING2:
@ -492,7 +492,7 @@ void menuModelSetup(uint8_t event)
case ITEM_MODEL_SWITCHES_WARNING:
{
#if defined(REV9E)
#if defined(PCBX9E)
if (i>=NUM_BODY_LINES-2 && getSwitchWarningsCount() > 8*(NUM_BODY_LINES-i)) {
if (CURSOR_MOVED_LEFT(event))
menuVerticalOffset--;
@ -544,7 +544,7 @@ void menuModelSetup(uint8_t event)
states >>= 2;
}
if (attr && menuHorizontalPosition < 0) {
#if defined(REV9E)
#if defined(PCBX9E)
lcdDrawFilledRect(MODEL_SETUP_2ND_COLUMN-1, y-1, 8*(2*FW+1), 1+FH*((current+7)/8));
#else
lcdDrawFilledRect(MODEL_SETUP_2ND_COLUMN-1, y-1, current*(2*FW+1), FH+1);
@ -554,7 +554,7 @@ void menuModelSetup(uint8_t event)
}
case ITEM_MODEL_POTS_WARNING:
#if defined(REV9E)
#if defined(PCBX9E)
if (i==NUM_BODY_LINES-1 && g_model.potsWarnMode) {
if (CURSOR_MOVED_LEFT(event))
menuVerticalOffset--;
@ -597,7 +597,7 @@ void menuModelSetup(uint8_t event)
if (attr && (menuHorizontalPosition==i+1)) REPEAT_LAST_CURSOR_MOVE();
}
else {
#if defined(REV9E)
#if defined(PCBX9E)
if (i == NUM_XPOTS) {
y += FH;
x = MODEL_SETUP_2ND_COLUMN;
@ -615,7 +615,7 @@ void menuModelSetup(uint8_t event)
}
}
if (attr && menuHorizontalPosition < 0) {
#if defined(REV9E)
#if defined(PCBX9E)
lcdDrawFilledRect(MODEL_SETUP_2ND_COLUMN-1, y-FH-1, LCD_W-MODEL_SETUP_2ND_COLUMN-MENUS_SCROLLBAR_WIDTH+1, 2*FH+1);
#else
lcdDrawFilledRect(MODEL_SETUP_2ND_COLUMN-1, y-1, LCD_W-MODEL_SETUP_2ND_COLUMN-MENUS_SCROLLBAR_WIDTH+1, FH+1);

View file

@ -332,7 +332,7 @@ void menuCustomFunctions(uint8_t event, CustomFunctionData * functions, CustomFu
lcdDrawTextAtIndex(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, STR_MMMINV, 0, attr);
}
}
#if defined(REVPLUS)
#if defined(PCBX9E) || defined(PCBX9DP)
else if (func == FUNC_BACKLIGHT) {
drawSlider(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, CFN_PARAM(cfn), 100, attr);
if (active) INCDEC_SET_FLAG(eeFlags | NO_INCDEC_MARKS);

View file

@ -29,12 +29,12 @@ enum menuGeneralHwItems {
ITEM_SETUP_HW_LABEL_POTS,
ITEM_SETUP_HW_POT1,
ITEM_SETUP_HW_POT2,
CASE_REVPLUS(ITEM_SETUP_HW_POT3)
CASE_REV9E(ITEM_SETUP_HW_POT4)
CASE_PCBX9E_PCBX9DP(ITEM_SETUP_HW_POT3)
CASE_PCBX9E(ITEM_SETUP_HW_POT4)
ITEM_SETUP_HW_LS,
ITEM_SETUP_HW_RS,
CASE_REV9E(ITEM_SETUP_HW_LS2)
CASE_REV9E(ITEM_SETUP_HW_RS2)
CASE_PCBX9E(ITEM_SETUP_HW_LS2)
CASE_PCBX9E(ITEM_SETUP_HW_RS2)
ITEM_SETUP_HW_LABEL_SWITCHES,
ITEM_SETUP_HW_SA,
ITEM_SETUP_HW_SB,
@ -44,17 +44,17 @@ enum menuGeneralHwItems {
ITEM_SETUP_HW_SF,
ITEM_SETUP_HW_SG,
ITEM_SETUP_HW_SH,
CASE_REV9E(ITEM_SETUP_HW_SI)
CASE_REV9E(ITEM_SETUP_HW_SJ)
CASE_REV9E(ITEM_SETUP_HW_SK)
CASE_REV9E(ITEM_SETUP_HW_SL)
CASE_REV9E(ITEM_SETUP_HW_SM)
CASE_REV9E(ITEM_SETUP_HW_SN)
CASE_REV9E(ITEM_SETUP_HW_SO)
CASE_REV9E(ITEM_SETUP_HW_SP)
CASE_REV9E(ITEM_SETUP_HW_SQ)
CASE_REV9E(ITEM_SETUP_HW_SR)
CASE_REV9E(ITEM_SETUP_HW_BLUETOOTH)
CASE_PCBX9E(ITEM_SETUP_HW_SI)
CASE_PCBX9E(ITEM_SETUP_HW_SJ)
CASE_PCBX9E(ITEM_SETUP_HW_SK)
CASE_PCBX9E(ITEM_SETUP_HW_SL)
CASE_PCBX9E(ITEM_SETUP_HW_SM)
CASE_PCBX9E(ITEM_SETUP_HW_SN)
CASE_PCBX9E(ITEM_SETUP_HW_SO)
CASE_PCBX9E(ITEM_SETUP_HW_SP)
CASE_PCBX9E(ITEM_SETUP_HW_SQ)
CASE_PCBX9E(ITEM_SETUP_HW_SR)
CASE_PCBX9E(ITEM_SETUP_HW_BLUETOOTH)
ITEM_SETUP_HW_UART3_MODE,
ITEM_SETUP_HW_JITTER_FILTER,
ITEM_SETUP_HW_MAX
@ -62,15 +62,15 @@ enum menuGeneralHwItems {
#define HW_SETTINGS_COLUMN 15*FW
#if defined(REV9E)
#if defined(PCBX9E)
#define POTS_ROWS NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, 0, 0, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1
#elif defined(REVPLUS)
#elif defined(PCBX9DP)
#define POTS_ROWS NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, 0, 0
#else
#define POTS_ROWS NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, 0, 0
#endif
#if defined(REV9E)
#if defined(PCBX9E)
#define SWITCHES_ROWS NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1
#define BLUETOOTH_ROWS 1,
#else
@ -114,7 +114,7 @@ void menuGeneralHardware(uint8_t event)
lcdDrawTextAtIndex(HW_SETTINGS_COLUMN, y, STR_MMMINV, 0, 0);
break;
}
#if defined(REV9E)
#if defined(PCBX9E)
case ITEM_SETUP_HW_LS2:
case ITEM_SETUP_HW_RS2:
{
@ -137,10 +137,10 @@ void menuGeneralHardware(uint8_t event)
break;
case ITEM_SETUP_HW_POT1:
case ITEM_SETUP_HW_POT2:
#if defined(REVPLUS)
#if defined(PCBX9DP) || defined(PCBX9E)
case ITEM_SETUP_HW_POT3:
#endif
#if defined(REV9E)
#if defined(PCBX9E)
case ITEM_SETUP_HW_POT4:
#endif
{
@ -169,7 +169,7 @@ void menuGeneralHardware(uint8_t event)
case ITEM_SETUP_HW_SF:
case ITEM_SETUP_HW_SG:
case ITEM_SETUP_HW_SH:
#if defined(REV9E)
#if defined(PCBX9E)
case ITEM_SETUP_HW_SI:
case ITEM_SETUP_HW_SJ:
case ITEM_SETUP_HW_SK:
@ -196,7 +196,7 @@ void menuGeneralHardware(uint8_t event)
}
break;
}
#if defined(REV9E)
#if defined(PCBX9E)
case ITEM_SETUP_HW_BLUETOOTH:
lcd_putsLeft(y, "Bluetooth");
drawCheckBox(HW_SETTINGS_COLUMN, y, g_eeGeneral.bluetoothEnable, menuHorizontalPosition == 0 ? attr : 0);

View file

@ -74,7 +74,7 @@ enum menuGeneralSetupItems {
ITEM_SETUP_BACKLIGHT_MODE,
ITEM_SETUP_BACKLIGHT_DELAY,
ITEM_SETUP_BRIGHTNESS,
CASE_REVPLUS(ITEM_SETUP_BACKLIGHT_COLOR)
CASE_PCBX9E_PCBX9DP(ITEM_SETUP_BACKLIGHT_COLOR)
ITEM_SETUP_FLASH_BEEP,
CASE_SPLASH_PARAM(ITEM_SETUP_DISABLE_SPLASH)
CASE_GPS(ITEM_SETUP_LABEL_GPS)
@ -115,7 +115,7 @@ void menuGeneralSetup(uint8_t event)
}
#endif
MENU(STR_MENURADIOSETUP, menuTabGeneral, e_Setup, ITEM_SETUP_MAX, { 2, 2, 0, 1, LABEL(SOUND), 0, 0, 0, 0, 0, 0, 0, CASE_VARIO(LABEL(VARIO)) CASE_VARIO(0) CASE_VARIO(0) CASE_VARIO(0) CASE_VARIO(0) CASE_HAPTIC(LABEL(HAPTIC)) CASE_HAPTIC(0) CASE_HAPTIC(0) CASE_HAPTIC(0) 0, LABEL(ALARMS), 0, 0, 0, 0, IF_ROTARY_ENCODERS(0) LABEL(BACKLIGHT), 0, 0, 0, CASE_REVPLUS(0) CASE_PWM_BACKLIGHT(0) CASE_PWM_BACKLIGHT(0) 0, CASE_SPLASH_PARAM(0) CASE_GPS(LABEL(GPS)) CASE_GPS(0) CASE_GPS(0) CASE_GPS(0) CASE_PXX(0) 0, 0, IF_FAI_CHOICE(0) CASE_MAVLINK(0) 0, 0, LABEL(TX_MODE), 0, 1/*to force edit mode*/ });
MENU(STR_MENURADIOSETUP, menuTabGeneral, e_Setup, ITEM_SETUP_MAX, { 2, 2, 0, 1, LABEL(SOUND), 0, 0, 0, 0, 0, 0, 0, CASE_VARIO(LABEL(VARIO)) CASE_VARIO(0) CASE_VARIO(0) CASE_VARIO(0) CASE_VARIO(0) CASE_HAPTIC(LABEL(HAPTIC)) CASE_HAPTIC(0) CASE_HAPTIC(0) CASE_HAPTIC(0) 0, LABEL(ALARMS), 0, 0, 0, 0, IF_ROTARY_ENCODERS(0) LABEL(BACKLIGHT), 0, 0, 0, CASE_PCBX9E_PCBX9DP(0) CASE_PWM_BACKLIGHT(0) CASE_PWM_BACKLIGHT(0) 0, CASE_SPLASH_PARAM(0) CASE_GPS(LABEL(GPS)) CASE_GPS(0) CASE_GPS(0) CASE_GPS(0) CASE_PXX(0) 0, 0, IF_FAI_CHOICE(0) CASE_MAVLINK(0) 0, 0, LABEL(TX_MODE), 0, 1/*to force edit mode*/ });
if (event == EVT_ENTRY) {
reusableBuffer.generalSettings.stickMode = g_eeGeneral.stickMode;
@ -378,7 +378,7 @@ void menuGeneralSetup(uint8_t event)
}
break;
#if defined(REVPLUS)
#if defined(PCBX9DP) || defined(PCBX9E)
case ITEM_SETUP_BACKLIGHT_COLOR:
lcd_putsLeft(y, STR_BLCOLOR);
drawSlider(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.backlightColor, 20, attr);

View file

@ -50,11 +50,11 @@
#define MARKER_WIDTH 5
const pm_uchar logo_taranis[] PROGMEM = {
#include "../../bitmaps/212x64/logo.lbm"
#include "logo.lbm"
};
const pm_uchar icons[] PROGMEM = {
#include "../../bitmaps/212x64/icons.lbm"
#include "icons.lbm"
};
#define ICON_RSSI 0, 9
@ -162,7 +162,7 @@ void displayTrims(uint8_t phase)
void drawSliders()
{
for (uint8_t i=NUM_STICKS; i<NUM_STICKS+NUM_POTS; i++) {
#if defined(REV9E)
#if defined(PCBX9E)
if (i < SLIDER1) continue; // TODO change and display more values
coord_t x = ((i==SLIDER1 || i==SLIDER3) ? 3 : LCD_W-5);
int8_t y = (i<SLIDER3 ? LCD_H/2+1 : 1);

View file

@ -324,7 +324,7 @@ bool menuCustomFunctions(evt_t event, CustomFunctionData * functions, CustomFunc
lcdDrawTextAtIndex(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, STR_MMMINV, 0, attr);
}
}
#if defined(REVPLUS)
#if defined(PCBX9DP) || defined(PCBX9E)
else if (func == FUNC_BACKLIGHT) {
drawSlider(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, CFN_PARAM(cfn), 100, attr);
INCDEC_SET_FLAG(eeFlags | NO_INCDEC_MARKS);

View file

@ -38,7 +38,7 @@ void hapticQueue::heartbeat()
#else
if (buzzTimeLeft > 0) {
buzzTimeLeft--; // time gets counted down
#if defined(PCBSKY9X) || (defined(PCBTARANIS) && defined(REVPLUS)) || defined(PCBFLAMENCO) || defined(PCBHORUS)
#if defined(PCBSKY9X) || defined(PCBX9DP) || defined(PCBX9E) || defined(PCBFLAMENCO) || defined(PCBHORUS)
// TODO define HAPTIC_PWM option
hapticOn(HAPTIC_STRENGTH() * 20);
#else

View file

@ -130,7 +130,7 @@ enum EnumKeys {
SW_SH0,
SW_SH1,
SW_SH2,
#if defined(REV9E)
#if defined(PCBX9E)
SW_SI0,
SW_SI1,
SW_SI2,

View file

@ -60,7 +60,7 @@ const uint8_t BootCode[] = {
__attribute__ ((section(".bootrodata"), used))
void _bootStart()
{
#if defined(REV9E)
#if defined(PCBX9E)
RCC->AHB1ENR |= RCC_AHB1ENR_GPIOCEN | RCC_AHB1ENR_GPIOGEN | RCC_AHB1ENR_GPIODEN;
#else
RCC->AHB1ENR |= RCC_AHB1ENR_GPIOCEN | RCC_AHB1ENR_GPIOEEN | RCC_AHB1ENR_GPIODEN;
@ -86,7 +86,7 @@ void _bootStart()
// TRIMS_GPIO_PIN_RHL is on PC1 on all versions
// turn on pull-ups on trim keys
GPIOC->PUPDR = 0x00000004;
#if defined(REV9E)
#if defined(PCBX9E)
GPIOG->PUPDR = 0x00000001;
#else
GPIOE->PUPDR = 0x00000040;

View file

@ -12,5 +12,5 @@ macro(add_lua_export_target target)
endmacro(add_lua_export_target)
add_lua_export_target(taranis -DCPUARM -DPCBTARANIS -DLUA -DVIRTUALINPUTS)
add_lua_export_target(taranis_x9e -DCPUARM -DPCBTARANIS -DREVPLUS -DREV9E -DLUA -DVIRTUALINPUTS)
add_lua_export_target(taranis_x9e -DCPUARM -DPCBTARANIS -DPCBX9E -DLUA -DVIRTUALINPUTS)
add_lua_export_target(horus -DCPUARM -DPCBHORUS -DLUA -DVIRTUALINPUTS -I${RADIO_SRC_DIRECTORY}/gui/horus)

View file

@ -28,7 +28,7 @@
#include "lua/lua_exports_horus.inc" // this line must be after lua headers
#elif defined(PCBFLAMENCO)
#include "lua/lua_exports_flamenco.inc"
#elif defined(PCBTARANIS) && defined(REV9E)
#elif defined(PCBX9E)
#include "lua/lua_exports_taranis_x9e.inc"
#elif defined(PCBTARANIS)
#include "lua/lua_exports_taranis.inc"

View file

@ -456,7 +456,7 @@ void perMain()
}
#endif
#if defined(PCBTARANIS) && defined(REV9E) && !defined(SIMU)
#if defined(PCBX9E) && !defined(SIMU)
toplcdRefreshStart();
setTopFirstTimer(getValue(MIXSRC_FIRST_TIMER+g_model.toplcdTimer));
setTopSecondTimer(g_eeGeneral.globalTimer + sessionTimer);
@ -466,7 +466,7 @@ void perMain()
toplcdRefreshEnd();
#endif
#if defined(PCBTARANIS) && defined(REV9E) && !defined(SIMU)
#if defined(PCBX9E) && !defined(SIMU)
bluetoothWakeup();
#endif

View file

@ -580,7 +580,7 @@ enum ThrottleSources {
THROTTLE_SOURCE_SD,
THROTTLE_SOURCE_LS,
THROTTLE_SOURCE_RS,
#elif defined(PCBTARANIS) && defined(REV9E)
#elif defined(PCBX9E)
THROTTLE_SOURCE_F1 = THROTTLE_SOURCE_FIRST_POT,
THROTTLE_SOURCE_F2,
THROTTLE_SOURCE_F3,

View file

@ -265,7 +265,7 @@ void generalDefault()
g_eeGeneral.switchConfig = 0x00007bff; // 6x3POS, 1x2POS, 1xTOGGLE
#endif
#if defined(PCBTARANIS) && defined(REV9E)
#if defined(PCBX9E)
// NI-MH 9.6V
g_eeGeneral.vBatWarn = 87;
g_eeGeneral.vBatMin = -5;
@ -312,7 +312,7 @@ void generalDefault()
}
#endif
#if defined(PCBTARANIS) && defined(REV9E)
#if defined(PCBX9E)
const int8_t defaultName[] = { 20, -1, -18, -1, -14, -9, -19 };
memcpy(g_eeGeneral.bluetoothName, defaultName, sizeof(defaultName));
#endif

View file

@ -181,16 +181,16 @@
#define CASE_GVARS(x)
#endif
#if defined(PCBTARANIS) && defined(REVPLUS)
#define CASE_REVPLUS(x) x,
#if defined(PCBX9DP) || defined(PCBX9E)
#define CASE_PCBX9E_PCBX9DP(x) x,
#else
#define CASE_REVPLUS(x)
#define CASE_PCBX9E_PCBX9DP(x)
#endif
#if defined(PCBTARANIS) && defined(REV9E)
#define CASE_REV9E(x) x,
#if defined(PCBX9E)
#define CASE_PCBX9E(x) x,
#else
#define CASE_REV9E(x)
#define CASE_PCBX9E(x)
#endif
#if defined(PCBSKY9X) && !defined(AR9X) && !defined(REVA)
@ -308,12 +308,12 @@ void memswap(void * a, void * b, uint8_t size);
#define IS_POT_AVAILABLE(x) (true)
#define IS_POT_MULTIPOS(x) (false)
#define IS_POT_WITHOUT_DETENT(x) (false)
#elif defined(PCBTARANIS) && defined(REV9E)
#elif defined(PCBX9E)
#define IS_SLIDER_AVAILABLE(x) ((x)==SLIDER1 || (x)==SLIDER2 || (g_eeGeneral.slidersConfig & (0x01 << ((x)-SLIDER3))))
#define IS_POT_AVAILABLE(x) ((x)<POT1 || ((x)<=POT_LAST && ((g_eeGeneral.potsConfig & (0x03 << (2*((x)-POT1))))!=0)) || ((x)>=SLIDER1 && IS_SLIDER_AVAILABLE(x)))
#define IS_POT_MULTIPOS(x) ((x)>=POT1 && (x)<=POT_LAST && ((g_eeGeneral.potsConfig>>(2*((x)-POT1)))&0x03)==POT_MULTIPOS_SWITCH)
#define IS_POT_WITHOUT_DETENT(x) ((x)>=POT1 && (x)<=POT_LAST && ((g_eeGeneral.potsConfig>>(2*((x)-POT1)))&0x03)==POT_WITHOUT_DETENT)
#elif defined(PCBTARANIS) && defined(REVPLUS)
#elif defined(PCBX9DP)
#define IS_POT_AVAILABLE(x) ((x)!=POT3 || (g_eeGeneral.potsConfig & (0x03 << (2*((x)-POT1))))!=POT_NONE)
#define IS_POT_MULTIPOS(x) ((x)>=POT1 && (x)<=POT_LAST && ((g_eeGeneral.potsConfig>>(2*((x)-POT1)))&0x03)==POT_MULTIPOS_SWITCH)
#define IS_POT_WITHOUT_DETENT(x) ((x)>=POT1 && (x)<=POT_LAST && ((g_eeGeneral.potsConfig>>(2*((x)-POT1)))&0x03)==POT_WITHOUT_DETENT)
@ -330,7 +330,7 @@ void memswap(void * a, void * b, uint8_t size);
#define IS_POT(x) ((x)>=POT1 && (x)<=POT_LAST)
#define IS_MULTIPOS_CALIBRATED(cal) (cal->count>0 && cal->count<XPOTS_MULTIPOS_COUNT)
#if defined(PCBFLAMENCO) || defined(PCBHORUS) || (defined(PCBTARANIS) && defined(REV9E))
#if defined(PCBFLAMENCO) || defined(PCBHORUS) || defined(PCBX9E)
#define PWR_BUTTON_DELAY
#define PWR_PRESS_SHUTDOWN 300 // 3s
#endif

View file

@ -299,7 +299,7 @@ void Open9xSim::updateKeysAndSwitches(bool start)
// SWITCH_KEY(D, 3, 3);
SWITCH_KEY(E, 4, 2);
SWITCH_KEY(F, 5, 3);
#elif defined(PCBTARANIS) && defined(REV9E)
#elif defined(PCBX9E)
SWITCH_KEY(A, 0, 3);
SWITCH_KEY(B, 1, 3);
SWITCH_KEY(C, 2, 3);
@ -374,7 +374,7 @@ long Open9xSim::onTimeout(FXObject*, FXSelector, void*)
}
#endif
#if defined(PCBTARANIS) && defined(REV9E)
#if defined(PCBX9E)
SWITCH_KEY(A, 0, 3);
SWITCH_KEY(B, 1, 3);
SWITCH_KEY(C, 2, 3);
@ -565,7 +565,7 @@ uint16_t anaIn(uint8_t chan)
#if defined(PCBHORUS)
else if (chan == TX_VOLTAGE)
return 1737; //~10.6V
#elif (defined(PCBTARANIS) && defined(REV9E))
#elif defined(PCBX9E)
else if (chan == TX_VOLTAGE)
return 1420; //~10.6V
#elif defined(PCBTARANIS) || defined(PCBFLAMENCO)

View file

@ -620,7 +620,7 @@ PACK(typedef struct {
TelemetrySensor telemetrySensors[MAX_SENSORS];
TARANIS_REV9E_FIELD(uint8_t toplcdTimer)
TARANIS_PCBX9E_FIELD(uint8_t toplcdTimer)
}) ModelData_v217;
int ConvertTelemetrySource_216_to_217(int source)
@ -668,7 +668,7 @@ int ConvertSwitch_217_to_218(int swtch)
int ConvertSource_216_to_217(int source)
{
#if defined(PCBTARANIS) && defined(REV9E)
#if defined(PCBX9E)
// SI to SR switches added
if (source >= MIXSRC_SI)
source += 10;
@ -773,8 +773,8 @@ PACK(typedef struct {
TARANIS_FIELD(char anaNames[NUM_STICKS + NUM_POTS][LEN_ANA_NAME])
N_TARANIS_FIELD(CustomFunctionData_v216 customFn[NUM_CFN])
TARANIS_REV9E_FIELD(uint8_t bluetoothEnable)
TARANIS_REV9E_FIELD(char bluetoothName[LEN_BLUETOOTH_NAME])
TARANIS_PCBX9E_FIELD(uint8_t bluetoothEnable)
TARANIS_PCBX9E_FIELD(char bluetoothName[LEN_BLUETOOTH_NAME])
}) RadioData_v216;
void ConvertRadioData_216_to_217(RadioData & settings)
@ -843,7 +843,7 @@ void ConvertRadioData_217_to_218(RadioData & settings)
memcpy(settings.anaNames, settings_v217->anaNames, sizeof(settings.anaNames));
#endif
#if defined(PCBTARANIS) && defined(REV9E)
#if defined(PCBX9E)
settings.bluetoothEnable = settings_v217->bluetoothEnable;
memcpy(settings.bluetoothName, settings_v217->bluetoothName, sizeof(settings.bluetoothName));
#endif
@ -1199,7 +1199,7 @@ void ConvertModel_217_to_218(ModelData & model)
if (newModel.telemetrySensors[i].unit > UNIT_WATTS)
newModel.telemetrySensors[i].unit += 1;
}
#if defined(PCBTARANIS) && defined(REV9E)
#if defined(PCBX9E)
newModel.toplcdTimer = oldModel.toplcdTimer;
#endif
}

View file

@ -155,7 +155,7 @@ void getSwitchesPosition(bool startup)
#endif
#if defined(PCBTARANIS) || defined(PCBHORUS)
#if defined(REV9E)
#if defined(PCBX9E)
tmr10ms_t switchesMidposStart[16];
#else
tmr10ms_t switchesMidposStart[6]; // TODO constant
@ -242,7 +242,7 @@ void getSwitchesPosition(bool startup)
CHECK_3POS(5, SW_SG);
CHECK_2POS(SW_SH);
#if defined(REV9E)
#if defined(PCBX9E)
CHECK_3POS(6, SW_SI);
CHECK_3POS(7, SW_SJ);
CHECK_3POS(8, SW_SK);

View file

@ -160,7 +160,7 @@ void OpenTxSimulator::wheelEvent(int steps)
rotencValue -= 2;
else
rotencValue += 2;
#elif defined(REV9E)
#elif defined(PCBX9E)
if (steps == 255)
rotencValue -= 2;
else

View file

@ -140,7 +140,7 @@ void simuInit()
break;
#if defined(CPUARM)
#if defined(PCBTARANIS) && !defined(REV9E)
#if defined(PCBTARANIS) && !defined(PCBX9E)
#define SWITCH_CASE NEG_CASE
#else
#define SWITCH_CASE POS_CASE
@ -247,7 +247,7 @@ void simuSetSwitch(uint8_t swtch, int8_t state)
SWITCH_CASE(5, SWITCHES_GPIO_REG_F, SWITCHES_GPIO_PIN_F)
SWITCH_3_CASE(6, SWITCHES_GPIO_REG_G_L, SWITCHES_GPIO_REG_G_H, SWITCHES_GPIO_PIN_G_L, SWITCHES_GPIO_PIN_G_H)
SWITCH_CASE(7, SWITCHES_GPIO_REG_H, SWITCHES_GPIO_PIN_H)
#if defined(REV9E)
#if defined(PCBX9E)
SWITCH_3_CASE(8, SWITCHES_GPIO_REG_I_L, SWITCHES_GPIO_REG_I_H, SWITCHES_GPIO_PIN_I_L, SWITCHES_GPIO_PIN_I_H)
SWITCH_3_CASE(9, SWITCHES_GPIO_REG_J_L, SWITCHES_GPIO_REG_J_H, SWITCHES_GPIO_PIN_J_L, SWITCHES_GPIO_PIN_J_H)
SWITCH_3_CASE(10, SWITCHES_GPIO_REG_K_L, SWITCHES_GPIO_REG_K_H, SWITCHES_GPIO_PIN_K_L, SWITCHES_GPIO_PIN_K_H)
@ -1385,7 +1385,7 @@ void unlockFlash() { }
void lockFlash() { }
void writeFlash(uint32_t *address, uint32_t *buffer) { SIMU_SLEEP(100); }
uint32_t isBootloaderStart(const void *block) { return 1; }
#if defined(REVPLUS)
#if defined(PCBX9DP) || defined(PCBX9E)
void turnBacklightOn(uint8_t level, uint8_t color)
{
TIM4->CCR4 = (100-level)*color;

View file

@ -10,7 +10,7 @@ if(PCB STREQUAL X9E)
set(HAPTIC YES)
set(LUA_EXPORT lua_export_taranis_x9e)
set(FLAVOUR x9e)
add_definitions(-DSTM32F40_41xxx -DREVPLUS -DREV9E)
add_definitions(-DSTM32F40_41xxx -DPCBX9E)
add_definitions(-DEEPROM_VARIANT=32768)
set(FIRMWARE_TARGET_SRC
${FIRMWARE_TARGET_SRC}
@ -31,7 +31,7 @@ elseif(PCB STREQUAL X9D+)
set(HAPTIC YES)
set(LUA_EXPORT lua_export_taranis)
set(FLAVOUR x9d+)
add_definitions(-DREVPLUS)
add_definitions(-DPCBX9DP)
add_definitions(-DEEPROM_VARIANT=0)
set(GUI_DIR 212x64)
set(GUI_SRC ${GUI_SRC} bmp.cpp)

View file

@ -29,11 +29,11 @@
#define SAMPTIME 2 // sample time = 28 cycles
#define SAMPTIME_LONG 3 // sample time = 56 cycles
#if defined(REV9E) && defined(HORUS_STICKS)
#if defined(PCBX9E) && defined(HORUS_STICKS)
const int8_t ana_direction[NUMBER_ANALOG] = {1,-1,1,-1, -1,-1,-1,1, -1,1,1,1, -1};
#elif defined(REV9E)
#elif defined(PCBX9E)
const int8_t ana_direction[NUMBER_ANALOG] = {1,1,-1,-1, -1,-1,-1,1, -1,1,1,1, -1};
#elif defined(REVPLUS)
#elif defined(PCBX9DP)
const int8_t ana_direction[NUMBER_ANALOG] = {1,-1,1,-1, -1,1,-1, -1,1, 1};
#elif defined(REV4a)
const int8_t ana_direction[NUMBER_ANALOG] = {1,-1,1,-1, -1,-1,0, -1,1, 1};
@ -41,7 +41,7 @@
const int8_t ana_direction[NUMBER_ANALOG] = {1,-1,1,-1, -1,1,0, -1,1, 1};
#endif
#if defined(REV9E)
#if defined(PCBX9E)
#define NUMBER_ANALOG_ADC1 10
#define NUMBER_ANALOG_ADC3 3
// mapping from adcValues order to enum Analogs
@ -57,12 +57,12 @@ uint16_t adcValues[NUMBER_ANALOG] __DMA;
void adcInit()
{
#if defined(REV9E)
#if defined(PCBX9E)
configure_pins(ADC_GPIO_PIN_STICK_RV | ADC_GPIO_PIN_STICK_RH | ADC_GPIO_PIN_STICK_LH | ADC_GPIO_PIN_STICK_LV | ADC_GPIO_PIN_SLIDER3, PIN_ANALOG | PIN_PORTA);
configure_pins(ADC_GPIO_PIN_POT2 | ADC_GPIO_PIN_SLIDER4, PIN_ANALOG | PIN_PORTB);
configure_pins(ADC_GPIO_PIN_POT3 | ADC_GPIO_PIN_POT4 | ADC_GPIO_PIN_SLIDER1 | ADC_GPIO_PIN_SLIDER2 | ADC_GPIO_PIN_BATT, PIN_ANALOG | PIN_PORTC);
configure_pins(ADC_GPIO_PIN_POT1 | ADC_GPIO_PIN_SLIDER1 | ADC_GPIO_PIN_SLIDER2, PIN_ANALOG | PIN_PORTF);
#elif defined(REVPLUS)
#elif defined(PCBX9DP)
configure_pins(ADC_GPIO_PIN_STICK_RV | ADC_GPIO_PIN_STICK_RH | ADC_GPIO_PIN_STICK_LH | ADC_GPIO_PIN_STICK_LV | ADC_GPIO_PIN_POT1, PIN_ANALOG | PIN_PORTA);
configure_pins(ADC_GPIO_PIN_POT2 | ADC_GPIO_PIN_POT3, PIN_ANALOG | PIN_PORTB);
configure_pins(ADC_GPIO_PIN_SLIDER1 | ADC_GPIO_PIN_SLIDER2 | ADC_GPIO_PIN_BATT, PIN_ANALOG | PIN_PORTC);
@ -75,7 +75,7 @@ void adcInit()
ADC1->CR1 = ADC_CR1_SCAN;
ADC1->CR2 = ADC_CR2_ADON | ADC_CR2_DMA | ADC_CR2_DDS;
ADC1->SQR1 = (NUMBER_ANALOG_ADC1-1) << 20; // bits 23:20 = number of conversions
#if defined(REV9E)
#if defined(PCBX9E)
ADC1->SQR2 = (ADC_CHANNEL_POT4<<0) + (ADC_CHANNEL_SLIDER3<<5) + (ADC_CHANNEL_SLIDER4<<10) + (ADC_CHANNEL_BATT<<15); // conversions 7 and more
ADC1->SQR3 = (ADC_CHANNEL_STICK_LH<<0) + (ADC_CHANNEL_STICK_LV<<5) + (ADC_CHANNEL_STICK_RV<<10) + (ADC_CHANNEL_STICK_RH<<15) + (ADC_CHANNEL_POT2<<20) + (ADC_CHANNEL_POT3<<25); // conversions 1 to 6
#else
@ -93,7 +93,7 @@ void adcInit()
ADC1_DMA_Stream->NDTR = NUMBER_ANALOG_ADC1;
ADC1_DMA_Stream->FCR = DMA_SxFCR_DMDIS | DMA_SxFCR_FTH_0;
#if defined(REV9E)
#if defined(PCBX9E)
ADC3->CR1 = ADC_CR1_SCAN;
ADC3->CR2 = ADC_CR2_ADON | ADC_CR2_DMA | ADC_CR2_DDS;
ADC3->SQR1 = (NUMBER_ANALOG_ADC3-1) << 20; // NUMBER_ANALOG Channels
@ -118,15 +118,15 @@ void adcSingleRead()
ADC1_DMA_Stream->CR |= DMA_SxCR_EN; // Enable DMA
ADC1->CR2 |= (uint32_t) ADC_CR2_SWSTART;
#if defined(REV9E)
#if defined(PCBX9E)
ADC3_DMA_Stream->CR &= ~DMA_SxCR_EN; // Disable DMA
ADC3->SR &= ~(uint32_t) ( ADC_SR_EOC | ADC_SR_STRT | ADC_SR_OVR );
ADC3_DMA->LIFCR = ADC3_DMA_FLAGS; // Write ones to clear bits
ADC3_DMA_Stream->CR |= DMA_SxCR_EN; // Enable DMA
ADC3->CR2 |= (uint32_t)ADC_CR2_SWSTART;
#endif // defined(REV9E)
#endif
#if defined(REV9E)
#if defined(PCBX9E)
for (unsigned int i=0; i<10000; i++) {
if ((ADC1_DMA->HISR & ADC1_DMA_FLAG_TC) && (ADC3_DMA->LISR & ADC3_DMA_FLAG_TC)) {
break;
@ -180,7 +180,7 @@ uint16_t getAnalogValue(uint8_t index)
// which produces ghost readings on these inputs.
return 0;
}
#if defined(REV9E)
#if defined(PCBX9E)
index = ana_mapping[index];
#endif
if (ana_direction[index] < 0)

View file

@ -39,7 +39,7 @@
return readValue;
}*/
#if defined(REVPLUS)
#if defined(PCBX9E) || defined(PCBX9DP)
void AspiCmd(uint8_t Command_Byte)
{
LCD_A0_LOW() ;

View file

@ -122,7 +122,7 @@ extern "C" void AUDIO_TIM_IRQHandler()
{
DEBUG_INTERRUPT(INT_AUDIO);
DAC->CR &= ~DAC_CR_DMAEN1 ; // Stop DMA requests
#if !defined(REV9E)
#if !defined(PCBX9E)
DAC->CR &= ~DAC_CR_DMAUDRIE1 ; // Stop underrun interrupt
#endif
DAC->SR = DAC_SR_DMAUDR1 ; // Write 1 to clear flag

View file

@ -98,7 +98,7 @@ void interrupt5ms()
per10ms();
}
#if defined(REV9E)
#if defined(PCBX9E)
checkRotaryEncoder();
#endif
}
@ -112,16 +112,16 @@ extern "C" void INTERRUPT_5MS_IRQHandler()
}
#endif
#if defined(REV9E)
#if defined(PCBX9E)
#define PWR_PRESS_DURATION_MIN 200 // 2s
#define PWR_PRESS_DURATION_MAX 500 // 5s
const pm_uchar bmp_startup[] PROGMEM = {
#include "../../bitmaps/212x64/startup.lbm"
#include "startup.lbm"
};
const pm_uchar bmp_lock[] PROGMEM = {
#include "../../bitmaps/212x64/lock.lbm"
#include "lock.lbm"
};
#endif
@ -132,8 +132,8 @@ void boardInit()
RCC_APB1PeriphClockCmd(LCD_RCC_APB1Periph | AUDIO_RCC_APB1Periph | BACKLIGHT_RCC_APB1Periph | INTERRUPT_5MS_APB1Periph | TIMER_2MHz_APB1Periph | I2C_RCC_APB1Periph | SD_RCC_APB1Periph | TRAINER_RCC_APB1Periph | TELEMETRY_RCC_APB1Periph | SERIAL_RCC_APB1Periph, ENABLE);
RCC_APB2PeriphClockCmd(BACKLIGHT_RCC_APB2Periph | ADC_RCC_APB2Periph | HAPTIC_RCC_APB2Periph | INTMODULE_RCC_APB2Periph | EXTMODULE_RCC_APB2Periph | HEARTBEAT_RCC_APB2Periph, ENABLE);
#if !defined(REV9E)
// some REV9E boards need that the pwrInit() is moved a little bit later
#if !defined(PCBX9E)
// some X9E boards need that the pwrInit() is moved a little bit later
pwrInit();
#endif
@ -152,7 +152,7 @@ void boardInit()
hapticInit();
#endif
#if defined(REV9E)
#if defined(PCBX9E)
bluetoothInit(BLUETOOTH_DEFAULT_BAUDRATE);
#endif
@ -160,7 +160,7 @@ void boardInit()
DBGMCU_APB1PeriphConfig(DBGMCU_IWDG_STOP|DBGMCU_TIM1_STOP|DBGMCU_TIM2_STOP|DBGMCU_TIM3_STOP|DBGMCU_TIM6_STOP|DBGMCU_TIM8_STOP|DBGMCU_TIM10_STOP|DBGMCU_TIM13_STOP|DBGMCU_TIM14_STOP, ENABLE);
#endif
#if defined(REV9E)
#if defined(PCBX9E)
if (!WAS_RESET_BY_WATCHDOG_OR_SOFTWARE()) {
lcdClear();
lcdDrawBitmap(76, 2, bmp_lock, 0, 60);
@ -210,11 +210,11 @@ void boardInit()
void boardOff()
{
BACKLIGHT_OFF();
#if defined(REV9E)
#if defined(PCBX9E)
toplcdOff();
#endif
#if defined(REV9E)
#if defined(PCBX9E)
while (pwrPressed()) {
wdt_reset();
}

View file

@ -27,7 +27,7 @@
extern "C" {
#endif
#if defined(REV9E)
#if defined(PCBX9E)
#include "STM32F4xx_DSP_StdPeriph_Lib_V1.4.0/Libraries/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h"
#include "STM32F4xx_DSP_StdPeriph_Lib_V1.4.0/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_rcc.h"
#include "STM32F4xx_DSP_StdPeriph_Lib_V1.4.0/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_gpio.h"
@ -80,7 +80,7 @@ extern "C" {
#define BOOTLOADER_SIZE 0x8000
#define FIRMWARE_ADDRESS 0x08000000
#if defined(REV9E)
#if defined(PCBX9E)
#define PERI1_FREQUENCY 42000000
#define PERI2_FREQUENCY 84000000
#else
@ -130,7 +130,7 @@ extern uint16_t sessionTimer;
#define SLAVE_MODE() (g_model.trainerMode == TRAINER_MODE_SLAVE)
#if defined(REV9E)
#if defined(PCBX9E)
#define TRAINER_CONNECTED() (true)
#else
#define TRAINER_CONNECTED() (GPIO_ReadInputDataBit(TRAINER_GPIO_DETECT, TRAINER_GPIO_PIN_DETECT) == Bit_RESET)
@ -224,7 +224,7 @@ uint32_t readTrims(void);
#define TRIMS_PRESSED() (readTrims())
#define KEYS_PRESSED() (readKeys())
#if defined(REV9E)
#if defined(PCBX9E)
// Rotary Encoder driver
extern int32_t rotencValue;
void rotencInit(void);
@ -255,7 +255,7 @@ enum Analogs {
POT1,
POT2,
POT3,
#if defined(REV9E)
#if defined(PCBX9E)
POT4,
POT_LAST = POT4,
#else
@ -263,7 +263,7 @@ enum Analogs {
#endif
SLIDER1,
SLIDER2,
#if defined(REV9E)
#if defined(PCBX9E)
SLIDER3,
SLIDER4,
#endif
@ -287,7 +287,7 @@ void pwrInit(void);
uint32_t pwrCheck(void);
void pwrOn(void);
void pwrOff(void);
#if defined(REV9E)
#if defined(PCBX9E)
uint32_t pwrPressed(void);
uint32_t pwrPressedDuration(void);
#define pwroffPressed() pwrPressed()
@ -298,7 +298,7 @@ uint32_t pwroffPressed(void);
// Backlight driver
void backlightInit(void);
#if defined(REVPLUS)
#if defined(PCBX9E) || defined(PCBX9DP)
void turnBacklightOn(uint8_t level, uint8_t color);
void turnBacklightOff(void);
#define setBacklight(xx) turnBacklightOn(xx, g_eeGeneral.backlightColor)
@ -353,7 +353,7 @@ int32_t getVolume(void);
// Haptic driver
void hapticInit(void);
void hapticOff(void);
#if defined(REVPLUS)
#if defined(PCBX9E) || defined(PCBX9DP)
void hapticOn(uint32_t pwmPercent);
#else
void hapticOn(void);
@ -384,7 +384,7 @@ void lcdInitFinish(void);
void lcdOff(void);
// Top LCD driver
#if defined(REV9E)
#if defined(PCBX9E)
void toplcdInit(void);
void toplcdOff(void);
void toplcdRefreshStart(void);

View file

@ -67,7 +67,7 @@
#if defined(PCBTARANIS)
#define BOOTLOADER_TITLE " Taranis BootLoader - " VERSION
#if defined(REV9E)
#if defined(PCBX9E)
#define BOOT_KEY_UP KEY_MINUS
#define BOOT_KEY_DOWN KEY_PLUS
#else
@ -155,7 +155,7 @@ extern void init_spi(void);
extern void writeBlock(void);
extern void usbPluggedIn();
#if defined(REV9E)
#if defined(PCBX9E)
typedef int32_t rotenc_t;
extern rotenc_t rotencValue;
#endif
@ -172,7 +172,7 @@ void interrupt10ms(void)
++enuk;
}
#if defined(REV9E)
#if defined(PCBX9E)
checkRotaryEncoder();
static rotenc_t rePreviousValue;
rotenc_t reNewValue = (rotencValue / 2);
@ -672,7 +672,7 @@ int main()
}
if (state != ST_FLASHING && state != ST_USB) {
#if defined(REV9E)
#if defined(PCBX9E)
if (pwrPressed()) {
#else
if (pwrCheck() == e_power_off) {

View file

@ -20,11 +20,10 @@
#include <OsConfig.h>
#include "board.h"
#if !defined(REV9E)
#if !defined(PCBX9E)
#include "dwt.h" // the old ST library that we use does not define DWT register for STM32F2xx
#endif
#define SYSTEM_TICKS_1US ((CFG_CPU_FREQ + 500000) / 1000000) // number of system ticks in 1us
#define SYSTEM_TICKS_01US ((CFG_CPU_FREQ + 5000000) / 10000000) // number of system ticks in 0.1us (rounding needed for sys frequencies that are not multiple of 10MHz)

View file

@ -127,7 +127,7 @@ uint32_t isFirmwareStart(const void * buffer)
{
const uint32_t * block = (const uint32_t *)buffer;
#if defined(REV9E)
#if defined(PCBX9E)
if ((block[0] & 0xFFFC0000) != 0x10000000 && (block[0] & 0xFFFC0000) != 0x20000000) {
return 0;
}

View file

@ -28,7 +28,7 @@
#define KEYS_GPIO_PIN_EXIT GPIO_Pin_2 // PD.02
#define KEYS_GPIO_REG_PAGE GPIOD->IDR
#define KEYS_GPIO_PIN_PAGE GPIO_Pin_3 // PD.03
#if defined(REV9E)
#if defined(PCBX9E)
#if defined(SIMU)
#define KEYS_GPIO_REG_PLUS GPIOE->IDR
#define KEYS_GPIO_PIN_PLUS GPIO_Pin_5 // This is for SIMU: reuse rotary encoder pins to map UP and DOWN keyboard keys
@ -52,7 +52,7 @@
#define ENC_GPIO_PIN_B GPIO_Pin_13 // PD.13
// Trims
#if defined(REV9E)
#if defined(PCBX9E)
#define TRIMS_GPIO_REG_LHL GPIOG->IDR
#define TRIMS_GPIO_PIN_LHL GPIO_Pin_1 // PG.01
#define TRIMS_GPIO_REG_LHR GPIOG->IDR
@ -89,7 +89,7 @@
#endif
// Switches
#if defined(REV9E)
#if defined(PCBX9E)
#define SWITCHES_GPIO_REG_A_H GPIOD->IDR
#define SWITCHES_GPIO_PIN_A_H GPIO_Pin_10 // PD.10
#define SWITCHES_GPIO_REG_A_L GPIOD->IDR
@ -101,7 +101,7 @@
#define SWITCHES_GPIO_PIN_A_L GPIO_Pin_0 // PE.00
#endif
#if defined(REV9E)
#if defined(PCBX9E)
#define SWITCHES_GPIO_REG_B_H GPIOG->IDR
#define SWITCHES_GPIO_PIN_B_H GPIO_Pin_11 // PG.11
#define SWITCHES_GPIO_REG_B_L GPIOG->IDR
@ -113,7 +113,7 @@
#define SWITCHES_GPIO_PIN_B_L GPIO_Pin_2 // PE.02
#endif
#if defined(REV9E)
#if defined(PCBX9E)
#define SWITCHES_GPIO_REG_C_H GPIOF->IDR
#define SWITCHES_GPIO_PIN_C_H GPIO_Pin_13 // PF.13
#define SWITCHES_GPIO_REG_C_L GPIOF->IDR
@ -125,12 +125,12 @@
#define SWITCHES_GPIO_PIN_C_L GPIO_Pin_5 // PA.05
#endif
#if defined(REV9E)
#if defined(PCBX9E)
#define SWITCHES_GPIO_REG_D_H GPIOE->IDR
#define SWITCHES_GPIO_PIN_D_H GPIO_Pin_1 // PE.01
#define SWITCHES_GPIO_REG_D_L GPIOE->IDR
#define SWITCHES_GPIO_PIN_D_L GPIO_Pin_2 // PE.02
#elif defined(REVPLUS)
#elif defined(PCBX9DP)
#define SWITCHES_GPIO_REG_D_H GPIOE->IDR
#define SWITCHES_GPIO_PIN_D_H GPIO_Pin_7 // PE.07
#define SWITCHES_GPIO_REG_D_L GPIOE->IDR
@ -142,7 +142,7 @@
#define SWITCHES_GPIO_PIN_D_L GPIO_Pin_1 // PB.01
#endif
#if defined(REV9E)
#if defined(PCBX9E)
#define SWITCHES_GPIO_REG_E_H GPIOE->IDR
#define SWITCHES_GPIO_PIN_E_H GPIO_Pin_7 // PE.07
#define SWITCHES_GPIO_REG_E_L GPIOE->IDR
@ -154,7 +154,7 @@
#define SWITCHES_GPIO_PIN_E_L GPIO_Pin_4 // PB.04
#endif
#if defined(REV9E)
#if defined(PCBX9E)
#define SWITCHES_GPIO_REG_F GPIOE->IDR
#define SWITCHES_GPIO_PIN_F GPIO_Pin_11 // PE.11
#else
@ -162,7 +162,7 @@
#define SWITCHES_GPIO_PIN_F GPIO_Pin_14 // PE.14
#endif
#if defined(REV9E)
#if defined(PCBX9E)
#define SWITCHES_GPIO_REG_G_H GPIOF->IDR
#define SWITCHES_GPIO_PIN_G_H GPIO_Pin_3 // PF.03
#define SWITCHES_GPIO_REG_G_L GPIOF->IDR
@ -174,10 +174,10 @@
#define SWITCHES_GPIO_PIN_G_L GPIO_Pin_8 // PE.08
#endif
#if defined(REV9E)
#if defined(PCBX9E)
#define SWITCHES_GPIO_REG_H GPIOF->IDR
#define SWITCHES_GPIO_PIN_H GPIO_Pin_1 // PF.01
#elif defined(REVPLUS)
#elif defined(PCBX9DP)
#define SWITCHES_GPIO_REG_H GPIOD->IDR
#define SWITCHES_GPIO_PIN_H GPIO_Pin_14 // PD.14
#else
@ -185,7 +185,7 @@
#define SWITCHES_GPIO_PIN_H GPIO_Pin_13 // PE.13
#endif
#if defined(REV9E)
#if defined(PCBX9E)
#define SWITCHES_GPIO_REG_I_H GPIOF->IDR
#define SWITCHES_GPIO_PIN_I_H GPIO_Pin_15 // PF.15
#define SWITCHES_GPIO_REG_I_L GPIOE->IDR
@ -228,7 +228,7 @@
#define SWITCHES_GPIO_PIN_R_L GPIO_Pin_0 // PE.00
#endif
#if defined(REV9E)
#if defined(PCBX9E)
#define KEYS_RCC_AHB1Periph (RCC_AHB1Periph_GPIOA|RCC_AHB1Periph_GPIOB|RCC_AHB1Periph_GPIOC|RCC_AHB1Periph_GPIOD|RCC_AHB1Periph_GPIOE|RCC_AHB1Periph_GPIOF|RCC_AHB1Periph_GPIOG)
#define KEYS_GPIOA_PINS (SWITCHES_GPIO_PIN_M_L)
#define KEYS_GPIOB_PINS (SWITCHES_GPIO_PIN_N_H | SWITCHES_GPIO_PIN_N_L | SWITCHES_GPIO_PIN_R_H)
@ -237,7 +237,7 @@
#define KEYS_GPIOE_PINS (TRIMS_GPIO_PIN_LVU | TRIMS_GPIO_PIN_LVD | SWITCHES_GPIO_PIN_D_H | SWITCHES_GPIO_PIN_D_L| SWITCHES_GPIO_PIN_E_H | SWITCHES_GPIO_PIN_E_L | SWITCHES_GPIO_PIN_F | SWITCHES_GPIO_PIN_I_L | SWITCHES_GPIO_PIN_L_H | SWITCHES_GPIO_PIN_L_L | SWITCHES_GPIO_PIN_M_H | SWITCHES_GPIO_PIN_O_L | SWITCHES_GPIO_PIN_R_L)
#define KEYS_GPIOF_PINS (KEYS_GPIO_PIN_ENTER | SWITCHES_GPIO_PIN_C_H | SWITCHES_GPIO_PIN_C_L | SWITCHES_GPIO_PIN_G_H | SWITCHES_GPIO_PIN_G_L | SWITCHES_GPIO_PIN_H | SWITCHES_GPIO_PIN_I_H | SWITCHES_GPIO_PIN_O_H | SWITCHES_GPIO_PIN_P_H | SWITCHES_GPIO_PIN_P_L | SWITCHES_GPIO_PIN_Q_H | SWITCHES_GPIO_PIN_Q_L)
#define KEYS_GPIOG_PINS (TRIMS_GPIO_PIN_LHL | TRIMS_GPIO_PIN_LHR| SWITCHES_GPIO_PIN_B_H | SWITCHES_GPIO_PIN_B_L | SWITCHES_GPIO_PIN_J_H | SWITCHES_GPIO_PIN_J_L | SWITCHES_GPIO_PIN_K_H | SWITCHES_GPIO_PIN_K_L)
#elif defined(REVPLUS)
#elif defined(PCBX9DP)
#define KEYS_RCC_AHB1Periph (RCC_AHB1Periph_GPIOA|RCC_AHB1Periph_GPIOB|RCC_AHB1Periph_GPIOC|RCC_AHB1Periph_GPIOD|RCC_AHB1Periph_GPIOE)
#define KEYS_GPIOA_PINS (SWITCHES_GPIO_PIN_C_L)
#define KEYS_GPIOB_PINS (SWITCHES_GPIO_PIN_E_L | SWITCHES_GPIO_PIN_E_H | SWITCHES_GPIO_PIN_A_H)
@ -254,7 +254,7 @@
#endif
// ADC
#if defined(REV9E)
#if defined(PCBX9E)
#define ADC_RCC_AHB1Periph (RCC_AHB1Periph_GPIOA | RCC_AHB1Periph_GPIOB | RCC_AHB1Periph_GPIOC | RCC_AHB1Periph_GPIOF | RCC_AHB1Periph_DMA2)
#define ADC_RCC_APB2Periph (RCC_APB2Periph_ADC1 | RCC_APB2Periph_ADC3)
#else
@ -273,7 +273,7 @@
#define ADC1_DMA_Stream DMA2_Stream4
#define ADC1_DMA_FLAGS (DMA_HIFCR_CTCIF4 | DMA_HIFCR_CHTIF4 | DMA_HIFCR_CTEIF4 | DMA_HIFCR_CDMEIF4 | DMA_HIFCR_CFEIF4)
#define ADC1_DMA_FLAG_TC DMA_HISR_TCIF4
#if defined(REV9E)
#if defined(PCBX9E)
#define ADC_GPIO_PIN_POT1 GPIO_Pin_8 // PF.08
#define ADC_GPIO_PIN_POT2 GPIO_Pin_0 // PB.00
#define ADC_GPIO_PIN_POT3 GPIO_Pin_5 // PC.05
@ -296,7 +296,7 @@
#define ADC3_DMA_Stream DMA2_Stream0
#define ADC3_DMA_FLAGS (DMA_LIFCR_CTCIF0 | DMA_LIFCR_CHTIF0 | DMA_LIFCR_CTEIF0 | DMA_LIFCR_CDMEIF0 | DMA_LIFCR_CFEIF0)
#define ADC3_DMA_FLAG_TC DMA_LISR_TCIF0
#elif defined(REVPLUS)
#elif defined(PCBX9DP)
#define ADC_GPIO_PIN_POT1 GPIO_Pin_6 // PA.06
#define ADC_GPIO_PIN_POT2 GPIO_Pin_0 // PB.00
#define ADC_GPIO_PIN_POT3 GPIO_Pin_1 // PB.01
@ -332,7 +332,7 @@
// Internal Module
#define INTMODULE_RCC_AHB1Periph (RCC_AHB1Periph_GPIOA | RCC_AHB1Periph_GPIOC | RCC_AHB1Periph_GPIOD | RCC_AHB1Periph_DMA2)
#define INTMODULE_RCC_APB2Periph RCC_APB2Periph_TIM1
#if defined(REVPLUS)
#if defined(PCBX9E) || defined(PCBX9DP)
#define INTMODULE_PWR_GPIO GPIOC
#define INTMODULE_PWR_GPIO_PIN GPIO_Pin_6 // PC.06
#else
@ -453,7 +453,7 @@
#define USB_GPIO_AF GPIO_AF_OTG1_FS
// BackLight
#if defined(REV9E)
#if defined(PCBX9E)
#define BACKLIGHT_RCC_AHB1Periph RCC_AHB1Periph_GPIOE
#define BACKLIGHT_RCC_APB1Periph 0
#define BACKLIGHT_RCC_APB2Periph RCC_APB2Periph_TIM9
@ -465,7 +465,7 @@
#define BACKLIGHT_GPIO_PinSource_2 GPIO_PinSource5
#define BACKLIGHT_GPIO_AF_1 GPIO_AF_TIM9
#define BACKLIGHT_GPIO_AF_2 GPIO_AF_TIM9
#elif defined (REVPLUS)
#elif defined (PCBX9DP)
#define BACKLIGHT_RCC_AHB1Periph RCC_AHB1Periph_GPIOD
#define BACKLIGHT_RCC_APB1Periph RCC_APB1Periph_TIM4
#define BACKLIGHT_RCC_APB2Periph 0
@ -489,7 +489,7 @@
#endif
// LCD
#if defined(REV9E)
#if defined(PCBX9E)
#define LCD_RCC_AHB1Periph (RCC_AHB1Periph_GPIOA | RCC_AHB1Periph_GPIOC | RCC_AHB1Periph_GPIOD | RCC_AHB1Periph_DMA1)
#define LCD_RCC_APB1Periph RCC_APB1Periph_SPI3
#define LCD_GPIO_SPI GPIOC
@ -507,7 +507,7 @@
#define LCD_DMA_FLAGS (DMA_HIFCR_CTCIF7 | DMA_HIFCR_CHTIF7 | DMA_HIFCR_CTEIF7 | DMA_HIFCR_CDMEIF7 | DMA_HIFCR_CFEIF7)
#define LCD_DMA_FLAG_INT DMA_HIFCR_CTCIF7
#define LCD_SPI SPI3
#elif defined(REVPLUS)
#elif defined(PCBX9DP)
#define LCD_RCC_AHB1Periph (RCC_AHB1Periph_GPIOA | RCC_AHB1Periph_GPIOC | RCC_AHB1Periph_GPIOD | RCC_AHB1Periph_DMA1)
#define LCD_RCC_APB1Periph RCC_APB1Periph_SPI3
#define LCD_GPIO_SPI GPIOC
@ -597,7 +597,7 @@
#define AUDIO_DMA DMA1
// Haptic
#if defined(REVPLUS)
#if defined(PCBX9E) || defined(PCBX9DP)
#define HAPTIC_RCC_AHB1Periph RCC_AHB1Periph_GPIOB
#define HAPTIC_RCC_APB2Periph RCC_APB2Periph_TIM10
#define HAPTIC_GPIO_PinSource GPIO_PinSource8
@ -613,7 +613,7 @@
#endif
// Top LCD on X9E
#if defined(REV9E)
#if defined(PCBX9E)
#define TOPLCD_RCC_AHB1Periph RCC_AHB1Periph_GPIOG
#define TOPLCD_GPIO GPIOG
#define TOPLCD_GPIO_PIN_DATA GPIO_Pin_5
@ -624,7 +624,7 @@
#endif
// Bluetooth on X9E
#if defined(REV9E)
#if defined(PCBX9E)
#define BT_USART USART6
#define BT_GPIO_AF GPIO_AF_USART6
#define BT_USART_IRQn USART6_IRQn

View file

@ -18,9 +18,9 @@
* GNU General Public License for more details.
*/
#include "../../opentx.h"
#include "opentx.h"
#if defined(REVPLUS)
#if defined(PCBX9E) || defined(PCBX9DP)
void hapticOff(void)
{
HAPTIC_TIMER->CCR1 = 0;
@ -58,7 +58,7 @@ void hapticInit(void)
#else
// No PWM before REVPLUS
// No PWM before X9D+
void hapticInit(void)
{
GPIO_InitTypeDef GPIO_InitStructure;

View file

@ -33,7 +33,7 @@ uint32_t readKeys()
if (~KEYS_GPIO_REG_EXIT & KEYS_GPIO_PIN_EXIT)
result |= 1 << KEY_EXIT;
#if !defined(REV9E) || defined(SIMU)
#if !defined(PCBX9E) || defined(SIMU)
if (~KEYS_GPIO_REG_PLUS & KEYS_GPIO_PIN_PLUS)
result |= 1 << KEY_PLUS;
if (~KEYS_GPIO_REG_MINUS & KEYS_GPIO_PIN_MINUS)
@ -81,7 +81,7 @@ uint8_t keyDown()
return readKeys();
}
#if defined(REV9E)
#if defined(PCBX9E)
uint32_t Rotary_position;
rotenc_t rotencValue;
void checkRotaryEncoder()
@ -116,7 +116,7 @@ void readKeysAndTrims()
keys[enuk++].input(in & i);
}
#if defined(REV9E) && !defined(SIMU)
#if defined(PCBX9E) && !defined(SIMU)
#define X9E_RE_TIMEOUT 5
static rotenc_t rePreviousValue;
rotenc_t reNewValue = (rotencValue / 2);
@ -157,7 +157,7 @@ void readKeysAndTrims()
}
}
#if defined(REV9E)
#if defined(PCBX9E)
#define ADD_2POS_CASE(x) \
case SW_S ## x ## 2: \
xxx = SWITCHES_GPIO_REG_ ## x & SWITCHES_GPIO_PIN_ ## x ; \
@ -217,7 +217,7 @@ bool switchState(EnumKeys enuk)
ADD_2POS_CASE(F);
ADD_3POS_CASE(G, 6);
ADD_2POS_CASE(H);
#if defined(REV9E)
#if defined(PCBX9E)
ADD_3POS_CASE(I, 8);
ADD_3POS_CASE(J, 9);
ADD_3POS_CASE(K, 10);

View file

@ -18,12 +18,12 @@
* GNU General Public License for more details.
*/
#include "../../opentx.h"
#include "opentx.h"
#define WriteData(x) AspiData(x)
#define WriteCommand(x) AspiCmd(x)
#if defined(REVPLUS)
#if defined(PCBX9E) || defined(PCBX9DP)
#define CONTRAST_OFS 160
#define RESET_WAIT_DELAY_MS 300 //wait time after LCD reset before first command
#define WAIT_FOR_DMA_END() { while(lcd_busy) {}; }
@ -36,7 +36,7 @@
bool lcdInitFinished = false;
void lcdInitFinish();
#if defined(REVPLUS)
#if defined(PCBX9E) || defined(PCBX9DP)
// New hardware SPI driver for LCD
void initLcdSpi()
@ -155,7 +155,7 @@ void Set_Address(u8 x, u8 y)
LCD_CLK_HIGH(); \
LCD_CLK_HIGH();
#if defined(REVPLUS)
#if defined(PCBX9E) || defined(PCBX9DP)
volatile bool lcd_busy;
@ -213,7 +213,7 @@ extern "C" void LCD_DMA_Stream_IRQHandler()
lcd_busy = false;
}
#else // #if defined(REVPLUS)
#else // #if defined(PCBX9E) || defined(PCBX9DP)
void lcdRefresh()
{
if (!lcdInitFinished) {
@ -252,7 +252,7 @@ void backlightInit()
{
GPIO_InitTypeDef GPIO_InitStructure;
#if defined(REV9E)
#if defined(PCBX9E)
GPIO_InitStructure.GPIO_Pin = BACKLIGHT_GPIO_PIN_1|BACKLIGHT_GPIO_PIN_2;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
@ -269,7 +269,7 @@ void backlightInit()
BACKLIGHT_TIMER->CCR1 = 100 ;
BACKLIGHT_TIMER->EGR = 0 ;
BACKLIGHT_TIMER->CR1 = TIM_CR1_CEN ; // Counter enable
#elif defined(REVPLUS)
#elif defined(PCBX9DP)
GPIO_InitStructure.GPIO_Pin = BACKLIGHT_GPIO_PIN_1|BACKLIGHT_GPIO_PIN_2;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
@ -376,7 +376,7 @@ void lcdInitFinish()
{
lcdInitFinished = true;
#if defined(REVPLUS)
#if defined(PCBX9E) || defined(PCBX9DP)
initLcdSpi();
#endif
@ -420,7 +420,7 @@ void lcdSetRefVolt(uint8_t val)
AspiCmd(val+CONTRAST_OFS); //0--255
}
#if defined(REV9E)
#if defined(PCBX9E)
void turnBacklightOn(uint8_t level, uint8_t color)
{
BACKLIGHT_TIMER->CCR1 = ((100-level)*(20-color))/20;
@ -432,7 +432,7 @@ void turnBacklightOff(void)
BACKLIGHT_TIMER->CCR1 = 0;
BACKLIGHT_TIMER->CCR2 = 0;
}
#elif defined(REVPLUS)
#elif defined(PCBX9DP)
void turnBacklightOn(uint8_t level, uint8_t color)
{
BACKLIGHT_TIMER->CCR4 = ((100-level)*(20-color))/20;

View file

@ -70,7 +70,7 @@ void pwrOff()
while(1) {
wdt_reset();
#if defined(REV9E)
#if defined(PCBX9E)
// 9E needs watchdog reset because CPU is still running while
// the power key is held pressed by the user.
// The power key should be released by now, but we must make sure
@ -90,7 +90,7 @@ void pwrOff()
// this function must not return!
}
#if defined(REV9E)
#if defined(PCBX9E)
uint32_t pwrPressed()
{
return GPIO_ReadInputDataBit(PWR_GPIO, PWR_SWITCH_GPIO_PIN) == Bit_RESET;
@ -102,7 +102,7 @@ uint32_t pwroffPressed()
}
#endif
#if !defined(REV9E)
#if !defined(PCBX9E)
uint32_t pwrCheck()
{
if (!pwroffPressed())

View file

@ -235,7 +235,7 @@ void menusTask(void * pdata)
#endif
}
#if defined(PCBTARANIS) && defined(REV9E)
#if defined(PCBX9E)
toplcdOff();
#endif

View file

@ -63,7 +63,7 @@ NOINLINE void processFrskyTelemetryData(uint8_t data)
}
#endif
#if defined(PCBTARANIS) && defined(REV9E) && !defined(SIMU)
#if defined(PCBX9E) && !defined(SIMU)
#define BLUETOOTH_BUFFER_LENGTH 20
static uint8_t bluetoothBuffer[BLUETOOTH_BUFFER_LENGTH];
static uint8_t bluetoothIndex = 0;

View file

@ -272,7 +272,7 @@ PACK(struct FrskyTelemetryData {
#endif
#endif
#if defined(PCBTARANIS) && defined(REVPLUS)
#if defined(PCBX9DP) || defined(PCBX9E)
#define IS_VALID_XJT_VERSION() (telemetryData.xjtVersion != 0 && telemetryData.xjtVersion != 0xff)
#else
#define IS_VALID_XJT_VERSION() (1)

View file

@ -252,7 +252,7 @@ void processSportPacket(uint8_t * packet)
else
telemetryData.rssi.set(data);
}
#if defined(PCBTARANIS) && defined(REVPLUS)
#if defined(PCBX9DP) || defined(PCBX9E)
else if (id == XJT_VERSION_ID) {
telemetryData.xjtVersion = HUB_DATA_U16(packet);
if (!IS_VALID_XJT_VERSION()) {

View file

@ -141,7 +141,7 @@ void telemetryWakeup()
}
#endif
#if defined(PCBTARANIS) && defined(REVPLUS)
#if defined(PCBX9DP) || defined(PCBX9E)
#define FRSKY_BAD_ANTENNA() (IS_VALID_XJT_VERSION() && telemetryData.swr.value > 0x33)
#else
#define FRSKY_BAD_ANTENNA() (telemetryData.swr.value > 0x33)

View file

@ -69,9 +69,9 @@ Idle task stack size(word).
/*!<
System frequency (Hz).
*/
#if defined(PCBFLAMENCO) || (defined(PCBTARANIS) && defined(REV9E)) || defined(PCBHORUS)
#if defined(STM32F4)
#define CFG_CPU_FREQ (168000000)
#elif defined(PCBTARANIS)
#elif defined(STM32)
#define CFG_CPU_FREQ (120000000)
#else
#define CFG_CPU_FREQ (36000000) // TODO check if really correct for sky9x?

View file

@ -405,7 +405,7 @@ const pm_char STR_SHUTDOWN[] PROGMEM = TR_SHUTDOWN;
const pm_char STR_SAVEMODEL[] PROGMEM = TR_SAVEMODEL;
#endif
#if defined(PCBTARANIS) && defined(REV9E)
#if defined(PCBX9E)
const pm_char STR_POWEROFF[] PROGMEM = TR_POWEROFF;
#endif

View file

@ -621,7 +621,7 @@ extern const pm_char STR_SHUTDOWN[];
extern const pm_char STR_SAVEMODEL[];
#endif
#if defined(PCBTARANIS) && defined(REV9E)
#if defined(PCBX9E)
extern const pm_char STR_POWEROFF[];
#endif

View file

@ -162,7 +162,7 @@
#define TR_RETA123 "SVPK12345LR"
#elif defined(PCBFLAMENCO)
#define TR_RETA123 "SVPK123LR"
#elif defined(PCBTARANIS) && defined(REV9E)
#elif defined(PCBX9E)
#define TR_RETA123 "SVPK1234LRLR"
#elif defined(PCBTARANIS) || defined(REVX)
#define TR_RETA123 "SVPK123LR"
@ -505,7 +505,7 @@
#elif defined(PCBFLAMENCO)
#define TR_POTS_VSRCRAW "SD\0 ""LS\0 ""RS\0 "
#define TR_SW_VSRCRAW "SA\0 ""SB\0 ""SC\0 ""SE\0 ""SF\0 "
#elif defined(PCBTARANIS) && defined(REV9E)
#elif defined(PCBX9E)
#define TR_POTS_VSRCRAW "\310S1\0 ""\310S2\0 ""\310S3\0 ""\310S4\0 ""\311LS\0 ""\311RS\0 ""\311LS2 ""\311RS2 "
#define TR_SW_VSRCRAW "\312SA\0 ""\312SB\0 ""\312SC\0 ""\312SD\0 ""\312SE\0 ""\312SF\0 ""\312SG\0 ""\312SH\0 ""\312SI\0 ""\312SJ\0 ""\312SK\0 ""\312SL\0 ""\312SM\0 ""\312SN\0 ""\312SO\0 ""\312SP\0 ""\312SQ\0 ""\312SR\0 "
#elif defined(PCBTARANIS)

View file

@ -166,7 +166,7 @@
#define TR_RETA123 "SHGQ12345LR"
#elif defined(PCBFLAMENCO)
#define TR_RETA123 "SHGQ123LR"
#elif defined(PCBTARANIS) && defined(REV9E)
#elif defined(PCBX9E)
#define TR_RETA123 "SHGQ1234LRLR"
#elif defined(PCBTARANIS) || defined(REVX)
#define TR_RETA123 "SHGQ123LR"
@ -519,7 +519,7 @@
#elif defined(PCBFLAMENCO)
#define TR_POTS_VSRCRAW "SD\0 ""LS\0 ""RS\0 "
#define TR_SW_VSRCRAW "SA\0 ""SB\0 ""SC\0 ""SE\0 ""SF\0 "
#elif defined(PCBTARANIS) && defined(REV9E)
#elif defined(PCBX9E)
#define TR_POTS_VSRCRAW "\310F1\0""\310F2\0""\310F3\0""\310F4\0""\311S1\0""\311S2\0""\311LS\0""\311RS\0"
#define TR_SW_VSRCRAW "\312SA\0""\312SB\0""\312SC\0""\312SD\0""\312SE\0""\312SF\0""\312SG\0""\312SH\0""\312SI\0""\312SJ\0""\312SK\0""\312SL\0""\312SM\0""\312SN\0""\312SO\0""\312SP\0""\312SQ\0""\312SR\0"
#elif defined(PCBTARANIS)

View file

@ -166,7 +166,7 @@
#define TR_RETA123 "RETA12345LR"
#elif defined(PCBFLAMENCO)
#define TR_RETA123 "RETA123LR"
#elif defined(PCBTARANIS) && defined(REV9E)
#elif defined(PCBX9E)
#define TR_RETA123 "RETA1234LRLR"
#elif defined(PCBTARANIS) || defined(REVX)
#define TR_RETA123 "RETA123LR"
@ -519,7 +519,7 @@
#elif defined(PCBFLAMENCO)
#define TR_POTS_VSRCRAW "SD\0 ""LS\0 ""RS\0 "
#define TR_SW_VSRCRAW "SA\0 ""SB\0 ""SC\0 ""SE\0 ""SF\0 "
#elif defined(PCBTARANIS) && defined(REV9E)
#elif defined(PCBX9E)
#define TR_POTS_VSRCRAW "\310F1\0""\310F2\0""\310F3\0""\310F4\0""\311S1\0""\311S2\0""\311LS\0""\311RS\0"
#define TR_SW_VSRCRAW "\312SA\0""\312SB\0""\312SC\0""\312SD\0""\312SE\0""\312SF\0""\312SG\0""\312SH\0""\312SI\0""\312SJ\0""\312SK\0""\312SL\0""\312SM\0""\312SN\0""\312SO\0""\312SP\0""\312SQ\0""\312SR\0"
#elif defined(PCBTARANIS)

View file

@ -162,7 +162,7 @@
#define TR_RETA123 "RETA12345LR"
#elif defined(PCBFLAMENCO)
#define TR_RETA123 "RETA123LR"
#elif defined(PCBTARANIS) && defined(REV9E)
#elif defined(PCBX9E)
#define TR_RETA123 "RETA1234LRLR"
#elif defined(PCBTARANIS) || defined(REVX)
#define TR_RETA123 "RETA123LR"
@ -497,7 +497,7 @@
#elif defined(PCBFLAMENCO)
#define TR_POTS_VSRCRAW "SD\0 ""LS\0 ""RS\0 "
#define TR_SW_VSRCRAW "SA\0 ""SB\0 ""SC\0 ""SE\0 ""SF\0 "
#elif defined(PCBTARANIS) && defined(REV9E)
#elif defined(PCBX9E)
#define TR_POTS_VSRCRAW "\310F1\0""\310F2\0""\310F3\0""\310F4\0""\311S1\0""\311S2\0""\311LS\0""\311RS\0"
#define TR_SW_VSRCRAW "\312SA\0""\312SB\0""\312SC\0""\312SD\0""\312SE\0""\312SF\0""\312SG\0""\312SH\0""\312SI\0""\312SJ\0""\312SK\0""\312SL\0""\312SM\0""\312SN\0""\312SO\0""\312SP\0""\312SQ\0""\312SR\0"
#elif defined(PCBTARANIS)

View file

@ -162,7 +162,7 @@
#define TR_RETA123 "RETA12345LR"
#elif defined(PCBFLAMENCO)
#define TR_RETA123 "RETA123LR"
#elif defined(PCBTARANIS) && defined(REV9E)
#elif defined(PCBX9E)
#define TR_RETA123 "RETA1234LRLR"
#elif defined(PCBTARANIS) || defined(REVX)
#define TR_RETA123 "RETA123LR"
@ -497,7 +497,7 @@
#elif defined(PCBFLAMENCO)
#define TR_POTS_VSRCRAW "SD\0 ""LS\0 ""RS\0 "
#define TR_SW_VSRCRAW "SA\0 ""SB\0 ""SC\0 ""SE\0 ""SF\0 "
#elif defined(PCBTARANIS) && defined(REV9E)
#elif defined(PCBX9E)
#define TR_POTS_VSRCRAW "\310F1\0""\310F2\0""\310F3\0""\310F4\0""\311S1\0""\311S2\0""\311LS\0""\311RS\0"
#define TR_SW_VSRCRAW "\312SA\0""\312SB\0""\312SC\0""\312SD\0""\312SE\0""\312SF\0""\312SG\0""\312SH\0""\312SI\0""\312SJ\0""\312SK\0""\312SL\0""\312SM\0""\312SN\0""\312SO\0""\312SP\0""\312SQ\0""\312SR\0"
#elif defined(PCBTARANIS)

View file

@ -162,7 +162,7 @@
#define TR_RETA123 "DPGA12345LR"
#elif defined(PCBFLAMENCO)
#define TR_RETA123 "DPGA123LR"
#elif defined(PCBTARANIS) && defined(REV9E)
#elif defined(PCBX9E)
#define TR_RETA123 "DPGA1234LRLR"
#elif defined(PCBTARANIS) || defined(REVX)
#define TR_RETA123 "DPGA123LR"
@ -504,7 +504,7 @@
#elif defined(PCBFLAMENCO)
#define TR_POTS_VSRCRAW "SD\0 ""LS\0 ""RS\0 "
#define TR_SW_VSRCRAW "SA\0 ""SB\0 ""SC\0 ""SE\0 ""SF\0 "
#elif defined(PCBTARANIS) && defined(REV9E)
#elif defined(PCBX9E)
#define TR_POTS_VSRCRAW "\310F1\0""\310F2\0""\310F3\0""\310F4\0""\311S1\0""\311S2\0""\311LS\0""\311RS\0"
#define TR_SW_VSRCRAW "\312SA\0""\312SB\0""\312SC\0""\312SD\0""\312SE\0""\312SF\0""\312SG\0""\312SH\0""\312SI\0""\312SJ\0""\312SK\0""\312SL\0""\312SM\0""\312SN\0""\312SO\0""\312SP\0""\312SQ\0""\312SR\0"
#elif defined(PCBTARANIS)

View file

@ -162,7 +162,7 @@
#define TR_RETA123 "DEMA12345LR"
#elif defined(PCBFLAMENCO)
#define TR_RETA123 "DEMA123LR"
#elif defined(PCBTARANIS) && defined(REV9E)
#elif defined(PCBX9E)
#define TR_RETA123 "DEMA123SDSD"
#elif defined(PCBTARANIS) || defined(REVX)
#define TR_RETA123 "DEMA123SD"
@ -504,7 +504,7 @@
#elif defined(PCBFLAMENCO)
#define TR_POTS_VSRCRAW "SD\0 ""LS\0 ""RS\0 "
#define TR_SW_VSRCRAW "SA\0 ""SB\0 ""SC\0 ""SE\0 ""SF\0 "
#elif defined(PCBTARANIS) && defined(REV9E)
#elif defined(PCBX9E)
#define TR_POTS_VSRCRAW "\310F1\0""\310F2\0""\310F3\0""\310F4\0""\311S1\0""\311S2\0""\311LS\0""\311RS\0"
#define TR_SW_VSRCRAW "\312SA\0""\312SB\0""\312SC\0""\312SD\0""\312SE\0""\312SF\0""\312SG\0""\312SH\0""\312SI\0""\312SJ\0""\312SK\0""\312SL\0""\312SM\0""\312SN\0""\312SO\0""\312SP\0""\312SQ\0""\312SR\0"
#elif defined(PCBTARANIS)

View file

@ -163,7 +163,7 @@
#define TR_RETA123 "RETA12345LR"
#elif defined(PCBFLAMENCO)
#define TR_RETA123 "RETA123LR"
#elif defined(PCBTARANIS) && defined(REV9E)
#elif defined(PCBX9E)
#define TR_RETA123 "RETA1234LRLR"
#elif defined(PCBTARANIS) || defined(REVX)
#define TR_RETA123 "RETA123LR"
@ -505,7 +505,7 @@
#elif defined(PCBFLAMENCO)
#define TR_POTS_VSRCRAW "SD\0 ""LS\0 ""RS\0 "
#define TR_SW_VSRCRAW "SA\0 ""SB\0 ""SC\0 ""SE\0 ""SF\0 "
#elif defined(PCBTARANIS) && defined(REV9E)
#elif defined(PCBX9E)
#define TR_POTS_VSRCRAW "\310F1\0""\310F2\0""\310F3\0""\310F4\0""\311S1\0""\311S2\0""\311LS\0""\311RS\0"
#define TR_SW_VSRCRAW "\312SA\0""\312SB\0""\312SC\0""\312SD\0""\312SE\0""\312SF\0""\312SG\0""\312SH\0""\312SI\0""\312SJ\0""\312SK\0""\312SL\0""\312SM\0""\312SN\0""\312SO\0""\312SP\0""\312SQ\0""\312SR\0"
#elif defined(PCBTARANIS)

View file

@ -164,7 +164,7 @@
#define TR_RETA123 "KWGL12345LR"
#elif defined(PCBFLAMENCO)
#define TR_RETA123 "KWGL123LR"
#elif defined(PCBTARANIS) && defined(REV9E)
#elif defined(PCBX9E)
#define TR_RETA123 "KWGL1234LRLR"
#elif defined(PCBTARANIS) || defined(REVX)
#define TR_RETA123 "KWGL123LR"
@ -506,7 +506,7 @@
#elif defined(PCBFLAMENCO)
#define TR_POTS_VSRCRAW "SD\0 ""LS\0 ""RS\0 "
#define TR_SW_VSRCRAW "SA\0 ""SB\0 ""SC\0 ""SE\0 ""SF\0 "
#elif defined(PCBTARANIS) && defined(REV9E)
#elif defined(PCBX9E)
#define TR_POTS_VSRCRAW "\310S1\0""\310S2\0""\310S3\0""\310S4\0""\311LS\0""\311RS\0""\311LS2""\311RS2"
#define TR_SW_VSRCRAW "\312SA\0""\312SB\0""\312SC\0""\312SD\0""\312SE\0""\312SF\0""\312SG\0""\312SH\0""\312SI\0""\312SJ\0""\312SK\0""\312SL\0""\312SM\0""\312SN\0""\312SO\0""\312SP\0""\312SQ\0""\312SR\0"
#elif defined(PCBTARANIS)

View file

@ -492,7 +492,7 @@
#elif defined(PCBFLAMENCO)
#define TR_POTS_VSRCRAW "SD\0 ""LS\0 ""RS\0 "
#define TR_SW_VSRCRAW "SA\0 ""SB\0 ""SC\0 ""SE\0 ""SF\0 "
#elif defined(PCBTARANIS) && defined(REV9E)
#elif defined(PCBX9E)
#define TR_POTS_VSRCRAW "\310F1\0""\310F2\0""\310F3\0""\310F4\0""\311S1\0""\311S2\0""\311LS\0""\311RS\0"
#define TR_SW_VSRCRAW "\312SA\0""\312SB\0""\312SC\0""\312SD\0""\312SE\0""\312SF\0""\312SG\0""\312SH\0""\312SI\0""\312SJ\0""\312SK\0""\312SL\0""\312SM\0""\312SN\0""\312SO\0""\312SP\0""\312SQ\0""\312SR\0"
#elif defined(PCBTARANIS)

View file

@ -160,7 +160,7 @@
#if defined(PCBFLAMENCO)
#define TR_RETA123 "RHGS123HV"
#elif defined(PCBTARANIS) && defined(REV9E)
#elif defined(PCBX9E)
#define TR_RETA123 "RHGS1234HVHV"
#elif defined(PCBTARANIS) || defined(REVX)
#define TR_RETA123 "RHGS123HV"
@ -511,7 +511,7 @@
#elif defined(PCBFLAMENCO)
#define TR_POTS_VSRCRAW "SD\0 ""LS\0 ""RS\0 "
#define TR_SW_VSRCRAW "SA\0 ""SB\0 ""SC\0 ""SE\0 ""SF\0 "
#elif defined(PCBTARANIS) && defined(REV9E)
#elif defined(PCBX9E)
#define TR_POTS_VSRCRAW "\310F1\0""\310F2\0""\310F3\0""\310F4\0""\311S1\0""\311S2\0""\311LS\0""\311RS\0"
#define TR_SW_VSRCRAW "\312SA\0""\312SB\0""\312SC\0""\312SD\0""\312SE\0""\312SF\0""\312SG\0""\312SH\0""\312SI\0""\312SJ\0""\312SK\0""\312SL\0""\312SM\0""\312SN\0""\312SO\0""\312SP\0""\312SQ\0""\312SR\0"
#elif defined(PCBTARANIS)