From d70fa4e1200ad47c66587c78fd90030a3be1cc43 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Tue, 21 Mar 2023 11:19:12 -0700 Subject: [PATCH] tres: fix fan spin on startup (#1297) * tres: fix fan spin on startup * new init --- board/boards/red_chiplet.h | 5 +---- board/boards/red_v2.h | 10 +++++++++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/board/boards/red_chiplet.h b/board/boards/red_chiplet.h index 463f6a2b3..c4816a9e9 100644 --- a/board/boards/red_chiplet.h +++ b/board/boards/red_chiplet.h @@ -70,13 +70,10 @@ void red_chiplet_init(void) { set_gpio_pullup(GPIOD, 3, PULL_NONE); set_gpio_mode(GPIOD, 3, MODE_OUTPUT); - //B0: 5VOUT_S + // B0: 5VOUT_S set_gpio_pullup(GPIOB, 0, PULL_NONE); set_gpio_mode(GPIOB, 0, MODE_ANALOG); - // Turn on USB load switch. - red_chiplet_set_fan_or_usb_load_switch(true); - // Initialize harness harness_init(); diff --git a/board/boards/red_v2.h b/board/boards/red_v2.h index 540b51b13..3e8f2f2e0 100644 --- a/board/boards/red_v2.h +++ b/board/boards/red_v2.h @@ -2,6 +2,14 @@ // Red Panda V2 with chiplet + Harness // // ///////////////////// // +void red_panda_v2_init(void) { + // common chiplet init + red_chiplet_init(); + + // Turn on USB load switch + red_chiplet_set_fan_or_usb_load_switch(true); +} + const board board_red_v2 = { .board_type = "Red_v2", .board_tick = unused_board_tick, @@ -17,7 +25,7 @@ const board board_red_v2 = { .adc_scale = 5539U, .fan_stall_recovery = false, .fan_enable_cooldown_time = 0U, - .init = red_chiplet_init, + .init = red_panda_v2_init, .enable_can_transceiver = red_chiplet_enable_can_transceiver, .enable_can_transceivers = red_chiplet_enable_can_transceivers, .set_led = red_set_led,