diff options
Diffstat (limited to 'board/careena/board.c')
-rw-r--r-- | board/careena/board.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/board/careena/board.c b/board/careena/board.c index 380a936fd1..0774cd9adc 100644 --- a/board/careena/board.c +++ b/board/careena/board.c @@ -101,12 +101,14 @@ const struct pwm_t pwm_channels[] = { }; BUILD_ASSERT(ARRAY_SIZE(pwm_channels) == PWM_CH_COUNT); -void board_overcurrent_event(int port) +void board_overcurrent_event(int port, int is_overcurrented) { enum gpio_signal signal = (port == 0) ? GPIO_USB_C0_OC_L : GPIO_USB_C1_OC_L; + /* Note that the levels are inverted because the pin is active low. */ + int lvl = is_overcurrented ? 0 : 1; - gpio_set_level(signal, 0); + gpio_set_level(signal, lvl); CPRINTS("p%d: overcurrent!", port); } |