Compare commits

...

2 Commits

View File

@ -318,7 +318,7 @@ static void shake_arithmetic_task_handler(void *param)
signed short x;//, y, z;
int diff_x ;//,diff_y, diff_z;
const int diff_threshold = 1000; // 差值阈值,可根据实际情况调整
const int diff_threshold = 1100; // 差值阈值,可根据实际情况调整
const int strong_tap_threshold = 9000;
@ -352,8 +352,8 @@ static void shake_arithmetic_task_handler(void *param)
diff_x = abs(x - prev_x);
// diff_y = abs(y - prev_y);
//diff_z = abs(z - prev_z);
// os_printf("%s: x = %d,diff_x = %d \n",
// __func__, x, diff_x);
// os_printf("%s: x = %d,diff_x = %d \n",
// __func__, x, diff_x);
// os_printf("%s: x = %d,diff_x = %d y = %d,diff_y = %d z = %d,diff_z = %d\n",
// __func__, x, diff_x,y,diff_y,z,diff_z);
@ -364,7 +364,10 @@ static void shake_arithmetic_task_handler(void *param)
// os_printf("%s: Difference exceeds the threshold, checking time condition.\n", __func__); // 添加差值超过阈值的日志
if ((shake_info.last_time + shake_t_l_ms) < timestmp) {
shake_info.last_time = timestmp;
rtos_delay_milliseconds(180);//过滤刚语音会闪灯
if(first == 1 && get_binary_data_status() == 1){
// turnonall_Led(1);
// os_printf("spi_led_init_gsensor\r\n");
os_printf("========SHAKE========SHAKE========SHAKE========\r\n");