fix(swan_r5): 3v3 was enabled but then immediately reset. Moved initialization to `reset_board` which happens after `reset_all_pins`.
This commit is contained in:
parent
edfabb66ff
commit
113b070e77
|
@ -59,8 +59,6 @@ void board_init(void) {
|
||||||
// Without this, USB does not function.
|
// Without this, USB does not function.
|
||||||
HAL_InitTick((1UL << __NVIC_PRIO_BITS) - 1UL);
|
HAL_InitTick((1UL << __NVIC_PRIO_BITS) - 1UL);
|
||||||
|
|
||||||
initialize_discharge_pin();
|
|
||||||
|
|
||||||
__HAL_RCC_GPIOE_CLK_ENABLE();
|
__HAL_RCC_GPIOE_CLK_ENABLE();
|
||||||
GPIO_InitTypeDef GPIO_InitStruct;
|
GPIO_InitTypeDef GPIO_InitStruct;
|
||||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||||
|
@ -78,6 +76,7 @@ bool board_requests_safe_mode(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void reset_board(void) {
|
void reset_board(void) {
|
||||||
|
initialize_discharge_pin();
|
||||||
}
|
}
|
||||||
|
|
||||||
void board_deinit(void) {
|
void board_deinit(void) {
|
||||||
|
|
|
@ -64,3 +64,6 @@
|
||||||
|
|
||||||
#define DEFAULT_UART_BUS_RX (&pin_PA10)
|
#define DEFAULT_UART_BUS_RX (&pin_PA10)
|
||||||
#define DEFAULT_UART_BUS_TX (&pin_PA09)
|
#define DEFAULT_UART_BUS_TX (&pin_PA09)
|
||||||
|
|
||||||
|
#define SWAN_R5_DISCHARGE_3V3 (&pin_PE06)
|
||||||
|
#define SWAN_R5_ENABLE_3V3 (&pin_PE04)
|
|
@ -86,8 +86,8 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
|
||||||
|
|
||||||
{ MP_ROM_QSTR(MP_QSTR_ext), MP_ROM_PTR(&carrier_type) },
|
{ MP_ROM_QSTR(MP_QSTR_ext), MP_ROM_PTR(&carrier_type) },
|
||||||
|
|
||||||
{ MP_ROM_QSTR(MP_QSTR_ENABLE_3V3), MP_ROM_PTR(&pin_PE04) },
|
{ MP_ROM_QSTR(MP_QSTR_ENABLE_3V3), MP_ROM_PTR(SWAN_R5_ENABLE_3V3) },
|
||||||
{ MP_ROM_QSTR(MP_QSTR_DISCHARGE_3V3), MP_ROM_PTR(&pin_PE06) },
|
{ MP_ROM_QSTR(MP_QSTR_DISCHARGE_3V3), MP_ROM_PTR(SWAN_R5_DISCHARGE_3V3) },
|
||||||
{ MP_ROM_QSTR(MP_QSTR_DISABLE_DISCHARGING), MP_ROM_TRUE },
|
{ MP_ROM_QSTR(MP_QSTR_DISABLE_DISCHARGING), MP_ROM_TRUE },
|
||||||
{ MP_ROM_QSTR(MP_QSTR_ENABLE_DISCHARGING), MP_ROM_FALSE },
|
{ MP_ROM_QSTR(MP_QSTR_ENABLE_DISCHARGING), MP_ROM_FALSE },
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue