mirror of
https://github.com/oopuuu/zTC1.git
synced 2025-12-16 15:08:15 +08:00
修复长按5s开启配网模式的逻辑问题
This commit is contained in:
@@ -137,7 +137,7 @@ int application_start(void) {
|
|||||||
MicoGpioInitialize((mico_gpio_t) Button, INPUT_PULL_UP);
|
MicoGpioInitialize((mico_gpio_t) Button, INPUT_PULL_UP);
|
||||||
if (!MicoGpioInputGet(Button)) { //开机时按钮状态
|
if (!MicoGpioInputGet(Button)) { //开机时按钮状态
|
||||||
tc1_log("press ap_init");
|
tc1_log("press ap_init");
|
||||||
ApInit(false);
|
ApInit(true);
|
||||||
open_ap = true;
|
open_ap = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "user_gpio.h"
|
#include "user_gpio.h"
|
||||||
|
#include "user_wifi.h"
|
||||||
#include "mqtt_server/user_mqtt_client.h"
|
#include "mqtt_server/user_mqtt_client.h"
|
||||||
|
|
||||||
mico_gpio_t relay[Relay_NUM] = {Relay_0, Relay_1, Relay_2, Relay_3, Relay_4, Relay_5};
|
mico_gpio_t relay[Relay_NUM] = {Relay_0, Relay_1, Relay_2, Relay_3, Relay_4, Relay_5};
|
||||||
@@ -90,8 +91,8 @@ void UserRelaySetAll(char y) {
|
|||||||
|
|
||||||
static void KeyLong5sPress(void) {
|
static void KeyLong5sPress(void) {
|
||||||
key_log("WARNGIN: wifi ap started!");
|
key_log("WARNGIN: wifi ap started!");
|
||||||
sys_config->micoSystemConfig.ssid[0] = 0;
|
micoWlanSuspendStation();
|
||||||
mico_system_context_update(mico_system_context_get());
|
ApInit(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void KeyLong10sPress(void) {
|
static void KeyLong10sPress(void) {
|
||||||
|
|||||||
Reference in New Issue
Block a user