committed by
Bertrand Songis
parent
993e543162
commit
8e7e036591
@@ -28,8 +28,8 @@ if (PCB STREQUAL X10)
|
||||
set(TARGET_SRC
|
||||
${TARGET_SRC}
|
||||
../common/arm/stm32/audio_dac_driver.cpp
|
||||
../common/arm/stm32/analog_adc_driver.cpp
|
||||
../common/arm/stm32/analog_pwm_driver.cpp
|
||||
../common/arm/stm32/adc_driver.cpp
|
||||
../common/arm/stm32/sticks_pwm_driver.cpp
|
||||
)
|
||||
|
||||
set(BITMAPS_TARGET x10_bitmaps)
|
||||
|
||||
@@ -197,6 +197,15 @@ void boardInit()
|
||||
memset(&g_FATFS_Obj, 0, sizeof(g_FATFS_Obj));
|
||||
|
||||
keysInit();
|
||||
|
||||
#if NUM_PWMSTICKS > 0
|
||||
sticksPwmInit();
|
||||
delay_ms(20);
|
||||
if (pwm_interrupt_count < 32) {
|
||||
sticks_pwm_disabled = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
adcInit();
|
||||
lcdInit();
|
||||
backlightInit();
|
||||
|
||||
@@ -339,10 +339,10 @@ void watchdogInit(unsigned int duration);
|
||||
#define NUM_XPOTS NUM_POTS
|
||||
#if defined(PCBX10)
|
||||
#define NUM_SLIDERS 2
|
||||
#define NUM_PWMANALOGS 4
|
||||
#define NUM_PWMSTICKS 4
|
||||
#else
|
||||
#define NUM_SLIDERS 4
|
||||
#define NUM_PWMANALOGS 0
|
||||
#define NUM_PWMSTICKS 0
|
||||
#endif
|
||||
enum Analogs {
|
||||
STICK1,
|
||||
@@ -408,12 +408,11 @@ uint16_t getAnalogValue(uint8_t index);
|
||||
#define NUM_DUMMY_ANAS 0
|
||||
#endif
|
||||
|
||||
#if NUM_PWMANALOGS > 0
|
||||
extern uint8_t analogs_pwm_disabled;
|
||||
#define ANALOGS_PWM_ENABLED() (analogs_pwm_disabled == false)
|
||||
void analogPwmInit(void);
|
||||
void analogPwmRead(uint16_t * values);
|
||||
void analogPwmCheck();
|
||||
#if NUM_PWMSTICKS > 0
|
||||
extern uint8_t sticks_pwm_disabled;
|
||||
#define STICKS_PWM_ENABLED() (sticks_pwm_disabled == false)
|
||||
void sticksPwmInit(void);
|
||||
void sticksPwmRead(uint16_t * values);
|
||||
extern volatile uint32_t pwm_interrupt_count;
|
||||
#endif
|
||||
|
||||
|
||||
@@ -219,7 +219,7 @@
|
||||
#define PWM_IRQHandler TIM5_IRQHandler
|
||||
#define PWM_IRQn TIM5_IRQn
|
||||
#define PWM_GPIOA_PINS (GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_3)
|
||||
#define ADC_GPIOA_PINS (ANALOGS_PWM_ENABLED() ? 0 : (GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_3))
|
||||
#define ADC_GPIOA_PINS (STICKS_PWM_ENABLED() ? 0 : (GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_3))
|
||||
#define ADC_GPIOC_PINS (GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_3)
|
||||
#define ADC_GPIOF_PINS (GPIO_Pin_6 | GPIO_Pin_7) // | GPIO_Pin_8 | GPIO_Pin_9)
|
||||
#define ADC_CHANNEL_STICK_LH ADC_Channel_0 // ADC3_IN0
|
||||
|
||||
Reference in New Issue
Block a user