diff options
Diffstat (limited to 'board/samus_pd')
-rw-r--r-- | board/samus_pd/board.c | 7 | ||||
-rw-r--r-- | board/samus_pd/gpio.inc | 4 |
2 files changed, 9 insertions, 2 deletions
diff --git a/board/samus_pd/board.c b/board/samus_pd/board.c index 61159dc3c4..7a0c0a759b 100644 --- a/board/samus_pd/board.c +++ b/board/samus_pd/board.c @@ -62,7 +62,7 @@ static int desired_charge_rate_ma = -1; /* PWM channels. Must be in the exact same order as in enum pwm_channel. */ const struct pwm_t pwm_channels[] = { - {STM32_TIM(15), STM32_TIM_CH(2), 0, GPIO_ILIM_ADJ_PWM, GPIO_ALT_F1}, + {STM32_TIM(15), STM32_TIM_CH(2), 0}, }; BUILD_ASSERT(ARRAY_SIZE(pwm_channels) == PWM_CH_COUNT); @@ -475,6 +475,9 @@ int board_is_vbus_too_low(enum chg_ramp_vbus_state ramp_state) static int board_update_charge_limit(int charge_ma) { +#ifdef CONFIG_PWM + int pwm_duty; +#endif static int actual_charge_rate_ma = -1; desired_charge_rate_ma = charge_ma; @@ -490,7 +493,7 @@ static int board_update_charge_limit(int charge_ma) actual_charge_rate_ma = charge_ma; #ifdef CONFIG_PWM - int pwm_duty = MA_TO_PWM(charge_ma); + pwm_duty = MA_TO_PWM(charge_ma); if (pwm_duty < 0) pwm_duty = 0; else if (pwm_duty > 100) diff --git a/board/samus_pd/gpio.inc b/board/samus_pd/gpio.inc index 407e073a5f..779519fe5c 100644 --- a/board/samus_pd/gpio.inc +++ b/board/samus_pd/gpio.inc @@ -128,3 +128,7 @@ ALTERNATE(PIN_MASK(A, 0x0600), 1, MODULE_UART, 0) /* USART1: PA9/PA10 */ ALTERNATE(PIN_MASK(D, 0x0060), 0, MODULE_UART, 0) /* USART2: PD5/PD6 */ ALTERNATE(PIN_MASK(C, 0x0030), 1, MODULE_UART, 0) /* USART3: PC4/PC5 */ ALTERNATE(PIN_MASK(B, 0x0cc0), 1, MODULE_I2C, 0) /* I2C SLAVE:PB6/7 MASTER:PB10/11 */ + +#ifdef CONFIG_PWM +ALTERNATE(PIN_MASK(B, 0x8000), 1, MODULE_PWM, 0) /* ILIM_PWM: PB15 */ +#endif |