Move static constructor calls to after PHY, clock & baud rate are setup
Otherwise anything printed inside the constructor happens at unexpected baud rate. Ref #128
This commit is contained in:
parent
660dc6d0f4
commit
d569ead290
1 changed files with 7 additions and 6 deletions
|
@ -440,12 +440,6 @@ static void user_start_phase2(void) {
|
||||||
uart_flush_txfifo(0);
|
uart_flush_txfifo(0);
|
||||||
uart_flush_txfifo(1);
|
uart_flush_txfifo(1);
|
||||||
|
|
||||||
// Call gcc constructor functions
|
|
||||||
void (**ctor)(void);
|
|
||||||
for ( ctor = &__init_array_start; ctor != &__init_array_end; ++ctor) {
|
|
||||||
(*ctor)();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (phy_info[0] != 5) {
|
if (phy_info[0] != 5) {
|
||||||
// Bad version byte. Discard what we read and use default values
|
// Bad version byte. Discard what we read and use default values
|
||||||
// instead.
|
// instead.
|
||||||
|
@ -453,6 +447,13 @@ static void user_start_phase2(void) {
|
||||||
}
|
}
|
||||||
init_networking(phy_info, sdk_info.sta_mac_addr);
|
init_networking(phy_info, sdk_info.sta_mac_addr);
|
||||||
free(phy_info);
|
free(phy_info);
|
||||||
|
|
||||||
|
// Call gcc constructor functions
|
||||||
|
void (**ctor)(void);
|
||||||
|
for ( ctor = &__init_array_start; ctor != &__init_array_end; ++ctor) {
|
||||||
|
(*ctor)();
|
||||||
|
}
|
||||||
|
|
||||||
tcpip_init(NULL, NULL);
|
tcpip_init(NULL, NULL);
|
||||||
sdk_wdt_init();
|
sdk_wdt_init();
|
||||||
xTaskCreate(sdk_user_init_task, (signed char *)"uiT", 1024, 0, 14, &sdk_xUserTaskHandle);
|
xTaskCreate(sdk_user_init_task, (signed char *)"uiT", 1024, 0, 14, &sdk_xUserTaskHandle);
|
||||||
|
|
Loading…
Reference in a new issue