[Taranis] REV3 board support removed
This commit is contained in:
@@ -798,10 +798,6 @@ ifeq ($(PCB), TARANIS)
|
||||
CPPDEFS += -DLCD_DUAL_BUFFER
|
||||
endif
|
||||
HAPTIC = YES
|
||||
else ifeq ($(PCBREV), REV3)
|
||||
MCU = cortex-m3
|
||||
FLAVOUR = taranis
|
||||
CPPDEFS = -DREV3
|
||||
else ifeq ($(PCBREV), REV4a)
|
||||
MCU = cortex-m3
|
||||
FLAVOUR = taranis
|
||||
|
||||
@@ -130,9 +130,7 @@ else
|
||||
EXTRAINCDIRS += ../fonts/std
|
||||
EXTRAINCDIRS += ../
|
||||
|
||||
ifeq ($(PCBREV), REV3)
|
||||
CPPDEFS += -DREV3
|
||||
else ifeq ($(PCBREV), REV4a)
|
||||
ifeq ($(PCBREV), REV4a)
|
||||
CPPDEFS += -DREV4a
|
||||
else ifeq ($(PCBREV), REVPLUS)
|
||||
CPPDEFS += -DREVPLUS
|
||||
|
||||
@@ -46,11 +46,7 @@
|
||||
#define STICK_RV 0
|
||||
#define STICK_RH 1
|
||||
#define POT_L 6
|
||||
#if defined(REV3)
|
||||
#define POT_R 7
|
||||
#else
|
||||
#define POT_R 8
|
||||
#endif
|
||||
#define POT_R 8
|
||||
#define POT_XTRA 9
|
||||
#define SLIDE_L 14
|
||||
#define SLIDE_R 15
|
||||
@@ -73,7 +69,7 @@ uint16_t Analog_values[NUMBER_ANALOG];
|
||||
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};
|
||||
#elif !defined(REV3)
|
||||
#else
|
||||
const int8_t ana_direction[NUMBER_ANALOG] = {1,-1,1,-1, -1,1,0, -1,1, 1};
|
||||
#endif
|
||||
|
||||
@@ -101,19 +97,14 @@ void adcInit()
|
||||
RCC->AHB1ENR |= RCC_AHB1Periph_GPIOADC; // Enable ports A&C clocks
|
||||
RCC->AHB1ENR |= RCC_AHB1ENR_DMA2EN; // Enable DMA2 clock
|
||||
|
||||
#if defined(REV3)
|
||||
configure_pins(PIN_STK_J1 | PIN_STK_J2 | PIN_STK_J3 | PIN_STK_J4 |
|
||||
PIN_FLP_J1 | PIN_FLP_J2, PIN_ANALOG | PIN_PORTA);
|
||||
#else
|
||||
configure_pins(PIN_STK_J1 | PIN_STK_J2 | PIN_STK_J3 | PIN_STK_J4 |
|
||||
PIN_FLP_J1, PIN_ANALOG | PIN_PORTA);
|
||||
#endif
|
||||
|
||||
#if defined(REV9E)
|
||||
configure_pins(PIN_FLP_J2 | PIN_FLP_J6, PIN_ANALOG|PIN_PORTB);
|
||||
#elif defined(REVPLUS)
|
||||
configure_pins(PIN_FLP_J2 | PIN_FLP_J3, PIN_ANALOG|PIN_PORTB);
|
||||
#elif !defined(REV3)
|
||||
#else
|
||||
configure_pins(PIN_FLP_J2, PIN_ANALOG|PIN_PORTB);
|
||||
#endif
|
||||
|
||||
@@ -189,7 +180,6 @@ void adcRead()
|
||||
DMA2_Stream0->CR &= ~DMA_SxCR_EN ; // Disable DMA
|
||||
#endif
|
||||
|
||||
#if !defined(REV3)
|
||||
// adc direction correct
|
||||
for (uint32_t i=0; i<NUMBER_ANALOG; i++) {
|
||||
if (ana_direction[i] < 0) {
|
||||
@@ -201,7 +191,6 @@ void adcRead()
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// TODO
|
||||
|
||||
@@ -227,11 +227,7 @@ void adcInit(void);
|
||||
void adcRead(void);
|
||||
inline uint16_t getAnalogValue(uint32_t value);
|
||||
|
||||
#if defined(REV3)
|
||||
#define BATT_SCALE 120
|
||||
#else
|
||||
#define BATT_SCALE 150
|
||||
#endif
|
||||
#define BATT_SCALE 150
|
||||
|
||||
#if defined(__cplusplus) && !defined(SIMU)
|
||||
extern "C" {
|
||||
|
||||
@@ -43,17 +43,10 @@
|
||||
#define PIN_TRIM_RH_L GPIO_Pin_1 // PC.01
|
||||
#define GPIO_TRIM_RH_R GPIOC->IDR
|
||||
#define PIN_TRIM_RH_R GPIO_Pin_13 // PC.13
|
||||
#if defined(REV3)
|
||||
#define GPIO_TRIM_LH_L GPIOE->IDR
|
||||
#define PIN_TRIM_LH_L GPIO_Pin_3 // PE.03
|
||||
#define GPIO_TRIM_LH_R GPIOE->IDR
|
||||
#define PIN_TRIM_LH_R GPIO_Pin_4 // PE.04
|
||||
#else
|
||||
#define GPIO_TRIM_LH_L GPIOE->IDR
|
||||
#define PIN_TRIM_LH_L GPIO_Pin_4 // PE.04
|
||||
#define GPIO_TRIM_LH_R GPIOE->IDR
|
||||
#define PIN_TRIM_LH_R GPIO_Pin_3 // PE.03
|
||||
#endif
|
||||
#define GPIO_TRIM_LH_L GPIOE->IDR
|
||||
#define PIN_TRIM_LH_L GPIO_Pin_4 // PE.04
|
||||
#define GPIO_TRIM_LH_R GPIOE->IDR
|
||||
#define PIN_TRIM_LH_R GPIO_Pin_3 // PE.03
|
||||
#if defined(REV9E)
|
||||
#define GPIO_TRIM_LV_DN GPIOG->IDR
|
||||
#define PIN_TRIM_LV_DN GPIO_Pin_1 // PG.01
|
||||
@@ -66,49 +59,23 @@
|
||||
#define PIN_TRIM_LV_UP GPIO_Pin_5 // PE.05
|
||||
#endif
|
||||
|
||||
// Switchs
|
||||
#if defined(REV3)
|
||||
#define GPIO_PIN_SW_A_H (~GPIOB->IDR)
|
||||
#define PIN_SW_A_H GPIO_Pin_7 // PB.07
|
||||
#define GPIO_PIN_SW_A_L (~GPIOE->IDR)
|
||||
#define PIN_SW_A_L GPIO_Pin_2 // PE.02
|
||||
#else
|
||||
#define GPIO_PIN_SW_A_H GPIOB->IDR
|
||||
#define PIN_SW_A_H GPIO_Pin_5 // PB.05
|
||||
#define GPIO_PIN_SW_A_L GPIOE->IDR
|
||||
#define PIN_SW_A_L GPIO_Pin_0 // PE.00
|
||||
#endif
|
||||
// Switches
|
||||
#define GPIO_PIN_SW_A_H GPIOB->IDR
|
||||
#define PIN_SW_A_H GPIO_Pin_5 // PB.05
|
||||
#define GPIO_PIN_SW_A_L GPIOE->IDR
|
||||
#define PIN_SW_A_L GPIO_Pin_0 // PE.00
|
||||
|
||||
#if defined(REV3)
|
||||
#define GPIO_PIN_SW_B_L GPIOB->IDR
|
||||
#define PIN_SW_B_L GPIO_Pin_5 // PB.05
|
||||
#define GPIO_PIN_SW_B_H GPIOB->IDR
|
||||
#define PIN_SW_B_H GPIO_Pin_6 // PB.06
|
||||
#else
|
||||
#define GPIO_PIN_SW_B_H GPIOE->IDR
|
||||
#define PIN_SW_B_H GPIO_Pin_1 // PE.01
|
||||
#define GPIO_PIN_SW_B_L GPIOE->IDR
|
||||
#define PIN_SW_B_L GPIO_Pin_2 // PE.02
|
||||
#endif
|
||||
#define GPIO_PIN_SW_B_H GPIOE->IDR
|
||||
#define PIN_SW_B_H GPIO_Pin_1 // PE.01
|
||||
#define GPIO_PIN_SW_B_L GPIOE->IDR
|
||||
#define PIN_SW_B_L GPIO_Pin_2 // PE.02
|
||||
|
||||
#if defined(REV3)
|
||||
#define GPIO_PIN_SW_C_H (~GPIOB->IDR)
|
||||
#define PIN_SW_C_H GPIO_Pin_1 // PB.01
|
||||
#define GPIO_PIN_SW_C_L (~GPIOE->IDR)
|
||||
#define PIN_SW_C_L GPIO_Pin_7 // PE.07
|
||||
#else
|
||||
#define GPIO_PIN_SW_C_H GPIOE->IDR
|
||||
#define PIN_SW_C_H GPIO_Pin_15 // PE.15
|
||||
#define GPIO_PIN_SW_C_L GPIOA->IDR
|
||||
#define PIN_SW_C_L GPIO_Pin_5 // PA.05
|
||||
#endif
|
||||
#define GPIO_PIN_SW_C_H GPIOE->IDR
|
||||
#define PIN_SW_C_H GPIO_Pin_15 // PE.15
|
||||
#define GPIO_PIN_SW_C_L GPIOA->IDR
|
||||
#define PIN_SW_C_L GPIO_Pin_5 // PA.05
|
||||
|
||||
#if defined(REV3)
|
||||
#define GPIO_PIN_SW_D_H (~GPIOE->IDR)
|
||||
#define PIN_SW_D_H GPIO_Pin_9 // PE.09
|
||||
#define GPIO_PIN_SW_D_L (~GPIOE->IDR)
|
||||
#define PIN_SW_D_L GPIO_Pin_8 // PE.08
|
||||
#elif defined(REVPLUS)
|
||||
#if defined(REVPLUS)
|
||||
#define GPIO_PIN_SW_D_H (GPIOE->IDR)
|
||||
#define PIN_SW_D_H GPIO_Pin_7 // PE.07
|
||||
#define GPIO_PIN_SW_D_L (GPIOE->IDR)
|
||||
@@ -130,25 +97,15 @@
|
||||
#define PIN_SW_F_L GPIO_Pin_15 // PF.15
|
||||
#define GPIO_PIN_SW_F_H GPIOE->IDR
|
||||
#define PIN_SW_F_H GPIO_Pin_14 // PE.14
|
||||
#elif defined(REV3)
|
||||
#define GPIO_PIN_SW_F (~GPIOE->IDR)
|
||||
#define PIN_SW_F GPIO_Pin_14 // PE.14
|
||||
#else
|
||||
#define GPIO_PIN_SW_F GPIOE->IDR
|
||||
#define PIN_SW_F GPIO_Pin_14 // PE.14
|
||||
#endif
|
||||
|
||||
#if defined(REV3)
|
||||
#define GPIO_PIN_SW_G_H (~GPIOA->IDR)
|
||||
#define PIN_SW_G_H GPIO_Pin_5 // PA.05
|
||||
#define GPIO_PIN_SW_G_L (~GPIOB->IDR)
|
||||
#define PIN_SW_G_L GPIO_Pin_0 // PB.00
|
||||
#else
|
||||
#define GPIO_PIN_SW_G_H GPIOE->IDR
|
||||
#define PIN_SW_G_H GPIO_Pin_9 // PE.09
|
||||
#define GPIO_PIN_SW_G_L GPIOE->IDR
|
||||
#define PIN_SW_G_L GPIO_Pin_8 // PE.08
|
||||
#endif
|
||||
#define GPIO_PIN_SW_G_H GPIOE->IDR
|
||||
#define PIN_SW_G_H GPIO_Pin_9 // PE.09
|
||||
#define GPIO_PIN_SW_G_L GPIOE->IDR
|
||||
#define PIN_SW_G_L GPIO_Pin_8 // PE.08
|
||||
|
||||
#if defined(REV9E)
|
||||
#define GPIO_PIN_SW_H_H GPIOD->IDR
|
||||
@@ -158,9 +115,6 @@
|
||||
#elif defined(REVPLUS)
|
||||
#define GPIO_PIN_SW_H GPIOD->IDR
|
||||
#define PIN_SW_H GPIO_Pin_14 // PD.14
|
||||
#elif defined(REV3)
|
||||
#define GPIO_PIN_SW_H (~GPIOE->IDR)
|
||||
#define PIN_SW_H GPIO_Pin_13 // PE.13
|
||||
#else
|
||||
#define GPIO_PIN_SW_H GPIOE->IDR
|
||||
#define PIN_SW_H GPIO_Pin_13 // PE.13
|
||||
@@ -217,11 +171,7 @@
|
||||
#define PIN_SLD_J1 GPIO_Pin_4 // PC.04
|
||||
#define PIN_SLD_J2 GPIO_Pin_5 // PC.05
|
||||
#define PIN_FLP_J1 GPIO_Pin_6 // PA.06
|
||||
#if defined(REV3)
|
||||
#define PIN_FLP_J2 GPIO_Pin_7 // PA.07
|
||||
#else
|
||||
#define PIN_FLP_J2 GPIO_Pin_0 // PB.00
|
||||
#endif
|
||||
#define PIN_FLP_J2 GPIO_Pin_0 // PB.00
|
||||
#if defined(REV9E)
|
||||
#define PIN_FLP_J3 GPIO_Pin_10 // PF.10
|
||||
#define PIN_FLP_J4 GPIO_Pin_9 // PF.09
|
||||
@@ -231,11 +181,7 @@
|
||||
#define PIN_FLP_J3 GPIO_Pin_1 // PB.01
|
||||
#endif
|
||||
#define PIN_MVOLT GPIO_Pin_0 // PC.00
|
||||
#if defined(REV3)
|
||||
#define RCC_AHB1Periph_GPIOADC RCC_AHB1Periph_GPIOA | RCC_AHB1Periph_GPIOC
|
||||
#else
|
||||
#define RCC_AHB1Periph_GPIOADC RCC_AHB1Periph_GPIOA | RCC_AHB1Periph_GPIOB | RCC_AHB1Periph_GPIOC
|
||||
#endif
|
||||
#define RCC_AHB1Periph_GPIOADC RCC_AHB1Periph_GPIOA | RCC_AHB1Periph_GPIOB | RCC_AHB1Periph_GPIOC
|
||||
|
||||
// DAC
|
||||
#define PIN_AUDIO_DAC GPIO_Pin_4 // PA.04
|
||||
@@ -399,14 +345,6 @@
|
||||
//#define CODEC_I2S_MODE GPIO_Pin_ // Connect to GND=I2S_STANDARD
|
||||
|
||||
// Eeprom 5137
|
||||
#if defined(REV3)
|
||||
#define I2C_EE_GPIO GPIOE
|
||||
#define I2C_EE_WP_GPIO GPIOB
|
||||
#define I2C_EE_GPIO_CLK RCC_AHB1Periph_GPIOB | RCC_AHB1Periph_GPIOE
|
||||
#define I2C_EE_SCL GPIO_Pin_1 // PE1
|
||||
#define I2C_EE_SDA GPIO_Pin_0 // PE0
|
||||
#define I2C_EE_WP GPIO_Pin_9 // PB9
|
||||
#else
|
||||
#define RCC_APBPeriph_I2C_EE RCC_APB1Periph_I2C1
|
||||
#define I2C_EE I2C1
|
||||
#define GPIO_AF_I2C_EE GPIO_AF_I2C1
|
||||
@@ -418,7 +356,6 @@
|
||||
#define I2C_EE_SCL GPIO_Pin_6 // PB6
|
||||
#define I2C_EE_SDA GPIO_Pin_7 // PB7
|
||||
#define I2C_EE_WP GPIO_Pin_9 // PB9
|
||||
#endif
|
||||
|
||||
// SD - SPI2
|
||||
#define RCC_AHB1Periph_SD_PRESENT RCC_AHB1Periph_GPIOD
|
||||
|
||||
@@ -180,7 +180,6 @@ void readKeysAndTrims()
|
||||
xxx = (~GPIO_PIN_SW_ ## x ## _H & PIN_SW_ ## x ## _H) && (GPIO_PIN_SW_ ## x ## _L & PIN_SW_ ## x ## _L); \
|
||||
break
|
||||
#define ADD_3POS_INVERTED_CASE(x, i) ADD_3POS_CASE(x, i)
|
||||
#define ADD_XTRA_2POS_CASE(...)
|
||||
#else
|
||||
#define ADD_2POS_CASE(x) \
|
||||
case SW_S ## x ## 0: \
|
||||
@@ -221,34 +220,6 @@ void readKeysAndTrims()
|
||||
xxx = xxx && (~GPIO_PIN_SW_ ## x ## _L & PIN_SW_ ## x ## _L); \
|
||||
} \
|
||||
break
|
||||
#define ADD_XTRA_2POS_CASE(x, y) \
|
||||
case SW_S ## y ## 0: \
|
||||
xxx = GPIO_PIN_SW_ ## x ## _L & PIN_SW_ ## x ## _L; \
|
||||
break; \
|
||||
case SW_S ## y ## 2: \
|
||||
xxx = ~GPIO_PIN_SW_ ## x ## _L & PIN_SW_ ## x ## _L; \
|
||||
break
|
||||
#endif
|
||||
|
||||
#if defined(REV3)
|
||||
#define ADD_3POS_INVERTED_REV3_CASE(x, i) \
|
||||
case SW_S ## x ## 0: \
|
||||
xxx = (GPIO_PIN_SW_ ## x ## _H & PIN_SW_ ## x ## _H); \
|
||||
if (IS_3POS(i)) { \
|
||||
xxx = xxx && (~GPIO_PIN_SW_ ## x ## _L & PIN_SW_ ## x ## _L); \
|
||||
} \
|
||||
break; \
|
||||
case SW_S ## x ## 1: \
|
||||
xxx = (~GPIO_PIN_SW_ ## x ## _H & PIN_SW_ ## x ## _H) && (~GPIO_PIN_SW_ ## x ## _L & PIN_SW_ ## x ## _L); \
|
||||
break; \
|
||||
case SW_S ## x ## 2: \
|
||||
xxx = (~GPIO_PIN_SW_ ## x ## _H & PIN_SW_ ## x ## _H); \
|
||||
if (IS_3POS(i)) { \
|
||||
xxx = xxx && (GPIO_PIN_SW_ ## x ## _L & PIN_SW_ ## x ## _L); \
|
||||
} \
|
||||
break
|
||||
#else
|
||||
#define ADD_3POS_INVERTED_REV3_CASE(x, i) ADD_3POS_CASE(x, i)
|
||||
#endif
|
||||
|
||||
bool switchState(EnumKeys enuk)
|
||||
@@ -258,30 +229,17 @@ bool switchState(EnumKeys enuk)
|
||||
if (enuk < (int) DIM(keys)) return keys[enuk].state() ? 1 : 0;
|
||||
|
||||
switch ((uint8_t) enuk) {
|
||||
ADD_3POS_INVERTED_REV3_CASE(A, 0);
|
||||
ADD_XTRA_2POS_CASE(A, I);
|
||||
|
||||
ADD_3POS_CASE(A, 0);
|
||||
ADD_3POS_CASE(B, 1);
|
||||
ADD_XTRA_2POS_CASE(B, J);
|
||||
|
||||
ADD_3POS_INVERTED_REV3_CASE(C, 2);
|
||||
ADD_XTRA_2POS_CASE(C, K);
|
||||
|
||||
ADD_3POS_INVERTED_REV3_CASE(D, 3);
|
||||
ADD_XTRA_2POS_CASE(D, L);
|
||||
|
||||
ADD_3POS_CASE(C, 2);
|
||||
ADD_3POS_CASE(D, 3);
|
||||
ADD_3POS_INVERTED_CASE(E, 4);
|
||||
ADD_XTRA_2POS_CASE(E, M);
|
||||
|
||||
#if defined(REV9E)
|
||||
ADD_3POS_CASE(F, 5);
|
||||
#else
|
||||
ADD_2POS_CASE(F);
|
||||
#endif
|
||||
|
||||
ADD_3POS_INVERTED_REV3_CASE(G, 6);
|
||||
ADD_XTRA_2POS_CASE(G, N);
|
||||
|
||||
ADD_3POS_CASE(G, 6);
|
||||
#if defined(REV9E)
|
||||
ADD_3POS_CASE(H, 7);
|
||||
#else
|
||||
@@ -305,6 +263,7 @@ bool switchState(EnumKeys enuk)
|
||||
break;
|
||||
}
|
||||
|
||||
// TRACE("switch %d => %d", enuk, xxx);
|
||||
return xxx;
|
||||
}
|
||||
#endif
|
||||
@@ -316,11 +275,7 @@ void keysInit()
|
||||
|
||||
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOBUTTON, ENABLE);
|
||||
|
||||
#if defined(REV3)
|
||||
GPIO_InitStructure.GPIO_Pin = PIN_BUTTON_PLUS | PIN_BUTTON_ENTER | PIN_BUTTON_MINUS | PIN_TRIM_LH_R | PIN_TRIM_LH_L
|
||||
| PIN_TRIM_LV_DN | PIN_TRIM_LV_UP
|
||||
| PIN_SW_A_L | PIN_SW_D_L | PIN_SW_F | PIN_SW_C_L | PIN_SW_D_H | PIN_SW_H;
|
||||
#elif defined(REV9E)
|
||||
#if defined(REV9E)
|
||||
GPIO_InitStructure.GPIO_Pin = PIN_TRIM_LH_R | PIN_TRIM_LH_L
|
||||
| PIN_SW_F_H | PIN_SW_A_L | PIN_SW_B_H | PIN_SW_B_L | PIN_SW_C_H | PIN_SW_D_H | PIN_SW_D_L | PIN_SW_G_H | PIN_SW_G_L | PIN_SW_L_L | PIN_SW_Q_H | PIN_SW_Q_L;
|
||||
#elif defined(REVPLUS)
|
||||
@@ -358,20 +313,14 @@ void keysInit()
|
||||
GPIO_InitStructure.GPIO_Pin = PIN_TRIM_RV_DN | PIN_TRIM_RV_UP | PIN_TRIM_RH_L | PIN_TRIM_RH_R;
|
||||
GPIO_Init(GPIOC, &GPIO_InitStructure);
|
||||
|
||||
#if defined(REV3)
|
||||
GPIO_InitStructure.GPIO_Pin = PIN_SW_B_H | PIN_SW_B_L | PIN_SW_C_H | PIN_SW_E_L | PIN_SW_E_H | PIN_SW_A_H | PIN_SW_G_L;
|
||||
#elif defined(REVPLUS)
|
||||
#if defined(REVPLUS)
|
||||
GPIO_InitStructure.GPIO_Pin = PIN_SW_E_L | PIN_SW_E_H | PIN_SW_A_H;
|
||||
#else
|
||||
GPIO_InitStructure.GPIO_Pin = PIN_SW_E_L | PIN_SW_E_H | PIN_SW_A_H | PIN_SW_D_L;
|
||||
#endif
|
||||
GPIO_Init(GPIOB, &GPIO_InitStructure);
|
||||
|
||||
#if defined(REV3)
|
||||
GPIO_InitStructure.GPIO_Pin = PIN_SW_G_H;
|
||||
#else
|
||||
GPIO_InitStructure.GPIO_Pin = PIN_SW_C_L;
|
||||
#endif
|
||||
GPIO_Init(GPIOA, &GPIO_InitStructure);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -414,9 +414,6 @@ void init_pa7_pxx()
|
||||
setupPulsesPXX(EXTERNAL_MODULE);
|
||||
|
||||
RCC->AHB1ENR |= RCC_AHB1ENR_GPIOAEN ; // Enable portA clock
|
||||
#if defined(REV3)
|
||||
configure_pins( PIN_INTPPM_OUT, PIN_PERIPHERAL | PIN_PORTA | PIN_PER_1 | PIN_OS25 | PIN_PUSHPULL ) ;
|
||||
#else
|
||||
GPIO_InitTypeDef GPIO_InitStructure;
|
||||
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIO_EXTPPM, ENABLE);
|
||||
GPIO_PinAFConfig(GPIO_EXTPPM, GPIO_PinSource_EXTPPM, GPIO_AF_TIM8);
|
||||
@@ -426,7 +423,6 @@ void init_pa7_pxx()
|
||||
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
|
||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
|
||||
GPIO_Init(GPIO_EXTPPM, &GPIO_InitStructure);
|
||||
#endif
|
||||
RCC->APB2ENR |= RCC_APB2ENR_TIM8EN ; // Enable clock
|
||||
RCC->AHB1ENR |= RCC_AHB1ENR_DMA2EN ; // Enable DMA2 clock
|
||||
|
||||
@@ -434,11 +430,7 @@ void init_pa7_pxx()
|
||||
TIM8->ARR = 18000 ; // 9mS
|
||||
TIM8->CCR2 = 15000 ; // Update time
|
||||
TIM8->PSC = (PERI2_FREQUENCY * TIMER_MULT_APB2) / 2000000 - 1 ; // 0.5uS from 30MHz
|
||||
#if defined(REV3)
|
||||
TIM8->CCER = TIM_CCER_CC1E | TIM_CCER_CC1P ;
|
||||
#else
|
||||
TIM8->CCER = TIM_CCER_CC1NE ;
|
||||
#endif
|
||||
TIM8->CR2 = TIM_CR2_OIS1 ; // O/P idle high
|
||||
TIM8->BDTR = TIM_BDTR_MOE ; // Enable outputs
|
||||
TIM8->CCR1 = pxxStream[EXTERNAL_MODULE][0] ;
|
||||
@@ -490,9 +482,6 @@ static void init_pa7_dsm2()
|
||||
setupPulsesDSM2(EXTERNAL_MODULE);
|
||||
|
||||
RCC->AHB1ENR |= RCC_AHB1ENR_GPIOAEN ; // Enable portA clock
|
||||
#if defined(REV3)
|
||||
configure_pins( PIN_INTPPM_OUT, PIN_PERIPHERAL | PIN_PORTA | PIN_PER_1 | PIN_OS25 | PIN_PUSHPULL ) ;
|
||||
#else
|
||||
GPIO_InitTypeDef GPIO_InitStructure;
|
||||
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIO_EXTPPM, ENABLE);
|
||||
GPIO_PinAFConfig(GPIO_EXTPPM, GPIO_PinSource_EXTPPM, GPIO_AF_TIM8);
|
||||
@@ -502,7 +491,6 @@ static void init_pa7_dsm2()
|
||||
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
|
||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
|
||||
GPIO_Init(GPIO_EXTPPM, &GPIO_InitStructure);
|
||||
#endif
|
||||
RCC->APB2ENR |= RCC_APB2ENR_TIM8EN ; // Enable clock
|
||||
RCC->AHB1ENR |= RCC_AHB1ENR_DMA2EN ; // Enable DMA2 clock
|
||||
|
||||
@@ -510,11 +498,7 @@ static void init_pa7_dsm2()
|
||||
TIM8->ARR = 44000 ; // 22mS
|
||||
TIM8->CCR2 = 40000 ; // Update time
|
||||
TIM8->PSC = (PERI2_FREQUENCY * TIMER_MULT_APB2) / 2000000 - 1 ; // 0.5uS from 30MHz
|
||||
#if defined(REV3)
|
||||
TIM8->CCER = TIM_CCER_CC1E | TIM_CCER_CC1P ;
|
||||
#else
|
||||
TIM8->CCER = TIM_CCER_CC1NE | TIM_CCER_CC1NP ;
|
||||
#endif
|
||||
TIM8->CR2 = TIM_CR2_OIS1 ; // O/P idle high
|
||||
TIM8->BDTR = TIM_BDTR_MOE ; // Enable outputs
|
||||
TIM8->CCR1 = dsm2Stream[0] ;
|
||||
@@ -569,11 +553,7 @@ static void init_pa7_ppm()
|
||||
ppmStreamPtr[EXTERNAL_MODULE] = ppmStream[EXTERNAL_MODULE];
|
||||
|
||||
RCC->AHB1ENR |= RCC_AHB1ENR_GPIOAEN ; // Enable portA clock
|
||||
#if defined(REV3)
|
||||
configure_pins( 0x0100, PIN_PERIPHERAL | PIN_PORTA | PIN_PER_1 | PIN_OS25 | PIN_PUSHPULL ) ;
|
||||
#else
|
||||
configure_pins( PIN_EXTPPM_OUT, PIN_PERIPHERAL | PIN_PORTA | PIN_PER_3 | PIN_OS25 | PIN_PUSHPULL ) ;
|
||||
#endif
|
||||
RCC->APB2ENR |= RCC_APB2ENR_TIM8EN ; // Enable clock
|
||||
TIM8->CR1 &= ~TIM_CR1_CEN ;
|
||||
|
||||
|
||||
@@ -74,7 +74,6 @@ void pwrInit()
|
||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
|
||||
GPIO_Init(GPIOPWRLED, &GPIO_InitStructure);
|
||||
|
||||
#if !defined(REV3)
|
||||
GPIO_ResetBits(GPIO_INT_RF_PWR, PIN_INT_RF_PWR);
|
||||
GPIO_InitStructure.GPIO_Pin = PIN_INT_RF_PWR;
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
|
||||
@@ -97,7 +96,6 @@ void pwrInit()
|
||||
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
|
||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
|
||||
GPIO_Init(GPIOTRNDET, &GPIO_InitStructure);
|
||||
#endif
|
||||
|
||||
// Soft power ON
|
||||
GPIO_SetBits(GPIOPWR, PIN_MCU_PWR);
|
||||
|
||||
Reference in New Issue
Block a user