From 2414c96851d5b884aad943220bfcdf811b5fcd2c Mon Sep 17 00:00:00 2001 From: dianke3yu <343528259@qq.com> Date: Sat, 5 Jul 2025 18:13:20 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E9=97=AA=E7=81=AFx?= =?UTF-8?q?=E8=BD=B4=E5=88=A4=E6=96=AD=E9=A2=84=E5=88=B6800-1000ms,?= =?UTF-8?q?=E7=9F=AD=E6=97=B6=E9=97=B4=E7=BC=93=E5=8A=A8=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E4=BC=9A=E5=9C=A8800ms=E5=86=85=E9=87=8D=E5=A4=8D=E8=BF=9B?= =?UTF-8?q?=E6=9D=A5,1000ms=E6=9A=82=E6=97=B6=E7=9C=8B=E6=95=88=E6=9E=9C?= =?UTF-8?q?=E8=BF=98=E5=8F=AF=E4=BB=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/bk_gsensor/arithmetic_module.c | 30 +++++++++++++------ 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/bk_aidk/bk_avdk/bk_idk/components/bk_gsensor/arithmetic_module.c b/bk_aidk/bk_avdk/bk_idk/components/bk_gsensor/arithmetic_module.c index 40408fc9..2ee26d1a 100755 --- a/bk_aidk/bk_avdk/bk_idk/components/bk_gsensor/arithmetic_module.c +++ b/bk_aidk/bk_avdk/bk_idk/components/bk_gsensor/arithmetic_module.c @@ -232,7 +232,7 @@ static void shake_set_onoff(unsigned char onoff) shake_alg_param.shake_threshold_v = 140; shake_alg_param.stability_threshold_v = 130; shake_alg_param.shake_check_number = 1; - shake_alg_param.shake_time_limit_ms = 800; + shake_alg_param.shake_time_limit_ms = 1000; } void shake_arithmetic_set_parameter(shake_recognition_alg_param_t *shake_alg_p) @@ -313,6 +313,8 @@ void shake_arithmetic_set_parameter(shake_recognition_alg_param_t *shake_alg_p) signed short prev_x = 0, prev_y = 0, prev_z = 0; // 记录上一次的三轴数据 int first = 0; + +uint64_t gsen_last_time = 0; static void shake_arithmetic_task_handler(void *param) { signed short x;//, y, z; @@ -331,14 +333,14 @@ static void shake_arithmetic_task_handler(void *param) //os_printf("%s: Entering the function.\n", __func__); // 添加进入函数的日志 /* if shake close, so return. */ - if (0 == shake_info.onoff) { - os_printf("%s: Shake detection is off, returning.\n", __func__); - return; - } + // if (0 == shake_info.onoff) { + // os_printf("%s: Shake detection is off, returning.\n", __func__); + // return; + // } uint64_t timestmp = 0; uint64_t shake_t_l_ms = shake_alg_param.shake_time_limit_ms; - +//uint64_t shake_t_l_ms = 800; for (unsigned int i = 0; i < count; i += 3) { /* get x,y,z data */ x = data_buf[i+0]; @@ -361,9 +363,19 @@ static void shake_arithmetic_task_handler(void *param) // 判断差值是否超过阈值 if (diff_x > diff_threshold ) { timestmp = bk_aon_rtc_get_ms(); + + // os_printf("%s timestmp:%llu gsen_last_time:%llu gsen_last_time + shake_t_l_ms:%llu shake_t_l_ms :%llu\r\n", __func__, timestmp, gsen_last_time, gsen_last_time + shake_t_l_ms,shake_t_l_ms); // 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; + if ((gsen_last_time + shake_t_l_ms) < timestmp) { + + // os_printf("limiande %s: timestmp=%llu, last_time=%llu, threshold=%llu shake_t_l_ms= %llu\r\n", + //__func__, timestmp, gsen_last_time, gsen_last_time + shake_t_l_ms,shake_t_l_ms); + gsen_last_time = timestmp; + + // os_printf("Current timestmp: %llu\n", timestmp); + //bk_printf("gsen_last_time55555 %llu\r\n", gsen_last_time); + // bk_printf("gsen_last_time55555 %lu timestmp =%lu \r\n",gsen_last_time,timestmp); + rtos_delay_milliseconds(180);//过滤刚语音会闪灯 if(first == 1 && get_binary_data_status() == 1){ @@ -387,7 +399,7 @@ static void shake_arithmetic_task_handler(void *param) //prev_z = z; first = 1; // prev_y = y; - // prev_z = z; + // prev_z = z; } if (diff_x > strong_tap_threshold && get_binary_data_status() == 0) { From a144557804b4d1a25e8a6e343071ea07852d354d Mon Sep 17 00:00:00 2001 From: dianke3yu <343528259@qq.com> Date: Sat, 5 Jul 2025 18:19:55 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E9=97=AA=E7=81=AFx?= =?UTF-8?q?=E8=BD=B4=E5=88=A4=E6=96=AD=E9=A2=84=E5=88=B6800-1000ms,?= =?UTF-8?q?=E7=9F=AD=E6=97=B6=E9=97=B4=E7=BC=93=E5=8A=A8=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E4=BC=9A=E5=9C=A8800ms=E5=86=85=E9=87=8D=E5=A4=8D=E8=BF=9B?= =?UTF-8?q?=E6=9D=A5,1000ms=E6=9A=82=E6=97=B6=E7=9C=8B=E6=95=88=E6=9E=9C?= =?UTF-8?q?=E8=BF=98=E5=8F=AF=E4=BB=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bk_aidk/projects/beken_wss_paopao/config/bk7258_cp1/config | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bk_aidk/projects/beken_wss_paopao/config/bk7258_cp1/config b/bk_aidk/projects/beken_wss_paopao/config/bk7258_cp1/config index b25d0db6..f26f0412 100755 --- a/bk_aidk/projects/beken_wss_paopao/config/bk7258_cp1/config +++ b/bk_aidk/projects/beken_wss_paopao/config/bk7258_cp1/config @@ -44,8 +44,8 @@ CONFIG_AEC_VERSION_V2=y CONFIG_AEC_ECHO_COLLECT_MODE_HARDWARE=y #CONFIG_PROMPT_TONE_SOURCE_VFS=y CONFIG_PROMPT_TONE_SOURCE_ARRAY=y -CONFIG_PROMPT_TONE_CODEC_WAV=y - +#CONFIG_PROMPT_TONE_CODEC_WAV=y +CONFIG_PROMPT_TONE_CODEC_MP3=y # # USB configuration # @@ -139,4 +139,4 @@ CONFIG_SDCARD_POWER_GPIO_CTRL_AUTO_POWERDOWN_WHEN_IDLE=n CONFIG_USR_GPIO_CFG_EN=y CONFIG_GPIO_DEFAULT_SET_SUPPORT=y CONFIG_SPI = y -CONFIG_SPI_DMA=y \ No newline at end of file +CONFIG_SPI_DMA=y