mirror of
https://github.com/oopuuu/zTC1.git
synced 2025-12-13 13:38:14 +08:00
修改按键配置相关的代码
This commit is contained in:
@@ -164,8 +164,8 @@ static void KeyEventHandler(int num, boolean longPress) {
|
|||||||
num > 1 ? (longPress ? "seconds" : "times") : (longPress ? "second" : "time"));
|
num > 1 ? (longPress ? "seconds" : "times") : (longPress ? "second" : "time"));
|
||||||
if (num > 30 || num <= 0)
|
if (num > 30 || num <= 0)
|
||||||
return;
|
return;
|
||||||
int function = !longPress ? get_short_func(user_config->user[clickCnt]) : get_long_func(
|
int function = !longPress ? get_short_func(user_config->user[num]) : get_long_func(
|
||||||
user_config->user[clickCnt]);key_log("WARNGIN:%s", get_func_name(function));
|
user_config->user[num]);key_log("WARNGIN:%s", get_func_name(function));
|
||||||
switch (function) {
|
switch (function) {
|
||||||
case SWITCH_ALL_SOCKETS:
|
case SWITCH_ALL_SOCKETS:
|
||||||
if (RelayOut()) {
|
if (RelayOut()) {
|
||||||
@@ -185,8 +185,8 @@ static void KeyEventHandler(int num, boolean longPress) {
|
|||||||
case SWITCH_SOCKET_4:
|
case SWITCH_SOCKET_4:
|
||||||
case SWITCH_SOCKET_5:
|
case SWITCH_SOCKET_5:
|
||||||
case SWITCH_SOCKET_6:
|
case SWITCH_SOCKET_6:
|
||||||
UserRelaySet(user_config->user[clickCnt] - 1, Relay_TOGGLE);
|
UserRelaySet(user_config->user[num] - 1, Relay_TOGGLE);
|
||||||
UserMqttSendSocketState(user_config->user[clickCnt] - 1);
|
UserMqttSendSocketState(user_config->user[num] - 1);
|
||||||
UserMqttSendTotalSocketState();
|
UserMqttSendTotalSocketState();
|
||||||
mico_system_context_update(sys_config);
|
mico_system_context_update(sys_config);
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user