Skip to content

Commit

Permalink
Initialize NVM before LPUART1
Browse files Browse the repository at this point in the history
This ensures that the LPUART1 peripheral used for the AT command
interface will be configured with the correct baudrate previously saved
in NVM.
  • Loading branch information
janakj committed Apr 5, 2022
1 parent 3099d64 commit c55be3a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
int main(void)
{
system_init();
cmd_init(sysconf.uart_baudrate);

#ifdef DEBUG
log_init(LOG_LEVEL_DUMP, LOG_TIMESTAMP_ABS);
Expand All @@ -33,13 +32,14 @@ int main(void)
#endif
log_info("LoRa Module %s [LoRaMac %s] built on %s", VERSION, LIB_VERSION, BUILD_DATE);

nvm_init();
cmd_init(sysconf.uart_baudrate);

adc_init();
spi_init(10000000);
sx1276io_init();

nvm_init();
lrw_init();

log_debug("LoRaMac: Starting");
LoRaMacStart();
cmd_event(CMD_EVENT_MODULE, CMD_MODULE_BOOT);
Expand Down

0 comments on commit c55be3a

Please sign in to comment.