mirror of
https://github.com/nodemcu/nodemcu-firmware.git
synced 2025-01-30 21:12:55 +08:00
Moved call to set default wifi hostname (#1317)
Moved call from `luaopen_wifi (wifi.c)` to `user_rf_pre_init (user_main.c)` Note: This change adds ~440 us to boot time
This commit is contained in:
parent
37411da06d
commit
2fdaa9b171
@ -1309,7 +1309,7 @@ static const LUA_REG_TYPE wifi_map[] = {
|
|||||||
{ LNILKEY, LNILVAL }
|
{ LNILKEY, LNILVAL }
|
||||||
};
|
};
|
||||||
|
|
||||||
static void wifi_change_default_host_name(task_param_t param, uint8 priority)
|
void wifi_change_default_host_name(void)
|
||||||
{
|
{
|
||||||
#ifndef WIFI_STA_HOSTNAME
|
#ifndef WIFI_STA_HOSTNAME
|
||||||
char temp[32];
|
char temp[32];
|
||||||
@ -1344,7 +1344,6 @@ static void wifi_change_default_host_name(task_param_t param, uint8 priority)
|
|||||||
|
|
||||||
int luaopen_wifi( lua_State *L )
|
int luaopen_wifi( lua_State *L )
|
||||||
{
|
{
|
||||||
task_post_low(task_get_id(wifi_change_default_host_name), FALSE);
|
|
||||||
#if defined(WIFI_SDK_EVENT_MONITOR_ENABLE)
|
#if defined(WIFI_SDK_EVENT_MONITOR_ENABLE)
|
||||||
wifi_eventmon_init();
|
wifi_eventmon_init();
|
||||||
#endif
|
#endif
|
||||||
|
@ -35,6 +35,8 @@ static inline void unregister_lua_cb(lua_State* L, int* cb_ref)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wifi_change_default_host_name(void);
|
||||||
|
|
||||||
#ifdef NODE_DEBUG
|
#ifdef NODE_DEBUG
|
||||||
#define EVENT_DBG(...) c_printf(__VA_ARGS__)
|
#define EVENT_DBG(...) c_printf(__VA_ARGS__)
|
||||||
#else
|
#else
|
||||||
|
@ -117,6 +117,16 @@ void nodemcu_init(void)
|
|||||||
task_post_low(task_get_id(start_lua),'s');
|
task_post_low(task_get_id(start_lua),'s');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef LUA_USE_MODULES_WIFI
|
||||||
|
#include "../modules/wifi_common.h"
|
||||||
|
|
||||||
|
void user_rf_pre_init(void)
|
||||||
|
{
|
||||||
|
//set WiFi hostname before RF initialization (adds ~440 us to boot time)
|
||||||
|
wifi_change_default_host_name();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* FunctionName : user_init
|
* FunctionName : user_init
|
||||||
* Description : entry of user application, init user function here
|
* Description : entry of user application, init user function here
|
||||||
|
Loading…
x
Reference in New Issue
Block a user