Skip to content

Commit

Permalink
fix wifi initialization on ESP8266
Browse files Browse the repository at this point in the history
- fix wifi initialization on ESP8266 (was starting before EEPROM initialization)
  • Loading branch information
Paciente8159 committed Mar 5, 2024
1 parent 8da7d78 commit 91205d3
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions uCNC/src/hal/mcus/esp8266/mcu_esp8266.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@ static FORCEINLINE void servo_reset(void)
#endif
}

#define start_servo_timeout(timeout) {servo_tick_alarm = servo_tick_counter + timeout + 64;}
#define start_servo_timeout(timeout) \
{ \
servo_tick_alarm = servo_tick_counter + timeout + 64; \
}

static FORCEINLINE void servo_update(void)
{
Expand Down Expand Up @@ -325,6 +328,10 @@ static void mcu_usart_init(void)
void mcu_init(void)
{
mcu_io_init();
#ifndef RAM_ONLY_SETTINGS
esp8266_eeprom_init(NVM_STORAGE_SIZE); // 2K Emulated EEPROM
#endif

mcu_usart_init();

// init rtc
Expand All @@ -337,9 +344,6 @@ void mcu_init(void)
timer1_enable(TIM_DIV1, TIM_EDGE, TIM_LOOP);
timer1_write((APB_CLK_FREQ / ITP_SAMPLE_RATE));

#ifndef RAM_ONLY_SETTINGS
esp8266_eeprom_init(NVM_STORAGE_SIZE); // 2K Emulated EEPROM
#endif
#ifdef MCU_HAS_SPI
esp8266_spi_init(SPI_FREQ, SPI_MODE);
#endif
Expand Down

0 comments on commit 91205d3

Please sign in to comment.