mirror of
https://github.com/oopuuu/zTC1.git
synced 2025-12-13 21:48:25 +08:00
编译通过
This commit is contained in:
@@ -89,11 +89,13 @@ int application_start(void)
|
|||||||
ApInit();
|
ApInit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool open_ap = false;
|
||||||
MicoGpioInitialize((mico_gpio_t) Led, OUTPUT_PUSH_PULL);
|
MicoGpioInitialize((mico_gpio_t) Led, OUTPUT_PUSH_PULL);
|
||||||
for (i = 0; i < Relay_NUM; i++)
|
for (i = 0; i < Relay_NUM; i++)
|
||||||
{
|
{
|
||||||
MicoGpioInitialize(Relay[i], OUTPUT_PUSH_PULL);
|
MicoGpioInitialize(Relay[i], OUTPUT_PUSH_PULL);
|
||||||
UserRelaySet(i, user_config->socket[i].on);
|
UserRelaySet(i, user_config->socket[i].on);
|
||||||
|
open_ap = true;
|
||||||
}
|
}
|
||||||
MicoSysLed(0);
|
MicoSysLed(0);
|
||||||
|
|
||||||
@@ -127,8 +129,8 @@ int application_start(void)
|
|||||||
os_log("mqtt_password:%s",user_config->mqtt_password);
|
os_log("mqtt_password:%s",user_config->mqtt_password);
|
||||||
os_log("version:%d",user_config->version);
|
os_log("version:%d",user_config->version);
|
||||||
|
|
||||||
StationInit();
|
WifiInit();
|
||||||
if (sys_config->micoSystemConfig.reserved != NOTIFY_STATION_UP)
|
if (sys_config->micoSystemConfig.reserved != NOTIFY_STATION_UP && !open_ap)
|
||||||
{
|
{
|
||||||
ApInit();
|
ApInit();
|
||||||
}
|
}
|
||||||
@@ -145,7 +147,7 @@ int application_start(void)
|
|||||||
user_power_init();
|
user_power_init();
|
||||||
|
|
||||||
/* start http server thread */
|
/* start http server thread */
|
||||||
app_httpd_start();
|
AppHttpdStart();
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
main_num++;
|
main_num++;
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ static void WifiStatusCallback(WiFiEvent status, void* arg)
|
|||||||
sys_config->micoSystemConfig.reserved = status;
|
sys_config->micoSystemConfig.reserved = status;
|
||||||
mico_system_context_update(sys_config);
|
mico_system_context_update(sys_config);
|
||||||
|
|
||||||
ap_init(); //打开AP
|
ApInit(); //打开AP
|
||||||
|
|
||||||
wifi_status = WIFI_STATE_NOCONNECT;
|
wifi_status = WIFI_STATE_NOCONNECT;
|
||||||
if (!mico_rtos_is_timer_running(&wifi_led_timer))
|
if (!mico_rtos_is_timer_running(&wifi_led_timer))
|
||||||
@@ -139,7 +139,7 @@ void WifiConnect(char* wifi_ssid, char* wifi_key)
|
|||||||
wifi_status = WIFI_STATE_NOCONNECT;
|
wifi_status = WIFI_STATE_NOCONNECT;
|
||||||
}
|
}
|
||||||
|
|
||||||
void StationInit(void)
|
void WifiInit(void)
|
||||||
{
|
{
|
||||||
//wifi状态下led闪烁定时器初始化
|
//wifi状态下led闪烁定时器初始化
|
||||||
mico_rtos_init_timer(&wifi_led_timer, 100, (void *) WifiLedTimerCallback, NULL);
|
mico_rtos_init_timer(&wifi_led_timer, 100, (void *) WifiLedTimerCallback, NULL);
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ extern char* wifi_ret;
|
|||||||
|
|
||||||
extern char wifi_status;
|
extern char wifi_status;
|
||||||
|
|
||||||
extern void StationInit(void);
|
extern void WifiInit(void);
|
||||||
extern void ApInit(void);
|
extern void ApInit(void);
|
||||||
extern void WifiConnect(char* wifi_ssid, char* wifi_key);
|
extern void WifiConnect(char* wifi_ssid, char* wifi_key);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user