X7D renamed to X7
This commit is contained in:
@@ -257,8 +257,8 @@ class OpenTxSimulatorFactory: public SimulatorFactory
|
||||
return BOARD_HORUS;
|
||||
#elif defined(PCBFLAMENCO)
|
||||
return BOARD_FLAMENCO;
|
||||
#elif defined(PCBX7D)
|
||||
return BOARD_X7D;
|
||||
#elif defined(PCBX7)
|
||||
return BOARD_TARANIS_X7;
|
||||
#elif defined(PCBTARANIS)
|
||||
return BOARD_TARANIS_X9D;
|
||||
#else
|
||||
|
||||
@@ -240,11 +240,11 @@ void simuSetSwitch(uint8_t swtch, int8_t state)
|
||||
SWITCH_3_CASE(1, SWITCHES_GPIO_REG_B_L, SWITCHES_GPIO_REG_B_H, SWITCHES_GPIO_PIN_B_L, SWITCHES_GPIO_PIN_B_H)
|
||||
SWITCH_3_CASE(2, SWITCHES_GPIO_REG_C_L, SWITCHES_GPIO_REG_C_H, SWITCHES_GPIO_PIN_C_L, SWITCHES_GPIO_PIN_C_H)
|
||||
SWITCH_3_CASE(3, SWITCHES_GPIO_REG_D_L, SWITCHES_GPIO_REG_D_H, SWITCHES_GPIO_PIN_D_L, SWITCHES_GPIO_PIN_D_H)
|
||||
#if !defined(PCBX7D)
|
||||
#if !defined(PCBX7)
|
||||
SWITCH_3_CASE(4, SWITCHES_GPIO_REG_E_L, SWITCHES_GPIO_REG_E_H, SWITCHES_GPIO_PIN_E_L, SWITCHES_GPIO_PIN_E_H)
|
||||
#endif
|
||||
SWITCH_CASE(5, SWITCHES_GPIO_REG_F, SWITCHES_GPIO_PIN_F)
|
||||
#if !defined(PCBX7D)
|
||||
#if !defined(PCBX7)
|
||||
SWITCH_3_CASE(6, SWITCHES_GPIO_REG_G_L, SWITCHES_GPIO_REG_G_H, SWITCHES_GPIO_PIN_G_L, SWITCHES_GPIO_PIN_G_H)
|
||||
#endif
|
||||
SWITCH_CASE(7, SWITCHES_GPIO_REG_H, SWITCHES_GPIO_PIN_H)
|
||||
|
||||
@@ -54,13 +54,13 @@ elseif(PCB STREQUAL X9D)
|
||||
set(LCD_DRIVER lcd_driver_aspi.cpp)
|
||||
set(SERIAL2_DRIVER ../common/arm/stm32/serial2_driver.cpp)
|
||||
set(GVAR_SCREEN model_gvars.cpp)
|
||||
elseif(PCB STREQUAL X7D)
|
||||
elseif(PCB STREQUAL X7)
|
||||
set(CPU_TYPE STM32F2)
|
||||
set(LINKER_SCRIPT targets/taranis/stm32f2_flash.ld)
|
||||
set(HAPTIC YES)
|
||||
set(LUA_EXPORT lua_export_x7d)
|
||||
set(FLAVOUR x7d)
|
||||
add_definitions(-DPCBX7D -DSOFTWARE_VOLUME)
|
||||
set(LUA_EXPORT lua_export_x7)
|
||||
set(FLAVOUR x7)
|
||||
add_definitions(-DPCBX7 -DSOFTWARE_VOLUME)
|
||||
add_definitions(-DEEPROM_VARIANT=0)
|
||||
set(FIRMWARE_TARGET_SRC
|
||||
${FIRMWARE_TARGET_SRC}
|
||||
@@ -93,7 +93,7 @@ set(GUI_SRC ${GUI_SRC}
|
||||
../screenshot.cpp
|
||||
)
|
||||
|
||||
if(PCB STREQUAL X7D)
|
||||
if(PCB STREQUAL X7)
|
||||
set(LED_DRIVER led_driver.cpp)
|
||||
endif()
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
const int8_t ana_direction[NUMBER_ANALOG] = {1,1,-1,-1, -1,-1,-1,1, -1,1,1,1, -1};
|
||||
#elif defined(PCBX9DP)
|
||||
const int8_t ana_direction[NUMBER_ANALOG] = {1,-1,1,-1, -1,1,-1, -1,1, 1};
|
||||
#elif defined(PCBX7D)
|
||||
#elif defined(PCBX7)
|
||||
const int8_t ana_direction[NUMBER_ANALOG] = {-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};
|
||||
@@ -79,7 +79,7 @@ void adcInit()
|
||||
#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
|
||||
#elif defined(PCBX7D)
|
||||
#elif defined(PCBX7)
|
||||
ADC1->SQR2 = (ADC_CHANNEL_BATT<<0); // 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_POT1<<25) + (ADC_CHANNEL_POT2<<20); // conversions 1 to 6
|
||||
#else
|
||||
|
||||
@@ -97,7 +97,7 @@ uint8_t isBacklightEnabled()
|
||||
{
|
||||
return (BACKLIGHT_TIMER->CCR4 != 0 || BACKLIGHT_TIMER->CCR2 != 0);
|
||||
}
|
||||
#elif defined(PCBX7D)
|
||||
#elif defined(PCBX7)
|
||||
void backlightInit()
|
||||
{
|
||||
GPIO_InitTypeDef GPIO_InitStructure;
|
||||
|
||||
@@ -123,7 +123,7 @@ void boardInit()
|
||||
pwrInit();
|
||||
#endif
|
||||
|
||||
#if defined(PCBX7D)
|
||||
#if defined(PCBX7)
|
||||
ledInit();
|
||||
ledGreen();
|
||||
#endif
|
||||
@@ -139,7 +139,7 @@ void boardInit()
|
||||
i2cInit();
|
||||
usbInit();
|
||||
|
||||
#if defined(DEBUG) && !defined(PCBX7D)
|
||||
#if defined(DEBUG) && !defined(PCBX7)
|
||||
serial2Init(0, 0); // default serial mode (None if DEBUG not defined)
|
||||
TRACE("\nTaranis board started :)");
|
||||
#endif
|
||||
@@ -148,7 +148,7 @@ void boardInit()
|
||||
hapticInit();
|
||||
#endif
|
||||
|
||||
#if defined(PCBX9E) || defined(PCBX7D)
|
||||
#if defined(PCBX9E) || defined(PCBX7)
|
||||
bluetoothInit(BLUETOOTH_DEFAULT_BAUDRATE);
|
||||
#endif
|
||||
|
||||
@@ -205,7 +205,7 @@ void boardInit()
|
||||
|
||||
void boardOff()
|
||||
{
|
||||
#if defined(PCBX7D)
|
||||
#if defined(PCBX7)
|
||||
ledOff();
|
||||
#endif
|
||||
|
||||
@@ -215,7 +215,7 @@ void boardOff()
|
||||
toplcdOff();
|
||||
#endif
|
||||
|
||||
#if defined(PCBX9E) || defined(PCBX7D)
|
||||
#if defined(PCBX9E) || defined(PCBX7)
|
||||
while (pwrPressed()) {
|
||||
wdt_reset();
|
||||
}
|
||||
|
||||
@@ -262,7 +262,7 @@ enum EnumSwitchesPositions
|
||||
SW_SD0,
|
||||
SW_SD1,
|
||||
SW_SD2,
|
||||
#if !defined(PCBX7D)
|
||||
#if !defined(PCBX7)
|
||||
SW_SE0,
|
||||
SW_SE1,
|
||||
SW_SE2,
|
||||
@@ -270,7 +270,7 @@ enum EnumSwitchesPositions
|
||||
SW_SF0,
|
||||
SW_SF1,
|
||||
SW_SF2,
|
||||
#if !defined(PCBX7D)
|
||||
#if !defined(PCBX7)
|
||||
SW_SG0,
|
||||
SW_SG1,
|
||||
SW_SG2,
|
||||
@@ -311,7 +311,7 @@ enum EnumSwitchesPositions
|
||||
SW_SR2,
|
||||
#endif
|
||||
};
|
||||
#if defined(PCBX7D)
|
||||
#if defined(PCBX7)
|
||||
#define NUM_SWITCHES 6
|
||||
#elif defined(PCBX9E)
|
||||
#define NUM_SWITCHES 18 // yes, it's a lot!
|
||||
@@ -326,7 +326,7 @@ uint32_t readTrims(void);
|
||||
#define TRIMS_PRESSED() (readTrims())
|
||||
#define KEYS_PRESSED() (readKeys())
|
||||
|
||||
#if defined(PCBX9E) || defined(PCBX7D)
|
||||
#if defined(PCBX9E) || defined(PCBX7)
|
||||
// Rotary Encoder driver
|
||||
#define ROTARY_ENCODER_NAVIGATION
|
||||
void checkRotaryEncoder(void);
|
||||
@@ -356,7 +356,7 @@ enum Analogs {
|
||||
POT_FIRST,
|
||||
POT1 = POT_FIRST,
|
||||
POT2,
|
||||
#if defined(PCBX7D)
|
||||
#if defined(PCBX7)
|
||||
POT_LAST = POT2,
|
||||
#elif defined(PCBX9E)
|
||||
POT3,
|
||||
@@ -487,7 +487,7 @@ void hapticOff(void);
|
||||
|
||||
// Second serial port driver
|
||||
#define DEBUG_BAUDRATE 115200
|
||||
#if !defined(PCBX7D)
|
||||
#if !defined(PCBX7)
|
||||
#define SERIAL2
|
||||
extern uint8_t serial2Mode;
|
||||
void serial2Init(unsigned int mode, unsigned int protocol);
|
||||
@@ -516,7 +516,7 @@ void ledGreen(void);
|
||||
void ledBlue(void);
|
||||
|
||||
// LCD driver
|
||||
#if defined(PCBX7D)
|
||||
#if defined(PCBX7)
|
||||
#define LCD_W 128
|
||||
#define LCD_H 64
|
||||
#define LCD_DEPTH 1
|
||||
@@ -538,7 +538,7 @@ void lcdInitFinish(void);
|
||||
void lcdOff(void);
|
||||
|
||||
// TODO lcdRefreshWait() stub in simpgmspace and remove LCD_DUAL_BUFFER
|
||||
#if (defined(PCBX9E) || defined(PCBX9DP) || defined(PCBX7D)) && !defined(LCD_DUAL_BUFFER) && !defined(SIMU)
|
||||
#if (defined(PCBX9E) || defined(PCBX9DP) || defined(PCBX7)) && !defined(LCD_DUAL_BUFFER) && !defined(SIMU)
|
||||
void lcdRefreshWait();
|
||||
#else
|
||||
#define lcdRefreshWait()
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include "opentx.h"
|
||||
#include "stamp.h"
|
||||
|
||||
#if defined(PCBX7D)
|
||||
#if defined(PCBX7)
|
||||
#define BOOTLOADER_TITLE " X7 Bootloader - " VERSION
|
||||
#elif defined(PCBTARANIS)
|
||||
#define BOOTLOADER_TITLE " Taranis Bootloader - " VERSION
|
||||
@@ -29,7 +29,7 @@
|
||||
#error "Not implemented"
|
||||
#endif
|
||||
|
||||
#if defined(PCBX9E) || defined(PCBX7D)
|
||||
#if defined(PCBX9E) || defined(PCBX7)
|
||||
#define BOOT_KEY_UP KEY_MINUS
|
||||
#define BOOT_KEY_DOWN KEY_PLUS
|
||||
#else
|
||||
@@ -122,7 +122,7 @@ void interrupt10ms(void)
|
||||
++index;
|
||||
}
|
||||
|
||||
#if defined(PCBX9E) || defined(PCBX7D)
|
||||
#if defined(PCBX9E) || defined(PCBX7)
|
||||
checkRotaryEncoder();
|
||||
static rotenc_t rePreviousValue;
|
||||
rotenc_t reNewValue = (rotencValue[0] / 2);
|
||||
@@ -613,7 +613,7 @@ int main()
|
||||
}
|
||||
|
||||
if (state != ST_FLASHING && state != ST_USB) {
|
||||
#if defined(PCBX9E) || defined(PCBX7D)
|
||||
#if defined(PCBX9E) || defined(PCBX7)
|
||||
if (pwrPressed()) {
|
||||
#else
|
||||
if (pwrCheck() == e_power_off) {
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#define _HAL_H_
|
||||
|
||||
// Keys
|
||||
#if defined(PCBX7D)
|
||||
#if defined(PCBX7)
|
||||
#define KEYS_GPIO_REG_PAGE GPIOD->IDR
|
||||
#define KEYS_GPIO_PIN_PAGE GPIO_Pin_3 // PD.03
|
||||
#define KEYS_GPIO_REG_MENU GPIOD->IDR
|
||||
@@ -41,7 +41,7 @@
|
||||
#if defined(PCBX9E)
|
||||
#define KEYS_GPIO_REG_ENTER GPIOF->IDR
|
||||
#define KEYS_GPIO_PIN_ENTER GPIO_Pin_0 // PF.00
|
||||
#elif defined(PCBX7D)
|
||||
#elif defined(PCBX7)
|
||||
#define KEYS_GPIO_REG_ENTER GPIOE->IDR
|
||||
#define KEYS_GPIO_PIN_ENTER GPIO_Pin_10 // PE.10
|
||||
#else
|
||||
@@ -59,7 +59,7 @@
|
||||
#define ENC_GPIO_PIN_A GPIO_Pin_12 // PD.12
|
||||
#define ENC_GPIO_PIN_B GPIO_Pin_13 // PD.13
|
||||
#define ROTARY_ENCODER_POSITION() (ENC_GPIO->IDR >> 12) & 0x03
|
||||
#elif defined(PCBX7D)
|
||||
#elif defined(PCBX7)
|
||||
#define ENC_GPIO GPIOE
|
||||
#define ENC_GPIO_PIN_A GPIO_Pin_9 // PE.09
|
||||
#define ENC_GPIO_PIN_B GPIO_Pin_11 // PE.11
|
||||
@@ -67,7 +67,7 @@
|
||||
#endif
|
||||
|
||||
// This is for SIMU: reuse rotary encoder pins to map UP and DOWN keyboard keys
|
||||
#if defined(SIMU) && (defined(PCBX9E) || defined(PCBX7D))
|
||||
#if defined(SIMU) && (defined(PCBX9E) || defined(PCBX7))
|
||||
#define KEYS_GPIO_REG_PLUS ENC_GPIO->IDR
|
||||
#define KEYS_GPIO_PIN_PLUS ENC_GPIO_PIN_A
|
||||
#define KEYS_GPIO_REG_MINUS ENC_GPIO->IDR
|
||||
@@ -92,7 +92,7 @@
|
||||
#define TRIMS_GPIO_PIN_RVU GPIO_Pin_2 // PC.02
|
||||
#define TRIMS_GPIO_REG_RHR GPIOC->IDR
|
||||
#define TRIMS_GPIO_PIN_RHR GPIO_Pin_13 // PC.13
|
||||
#elif defined(PCBX7D)
|
||||
#elif defined(PCBX7)
|
||||
#define TRIMS_GPIO_REG_LHL GPIOD->IDR
|
||||
#define TRIMS_GPIO_PIN_LHL GPIO_Pin_15 // PD.15
|
||||
#define TRIMS_GPIO_REG_LHR GPIOC->IDR
|
||||
@@ -134,7 +134,7 @@
|
||||
#define SWITCHES_GPIO_PIN_A_H GPIO_Pin_10 // PD.10
|
||||
#define SWITCHES_GPIO_REG_A_L GPIOD->IDR
|
||||
#define SWITCHES_GPIO_PIN_A_L GPIO_Pin_14 // PD.14
|
||||
#elif defined(PCBX7D)
|
||||
#elif defined(PCBX7)
|
||||
#define SWITCHES_GPIO_REG_A_L GPIOE->IDR
|
||||
#define SWITCHES_GPIO_PIN_A_L GPIO_Pin_7 // PE.07
|
||||
#define SWITCHES_GPIO_REG_A_H GPIOE->IDR
|
||||
@@ -151,7 +151,7 @@
|
||||
#define SWITCHES_GPIO_PIN_B_H GPIO_Pin_11 // PG.11
|
||||
#define SWITCHES_GPIO_REG_B_L GPIOG->IDR
|
||||
#define SWITCHES_GPIO_PIN_B_L GPIO_Pin_10 // PG.10
|
||||
#elif defined(PCBX7D)
|
||||
#elif defined(PCBX7)
|
||||
#define SWITCHES_GPIO_REG_B_L GPIOE->IDR
|
||||
#define SWITCHES_GPIO_PIN_B_L GPIO_Pin_15 // PE.15
|
||||
#define SWITCHES_GPIO_REG_B_H GPIOA->IDR
|
||||
@@ -168,7 +168,7 @@
|
||||
#define SWITCHES_GPIO_PIN_C_H GPIO_Pin_13 // PF.13
|
||||
#define SWITCHES_GPIO_REG_C_L GPIOF->IDR
|
||||
#define SWITCHES_GPIO_PIN_C_L GPIO_Pin_14 // PF.14
|
||||
#elif defined(PCBX7D)
|
||||
#elif defined(PCBX7)
|
||||
#define SWITCHES_GPIO_REG_C_L GPIOD->IDR
|
||||
#define SWITCHES_GPIO_PIN_C_L GPIO_Pin_11 // PD.11
|
||||
#define SWITCHES_GPIO_REG_C_H GPIOE->IDR
|
||||
@@ -190,7 +190,7 @@
|
||||
#define SWITCHES_GPIO_PIN_D_H GPIO_Pin_7 // PE.07
|
||||
#define SWITCHES_GPIO_REG_D_L GPIOE->IDR
|
||||
#define SWITCHES_GPIO_PIN_D_L GPIO_Pin_13 // PE.13
|
||||
#elif defined(PCBX7D)
|
||||
#elif defined(PCBX7)
|
||||
#define SWITCHES_GPIO_REG_D_L GPIOE->IDR
|
||||
#define SWITCHES_GPIO_PIN_D_L GPIO_Pin_1 // PE.01
|
||||
#define SWITCHES_GPIO_REG_D_H GPIOE->IDR
|
||||
@@ -207,7 +207,7 @@
|
||||
#define SWITCHES_GPIO_PIN_E_H GPIO_Pin_7 // PE.07
|
||||
#define SWITCHES_GPIO_REG_E_L GPIOE->IDR
|
||||
#define SWITCHES_GPIO_PIN_E_L GPIO_Pin_13 // PE.13
|
||||
#elif !defined(PCBX7D)
|
||||
#elif !defined(PCBX7)
|
||||
#define SWITCHES_GPIO_REG_E_H GPIOB->IDR
|
||||
#define SWITCHES_GPIO_PIN_E_H GPIO_Pin_3 // PB.03
|
||||
#define SWITCHES_GPIO_REG_E_L GPIOB->IDR
|
||||
@@ -217,7 +217,7 @@
|
||||
#if defined(PCBX9E)
|
||||
#define SWITCHES_GPIO_REG_F GPIOE->IDR
|
||||
#define SWITCHES_GPIO_PIN_F GPIO_Pin_11 // PE.11
|
||||
#elif defined(PCBX7D)
|
||||
#elif defined(PCBX7)
|
||||
#define SWITCHES_GPIO_REG_F GPIOE->IDR
|
||||
#define SWITCHES_GPIO_PIN_F GPIO_Pin_14 // PE.14
|
||||
#else
|
||||
@@ -230,7 +230,7 @@
|
||||
#define SWITCHES_GPIO_PIN_G_H GPIO_Pin_3 // PF.03
|
||||
#define SWITCHES_GPIO_REG_G_L GPIOF->IDR
|
||||
#define SWITCHES_GPIO_PIN_G_L GPIO_Pin_4 // PF.04
|
||||
#elif !defined(PCBX7D)
|
||||
#elif !defined(PCBX7)
|
||||
#define SWITCHES_GPIO_REG_G_H GPIOE->IDR
|
||||
#define SWITCHES_GPIO_PIN_G_H GPIO_Pin_9 // PE.09
|
||||
#define SWITCHES_GPIO_REG_G_L GPIOE->IDR
|
||||
@@ -243,7 +243,7 @@
|
||||
#elif defined(PCBX9DP)
|
||||
#define SWITCHES_GPIO_REG_H GPIOD->IDR
|
||||
#define SWITCHES_GPIO_PIN_H GPIO_Pin_14 // PD.14
|
||||
#elif defined(PCBX7D)
|
||||
#elif defined(PCBX7)
|
||||
#define SWITCHES_GPIO_REG_H GPIOD->IDR
|
||||
#define SWITCHES_GPIO_PIN_H GPIO_Pin_14 // PD.14
|
||||
#else
|
||||
@@ -310,7 +310,7 @@
|
||||
#define KEYS_GPIOC_PINS (TRIMS_GPIO_PIN_RVD | TRIMS_GPIO_PIN_RVU | TRIMS_GPIO_PIN_RHL | TRIMS_GPIO_PIN_RHR)
|
||||
#define KEYS_GPIOD_PINS (KEYS_GPIO_PIN_MENU | KEYS_GPIO_PIN_EXIT | KEYS_GPIO_PIN_PAGE | SWITCHES_GPIO_PIN_H)
|
||||
#define KEYS_GPIOE_PINS (KEYS_GPIO_PIN_PLUS | KEYS_GPIO_PIN_ENTER | KEYS_GPIO_PIN_MINUS | TRIMS_GPIO_PIN_LHR | TRIMS_GPIO_PIN_LHL | TRIMS_GPIO_PIN_LVD | TRIMS_GPIO_PIN_LVU | SWITCHES_GPIO_PIN_F | SWITCHES_GPIO_PIN_A_L | SWITCHES_GPIO_PIN_B_H | SWITCHES_GPIO_PIN_B_L | SWITCHES_GPIO_PIN_C_H | SWITCHES_GPIO_PIN_D_H | SWITCHES_GPIO_PIN_D_L | SWITCHES_GPIO_PIN_G_H | SWITCHES_GPIO_PIN_G_L)
|
||||
#elif defined(PCBX7D)
|
||||
#elif defined(PCBX7)
|
||||
#define KEYS_RCC_AHB1Periph (RCC_AHB1Periph_GPIOB|RCC_AHB1Periph_GPIOC|RCC_AHB1Periph_GPIOD|RCC_AHB1Periph_GPIOE)
|
||||
#define KEYS_GPIOA_PINS SWITCHES_GPIO_PIN_B_H
|
||||
#define KEYS_GPIOC_PINS (TRIMS_GPIO_PIN_LHR | TRIMS_GPIO_PIN_RVD | TRIMS_GPIO_PIN_RVU)
|
||||
@@ -335,7 +335,7 @@
|
||||
#endif
|
||||
#define ADC_GPIO_PIN_STICK_RV GPIO_Pin_0 // PA.00
|
||||
#define ADC_GPIO_PIN_STICK_RH GPIO_Pin_1 // PA.01
|
||||
#if defined(PCBX7D)
|
||||
#if defined(PCBX7)
|
||||
#define ADC_GPIO_PIN_STICK_LV GPIO_Pin_2 // PA.02
|
||||
#define ADC_GPIO_PIN_STICK_LH GPIO_Pin_3 // PA.03
|
||||
#define ADC_CHANNEL_STICK_LV ADC_Channel_2 // ADC1_IN2
|
||||
@@ -395,7 +395,7 @@
|
||||
#define ADC_CHANNEL_SLIDER1 ADC_Channel_14
|
||||
#define ADC_CHANNEL_SLIDER2 ADC_Channel_15
|
||||
#define ADC_CHANNEL_BATT ADC_Channel_10
|
||||
#elif defined(PCBX7D)
|
||||
#elif defined(PCBX7)
|
||||
#define ADC_GPIO_PIN_POT1 GPIO_Pin_6 // PA.06
|
||||
#define ADC_GPIO_PIN_POT2 GPIO_Pin_0 // PB.00
|
||||
#define ADC_GPIO_PIN_BATT GPIO_Pin_0 // PC.00
|
||||
@@ -424,13 +424,13 @@
|
||||
|
||||
// PWR and LED driver
|
||||
#define PWR_RCC_AHB1Periph (RCC_AHB1Periph_GPIOB | RCC_AHB1Periph_GPIOC | RCC_AHB1Periph_GPIOD)
|
||||
#if defined(PCBX9E) || defined(PCBX7D)
|
||||
#if defined(PCBX9E) || defined(PCBX7)
|
||||
#define PWR_PRESS_BUTTON
|
||||
#endif
|
||||
#define PWR_GPIO GPIOD
|
||||
#define PWR_SWITCH_GPIO_PIN GPIO_Pin_1 // PD.01
|
||||
#define PWR_ON_GPIO_PIN GPIO_Pin_0 // PD.00
|
||||
#if defined(PCBX7D)
|
||||
#if defined(PCBX7)
|
||||
#define LED_GREEN_GPIO GPIOC
|
||||
#define LED_GREEN_GPIO_PIN GPIO_Pin_4 // PC.04
|
||||
#define LED_RED_GPIO GPIOC
|
||||
@@ -442,7 +442,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(PCBX9E) || defined(PCBX9DP) || defined(PCBX7D)
|
||||
#if defined(PCBX9E) || defined(PCBX9DP) || defined(PCBX7)
|
||||
#define INTMODULE_PWR_GPIO GPIOC
|
||||
#define INTMODULE_PWR_GPIO_PIN GPIO_Pin_6 // PC.06
|
||||
#else
|
||||
@@ -506,7 +506,7 @@
|
||||
#define TRAINER_TIMER_FREQ (PERI1_FREQUENCY * TIMER_MULT_APB1)
|
||||
|
||||
// Serial Port
|
||||
#if defined(PCBX7D)
|
||||
#if defined(PCBX7)
|
||||
#define SERIAL_RCC_AHB1Periph 0
|
||||
#define SERIAL_RCC_APB1Periph 0
|
||||
#else
|
||||
@@ -596,7 +596,7 @@
|
||||
#define BACKLIGHT_GPIO_PinSource_2 GPIO_PinSource13
|
||||
#define BACKLIGHT_GPIO_AF_1 GPIO_AF_TIM4
|
||||
#define BACKLIGHT_GPIO_AF_2 GPIO_AF_TIM4
|
||||
#elif defined(PCBX7D)
|
||||
#elif defined(PCBX7)
|
||||
#define BACKLIGHT_RCC_AHB1Periph RCC_AHB1Periph_GPIOD
|
||||
#define BACKLIGHT_RCC_APB1Periph RCC_APB1Periph_TIM4
|
||||
#define BACKLIGHT_RCC_APB2Periph 0
|
||||
@@ -640,7 +640,7 @@
|
||||
#define LCD_DMA_FLAG_INT DMA_HIFCR_CTCIF7
|
||||
#define LCD_SPI SPI3
|
||||
#define LCD_GPIO_AF GPIO_AF_SPI3
|
||||
#elif defined(PCBX9DP) || defined(PCBX7D)
|
||||
#elif defined(PCBX9DP) || defined(PCBX7)
|
||||
#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_SPI_GPIO GPIOC
|
||||
@@ -735,7 +735,7 @@
|
||||
#define AUDIO_DMA DMA1
|
||||
|
||||
// Haptic
|
||||
#if defined(PCBX9E) || defined(PCBX9DP) || defined(PCBX7D)
|
||||
#if defined(PCBX9E) || defined(PCBX9DP) || defined(PCBX7)
|
||||
#define HAPTIC_RCC_AHB1Periph RCC_AHB1Periph_GPIOB
|
||||
#define HAPTIC_RCC_APB2Periph RCC_APB2Periph_TIM10
|
||||
#define HAPTIC_GPIO_PinSource GPIO_PinSource8
|
||||
@@ -778,7 +778,7 @@
|
||||
#define BT_BCTS_GPIO_PIN GPIO_Pin_6 // PG.06
|
||||
#define BT_TX_GPIO_PinSource GPIO_PinSource14
|
||||
#define BT_RX_GPIO_PinSource GPIO_PinSource9
|
||||
#elif defined(PCBX7D)
|
||||
#elif defined(PCBX7)
|
||||
#define BT_RCC_AHB1Periph (RCC_AHB1Periph_GPIOB | RCC_AHB1Periph_GPIOE | RCC_AHB1Periph_DMA1)
|
||||
#define BT_RCC_APB1Periph RCC_APB1Periph_USART3
|
||||
#define BT_EN_GPIO GPIOE
|
||||
|
||||
@@ -37,7 +37,7 @@ uint32_t readKeys()
|
||||
if (~KEYS_GPIO_REG_EXIT & KEYS_GPIO_PIN_EXIT)
|
||||
result |= 1 << KEY_EXIT;
|
||||
|
||||
#if !defined(PCBX9E) && !defined(PCBX7D)
|
||||
#if !defined(PCBX9E) && !defined(PCBX7)
|
||||
if (~KEYS_GPIO_REG_PLUS & KEYS_GPIO_PIN_PLUS)
|
||||
result |= 1 << KEY_PLUS;
|
||||
if (~KEYS_GPIO_REG_MINUS & KEYS_GPIO_PIN_MINUS)
|
||||
@@ -175,7 +175,7 @@ uint32_t switchState(uint8_t index)
|
||||
ADD_3POS_CASE(B, 1);
|
||||
ADD_3POS_CASE(C, 2);
|
||||
ADD_3POS_CASE(D, 3);
|
||||
#if defined(PCBX7D)
|
||||
#if defined(PCBX7)
|
||||
ADD_2POS_CASE(F);
|
||||
ADD_2POS_CASE(H);
|
||||
#else
|
||||
|
||||
@@ -89,7 +89,7 @@ void lcdHardwareInit()
|
||||
LCD_DMA->HIFCR = LCD_DMA_FLAGS; // Write ones to clear bits
|
||||
LDC_DMA_Stream->CR = DMA_SxCR_PL_0 | DMA_SxCR_MINC | DMA_SxCR_DIR_0;
|
||||
LDC_DMA_Stream->PAR = (uint32_t)&LCD_SPI->DR;
|
||||
#if defined(PCBX7D)
|
||||
#if defined(PCBX7)
|
||||
LDC_DMA_Stream->NDTR = LCD_W;
|
||||
#else
|
||||
LDC_DMA_Stream->M0AR = (uint32_t)displayBuf;
|
||||
@@ -100,7 +100,7 @@ void lcdHardwareInit()
|
||||
NVIC_EnableIRQ(LCD_DMA_Stream_IRQn);
|
||||
}
|
||||
|
||||
#if defined(PCBX7D)
|
||||
#if defined(PCBX7)
|
||||
void lcdStart()
|
||||
{
|
||||
lcdWriteCommand(0xe2); // (14) Soft reset
|
||||
@@ -176,7 +176,7 @@ void lcdRefresh(bool wait)
|
||||
lcdInitFinish();
|
||||
}
|
||||
|
||||
#if defined(PCBX7D)
|
||||
#if defined(PCBX7)
|
||||
uint8_t * p = displayBuf;
|
||||
for (uint8_t y=0; y < 8; y++, p+=LCD_W) {
|
||||
lcdWriteCommand(0x10); // Column addr 0
|
||||
@@ -260,7 +260,7 @@ void lcdOff()
|
||||
void lcdReset()
|
||||
{
|
||||
LCD_RST_LOW();
|
||||
#if defined(PCBX7D)
|
||||
#if defined(PCBX7)
|
||||
delay_ms(150);
|
||||
#else
|
||||
delay_ms(1); // Only 3 us needed according to data-sheet, we use 1 ms
|
||||
@@ -328,7 +328,7 @@ void lcdSetRefVolt(uint8_t val)
|
||||
lcdInitFinish();
|
||||
}
|
||||
|
||||
#if !defined(PCBX7D)
|
||||
#if !defined(PCBX7)
|
||||
WAIT_FOR_DMA_END();
|
||||
#endif
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ void pwrOff()
|
||||
while (1) {
|
||||
wdt_reset();
|
||||
#if defined(PWR_PRESS_BUTTON)
|
||||
// X9E/X7D needs watchdog reset because CPU is still running while
|
||||
// X9E/X7 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
|
||||
if (!pwrPressed()) {
|
||||
|
||||
Reference in New Issue
Block a user