Fixed PWM mode
This commit is contained in:
@@ -58,7 +58,7 @@ enum class GPIO_Alternate_Function_Mapping {
|
||||
A11_TIM1CH4 = 0x01,
|
||||
A12_TIM1ETR = 0x01,
|
||||
A15_TIM2CH1 = 0x01,
|
||||
B0_TIM2CH2N = 0x01,
|
||||
B0_TIM1CH2N = 0x01,
|
||||
B1_TIM1CH3N = 0x01,
|
||||
};
|
||||
|
||||
@@ -132,7 +132,7 @@ static inline SHAL_GPIO_Pullup_Pulldown_Register getGPIOPUPDRegister(const GPIO_
|
||||
|
||||
static inline SHAL_GPIO_Alternate_Function_Register getGPIOAlternateFunctionRegister(const GPIO_Key key){
|
||||
|
||||
uint32_t pinNumber = static_cast<uint8_t>(key); //Number of pin (We need 0-7 to be AFR 1 and 8-15 to be AFR 2)
|
||||
uint32_t pinNumber = static_cast<uint8_t>(key) % 16; //Number of pin (We need 0-7 to be AFR 1 and 8-15 to be AFR 2)
|
||||
uint32_t afrIndex = pinNumber < 8 ? 0 : 1;
|
||||
|
||||
volatile uint32_t* reg = &GPIO_TABLE[static_cast<uint8_t>(key) / 16]->AFR[afrIndex];
|
||||
|
||||
Reference in New Issue
Block a user