Skip to content

Commit

Permalink
Merge pull request #129 from kc10kevin/Raceflight_RC8
Browse files Browse the repository at this point in the history
Revo Nano Fix?
  • Loading branch information
rs2k committed Mar 31, 2016
2 parents ea7e44e + 4f7b542 commit 2bf5f4f
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 37 deletions.
36 changes: 18 additions & 18 deletions src/main/drivers/pwm_mapping.c
Original file line number Diff line number Diff line change
Expand Up @@ -476,18 +476,18 @@ static const uint16_t airPWM[] = {

#ifdef REVONANO
static const uint16_t multiPPM[] = {
PWM6 | (MAP_TO_PPM_INPUT << 8), // PPM input
PWM7 | (MAP_TO_MOTOR_OUTPUT << 8), // Swap to servo if needed
PWM8 | (MAP_TO_MOTOR_OUTPUT << 8), // Swap to servo if needed
PWM9 | (MAP_TO_MOTOR_OUTPUT << 8),
PWM10 | (MAP_TO_MOTOR_OUTPUT << 8),
PWM1 | (MAP_TO_PPM_INPUT << 8), // PPM input
PWM7 | (MAP_TO_MOTOR_OUTPUT << 8), // Motor #1
PWM8 | (MAP_TO_MOTOR_OUTPUT << 8), // Motor #2
PWM9 | (MAP_TO_MOTOR_OUTPUT << 8), // Motor #3
PWM10 | (MAP_TO_MOTOR_OUTPUT << 8), // Motor #4
PWM11 | (MAP_TO_MOTOR_OUTPUT << 8),
PWM12 | (MAP_TO_MOTOR_OUTPUT << 8),
PWM2 | (MAP_TO_MOTOR_OUTPUT << 8),
PWM3 | (MAP_TO_MOTOR_OUTPUT << 8), // Swap to servo if needed
PWM4 | (MAP_TO_MOTOR_OUTPUT << 8), // Swap to servo if needed
PWM5 | (MAP_TO_MOTOR_OUTPUT << 8), // Swap to servo if needed
PWM1 | (MAP_TO_MOTOR_OUTPUT << 8), // Swap to servo if needed
PWM6 | (MAP_TO_MOTOR_OUTPUT << 8), // Swap to servo if needed
0xFFFF
};
static const uint16_t multiPWM[] = {
Expand All @@ -507,18 +507,18 @@ static const uint16_t multiPWM[] = {
};

static const uint16_t airPPM[] = {
PWM6 | (MAP_TO_PPM_INPUT << 8), // PPM input
PWM7 | (MAP_TO_MOTOR_OUTPUT << 8),
PWM8 | (MAP_TO_MOTOR_OUTPUT << 8),
PWM9 | (MAP_TO_SERVO_OUTPUT << 8),
PWM10 | (MAP_TO_SERVO_OUTPUT << 8),
PWM11 | (MAP_TO_SERVO_OUTPUT << 8),
PWM12 | (MAP_TO_SERVO_OUTPUT << 8),
PWM2 | (MAP_TO_SERVO_OUTPUT << 8),
PWM3 | (MAP_TO_SERVO_OUTPUT << 8),
PWM4 | (MAP_TO_SERVO_OUTPUT << 8),
PWM5 | (MAP_TO_SERVO_OUTPUT << 8),
PWM1 | (MAP_TO_SERVO_OUTPUT << 8),
PWM1 | (MAP_TO_PPM_INPUT << 8), // PPM input
PWM7 | (MAP_TO_MOTOR_OUTPUT << 8), // Motor #1
PWM8 | (MAP_TO_MOTOR_OUTPUT << 8), // Swap to servo if needed
PWM9 | (MAP_TO_MOTOR_OUTPUT << 8),
PWM10 | (MAP_TO_MOTOR_OUTPUT << 8),
PWM11 | (MAP_TO_MOTOR_OUTPUT << 8),
PWM12 | (MAP_TO_MOTOR_OUTPUT << 8),
PWM2 | (MAP_TO_MOTOR_OUTPUT << 8),
PWM3 | (MAP_TO_MOTOR_OUTPUT << 8), // Swap to servo if needed
PWM4 | (MAP_TO_MOTOR_OUTPUT << 8), // Swap to servo if needed
PWM5 | (MAP_TO_MOTOR_OUTPUT << 8), // Swap to servo if needed
PWM6 | (MAP_TO_MOTOR_OUTPUT << 8), // Swap to servo if needed
0xFFFF
};

Expand Down
34 changes: 16 additions & 18 deletions src/main/drivers/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,27 +273,25 @@ const timerHardware_t timerHardware[USABLE_TIMER_CHANNEL_COUNT] = {

#if defined(REVONANO)
const timerHardware_t timerHardware[USABLE_TIMER_CHANNEL_COUNT] = {
{ TIM2, GPIOB, Pin_10, TIM_Channel_3, TIM2_IRQn, 1, GPIO_Mode_AF, GPIO_PinSource10, GPIO_AF_TIM2}, // PPM
{ TIM3, GPIOB, Pin_1, TIM_Channel_4, TIM3_IRQn, 1, GPIO_Mode_AF, GPIO_PinSource1, GPIO_AF_TIM3}, // S2_IN
{ TIM3, GPIOB, Pin_0, TIM_Channel_3, TIM3_IRQn, 1, GPIO_Mode_AF, GPIO_PinSource0, GPIO_AF_TIM3}, // S3_IN
{ TIM3, GPIOA, Pin_7, TIM_Channel_2, TIM3_IRQn, 1, GPIO_Mode_AF, GPIO_PinSource7, GPIO_AF_TIM3}, // S4_IN
{ TIM3, GPIOA, Pin_6, TIM_Channel_1, TIM3_IRQn, 1, GPIO_Mode_AF, GPIO_PinSource6, GPIO_AF_TIM3}, // S5_IN
{ TIM2, GPIOA, Pin_5, TIM_Channel_1, TIM2_IRQn, 1, GPIO_Mode_AF, GPIO_PinSource5, GPIO_AF_TIM2}, // S6_IN

{ TIM2, GPIOB, Pin_3, TIM_Channel_2, TIM2_IRQn, 0, GPIO_Mode_AF, GPIO_PinSource3, GPIO_AF_TIM2}, // S2_OUT
{ TIM10, GPIOB, Pin_8, TIM_Channel_1, TIM1_UP_TIM10_IRQn, 0, GPIO_Mode_AF, GPIO_PinSource8, GPIO_AF_TIM10}, // S3_OUT
{ TIM11, GPIOB, Pin_9, TIM_Channel_1, TIM1_TRG_COM_TIM11_IRQn, 0, GPIO_Mode_AF, GPIO_PinSource9, GPIO_AF_TIM11}, // S4_OUT
{ TIM5, GPIOA, Pin_0, TIM_Channel_1, TIM5_IRQn, 0, GPIO_Mode_AF, GPIO_PinSource0, GPIO_AF_TIM5}, // S5_OUT
{ TIM5, GPIOA, Pin_1, TIM_Channel_2, TIM5_IRQn, 0, GPIO_Mode_AF, GPIO_PinSource1, GPIO_AF_TIM5}, // S6_OUT

{ TIM1, GPIOA, Pin_10, TIM_Channel_3, TIM1_CC_IRQn, 0, GPIO_Mode_AF, GPIO_PinSource10, GPIO_AF_TIM1}, // S1_OUT
{ TIM9, GPIOE, Pin_5, TIM_Channel_1, TIM1_BRK_TIM9_IRQn, 0, GPIO_Mode_AF, GPIO_PinSource5, GPIO_AF_TIM9}, // hack
{ TIM2, GPIOB, Pin_10, TIM_Channel_3, TIM2_IRQn, 0, GPIO_Mode_AF, GPIO_PinSource10, GPIO_AF_TIM2}, // PPM
{ TIM3, GPIOB, Pin_1, TIM_Channel_4, TIM3_IRQn, 0, GPIO_Mode_AF, GPIO_PinSource1, GPIO_AF_TIM3}, // S2_IN
{ TIM3, GPIOB, Pin_0, TIM_Channel_3, TIM3_IRQn, 0, GPIO_Mode_AF, GPIO_PinSource0, GPIO_AF_TIM3}, // S3_IN
{ TIM3, GPIOA, Pin_7, TIM_Channel_2, TIM3_IRQn, 0, GPIO_Mode_AF, GPIO_PinSource7, GPIO_AF_TIM3}, // S4_IN
{ TIM3, GPIOA, Pin_6, TIM_Channel_1, TIM3_IRQn, 0, GPIO_Mode_AF, GPIO_PinSource6, GPIO_AF_TIM3}, // S5_IN
{ TIM2, GPIOA, Pin_5, TIM_Channel_1, TIM2_IRQn, 0, GPIO_Mode_AF, GPIO_PinSource5, GPIO_AF_TIM2}, // S6_IN

{ TIM1, GPIOA, Pin_10, TIM_Channel_3, TIM1_CC_IRQn, 1, GPIO_Mode_AF, GPIO_PinSource10, GPIO_AF_TIM1}, // S1_OUT
{ TIM2, GPIOB, Pin_3, TIM_Channel_2, TIM2_IRQn, 1, GPIO_Mode_AF, GPIO_PinSource3, GPIO_AF_TIM2}, // S2_OUT
{ TIM4, GPIOB, Pin_8, TIM_Channel_3, TIM4_IRQn, 1, GPIO_Mode_AF, GPIO_PinSource8, GPIO_AF_TIM4}, // S3_OUT
{ TIM4, GPIOB, Pin_9, TIM_Channel_4, TIM4_IRQn, 1, GPIO_Mode_AF, GPIO_PinSource9, GPIO_AF_TIM4}, // S4_OUT
{ TIM5, GPIOA, Pin_0, TIM_Channel_1, TIM5_IRQn, 1, GPIO_Mode_AF, GPIO_PinSource0, GPIO_AF_TIM5}, // S5_OUT
{ TIM5, GPIOA, Pin_1, TIM_Channel_2, TIM5_IRQn, 1, GPIO_Mode_AF, GPIO_PinSource1, GPIO_AF_TIM5}, // S6_OUT
};

#define USED_TIMERS ( TIM_N(2) | TIM_N(3) | TIM_N(5) | TIM_N(1) | TIM_N(9) | TIM_N(10) | TIM_N(11) )
#define USED_TIMERS ( TIM_N(1) | TIM_N(2) | TIM_N(3) | TIM_N(4) | TIM_N(5) )

#define TIMER_APB1_PERIPHERALS (RCC_APB1Periph_TIM2 | RCC_APB1Periph_TIM3 | RCC_APB1Periph_TIM5 | RCC_AHB1Periph_GPIOA | RCC_AHB1Periph_GPIOB)
#define TIMER_APB2_PERIPHERALS (RCC_APB2Periph_TIM1 | RCC_APB2Periph_TIM9 | RCC_APB2Periph_TIM10 | RCC_APB2Periph_TIM11)
#define TIMER_APB1_PERIPHERALS (RCC_APB1Periph_TIM2 | RCC_APB1Periph_TIM3 | RCC_APB1Periph_TIM4 | RCC_APB1Periph_TIM5 | RCC_AHB1Periph_GPIOA | RCC_AHB1Periph_GPIOB)
#define TIMER_APB2_PERIPHERALS (RCC_APB2Periph_TIM1)

#endif

Expand Down
2 changes: 1 addition & 1 deletion src/main/target/REVONANO/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
#define MPU_INT_EXTI PA15
#define USE_EXTI

#define USABLE_TIMER_CHANNEL_COUNT 13
#define USABLE_TIMER_CHANNEL_COUNT 12

#define USE_VCP
#define VBUS_SENSING_PIN PA9
Expand Down

0 comments on commit 2bf5f4f

Please sign in to comment.