summaryrefslogtreecommitdiff
path: root/board/delan/board.c
diff options
context:
space:
mode:
Diffstat (limited to 'board/delan/board.c')
-rw-r--r--board/delan/board.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/board/delan/board.c b/board/delan/board.c
index f5b5f5b2dd..4304ce25e4 100644
--- a/board/delan/board.c
+++ b/board/delan/board.c
@@ -114,12 +114,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);
}