Skip to content

Commit

Permalink
tres: fix fan spin on startup (#1297)
Browse files Browse the repository at this point in the history
* tres: fix fan spin on startup

* new init
  • Loading branch information
adeebshihadeh authored Mar 21, 2023
1 parent f658ecd commit d70fa4e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
5 changes: 1 addition & 4 deletions board/boards/red_chiplet.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
10 changes: 9 additions & 1 deletion board/boards/red_v2.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit d70fa4e

Please sign in to comment.