Update magic box firmware
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
#include "app_mode.h"
|
||||
#include "app_led.h"
|
||||
#include "app_shake_wake.h"
|
||||
#include "app_no_disturb.h"
|
||||
#include "app_time_util.h"
|
||||
#include "bsp_hw.h"
|
||||
#include "board_pin.h"
|
||||
@@ -46,7 +47,6 @@ typedef struct {
|
||||
volatile uint8_t play_write_pending;
|
||||
volatile uint8_t play_write_mode;
|
||||
uint8_t shake_wake;
|
||||
uint8_t no_disturb;
|
||||
} AppFunctionCtx_t;
|
||||
|
||||
static AppFunctionCtx_t s_func;
|
||||
@@ -71,7 +71,6 @@ void app_function_init(void)
|
||||
app_shake_wake_init(function_shake_wake_allowed,
|
||||
function_shake_wake_trigger);
|
||||
s_func.shake_wake = !!gDevData.shake_wake;
|
||||
s_func.no_disturb = !!gDevData.no_disturb_enable[0];
|
||||
app_shake_wake_set_enable(s_func.shake_wake);
|
||||
}
|
||||
|
||||
@@ -89,7 +88,7 @@ void app_function_dp_play_write(uint8_t mode)
|
||||
|
||||
/**
|
||||
* @brief DP2 写入钩子:仅记录第 1 字节,真正执行在 app_function_poll
|
||||
* @param cmd 0=忽略,1=原地右转,2=原地左转
|
||||
* @param cmd 0=停止,1=上部电机探出,2=下部电机探出
|
||||
* @return 无
|
||||
*/
|
||||
void app_function_dp_hand_write(uint8_t cmd)
|
||||
@@ -105,12 +104,6 @@ void app_function_set_shake_wake(uint8_t enable)
|
||||
app_shake_wake_set_enable(s_func.shake_wake);
|
||||
}
|
||||
|
||||
void app_function_set_no_disturb(uint8_t enable)
|
||||
{
|
||||
s_func.no_disturb = !!enable;
|
||||
app_shake_wake_reset();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 跟随 APP 下发的 DP0/DP1,并处理 DP2 手动点动
|
||||
* @return 无
|
||||
@@ -120,10 +113,6 @@ void app_function_poll(void)
|
||||
if (s_func.shake_wake != !!gDevData.shake_wake) {
|
||||
app_function_set_shake_wake(gDevData.shake_wake);
|
||||
}
|
||||
if (s_func.no_disturb != !!gDevData.no_disturb_enable[0]) {
|
||||
app_function_set_no_disturb(gDevData.no_disturb_enable[0]);
|
||||
}
|
||||
|
||||
if (s_func.power_write_pending) {
|
||||
uint8_t enable = s_func.power_write_value;
|
||||
s_func.power_write_pending = 0;
|
||||
@@ -341,7 +330,7 @@ static void function_play_mode_timeout(uint16_t dt)
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief DP2 手动:只看第 1 字节。0=空闲,1=顺时针,2=逆时针,3=停
|
||||
* @brief DP2 手动:只看第 1 字节。0=空闲,1=上部探出,2=下部探出
|
||||
* @return 无
|
||||
*/
|
||||
static void function_hand_poll(void)
|
||||
@@ -501,7 +490,7 @@ static uint8_t function_power_on(uint8_t show_hint)
|
||||
static uint8_t function_shake_wake_allowed(void)
|
||||
{
|
||||
return s_func.shake_wake &&
|
||||
!s_func.no_disturb &&
|
||||
!app_no_disturb_is_active() &&
|
||||
!s_func.app_power &&
|
||||
!app_power_usb_online() &&
|
||||
!app_power_poweroff_pending() &&
|
||||
|
||||
Reference in New Issue
Block a user