[beken-72xx] Initialize UART to fix deep sleep

This commit is contained in:
Kuba Szczodrzyński
2023-08-23 16:06:01 +02:00
parent bd47772c04
commit 27393e47c3
3 changed files with 10 additions and 1 deletions

View File

@@ -47,6 +47,10 @@ void SerialClass::configure(unsigned long baudrate, uint16_t config) {
.flow_control = FLOW_CTRL_DISABLED,
};
if (port == 1)
uart1_init();
else if (port == 2)
uart2_init();
uart_hw_set_change(port, &cfg);
uart_rx_callback_set(port, callback, &BUF);

View File

@@ -6,4 +6,9 @@
void lt_init_family() {
// set default UART output port
uart_print_port = LT_UART_DEFAULT_PORT - 1;
// initialize the UART (needed e.g. after deep sleep)
if (uart_print_port == 1)
uart1_init();
else if (uart_print_port == 2)
uart2_init();
}

View File

@@ -21,7 +21,7 @@ void lt_deep_sleep_unset_gpio(uint32_t gpio_index_map);
/**
* @brief Set a sleep timer to wake up the device
* @param sleep_duration the time in seconds to sleep
* @param sleep_duration the time in milliseconds to sleep
*/
void lt_deep_sleep_config_timer(uint32_t sleep_duration);