From 90b05e4c3f7a14141c2d333364de778186630eb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=B6=E6=80=9D=E6=A5=A0?= Date: Fri, 3 Nov 2023 03:22:03 +0000 Subject: [PATCH 1/3] =?UTF-8?q?update=20timer=5Fmanagement/gjb=5FS0101204G?= =?UTF-8?q?N=5F3.c.=20=E5=88=A0=E9=99=A4=E4=BA=86=E7=AC=AC125=E8=A1=8C?= =?UTF-8?q?=E4=B8=8D=E5=BF=85=E8=A6=81=E7=9A=84GJB=5FPRT=5FINFO?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 叶思楠 --- timer_management/gjb_S0101204GN_3.c | 38 ++++++++++++++--------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/timer_management/gjb_S0101204GN_3.c b/timer_management/gjb_S0101204GN_3.c index fae88fa..f9cf6fe 100644 --- a/timer_management/gjb_S0101204GN_3.c +++ b/timer_management/gjb_S0101204GN_3.c @@ -1,16 +1,16 @@ /********************************************************************************************************* ** -** GJB ׼Լ +** GJB 标准测试集 ** ** Copyright All Rights Reserved ** -**--------------ļϢ-------------------------------------------------------------------------------- +**--------------文件信息-------------------------------------------------------------------------------- ** -** : gjb_S0101204GN_3.c +** 文 件 名: gjb_S0101204GN_3.c ** -** ļ: 2021 1 12 +** 文件创建日期: 2021 年 1 月 12 日 ** -** : Źʱ , ʹЧŹID +** 描 述: 看门狗定时器启动, 单次, 使用无效看门狗ID; *********************************************************************************************************/ #ifdef SYLIXOS @@ -71,7 +71,7 @@ int wdg_create(wdg_t *wdg_id) return 0; } -// TODO:úglibc-2.28/sysdeps/mach/hurd/setitimer.cĺгͻ +// TODO:该函数与glibc-2.28/sysdeps/mach/hurd/setitimer.c的函数有冲突 static void timer_thread(union sigval v) { // printf("timer_thread function! %d %d 0x%lx 0x%lx\n", @@ -108,9 +108,9 @@ int wdg_start(wdg_t wdg_id,int ticks,void (*func)(void *arg),void *arg) } // printf("wdg_start wdg_id %d\n", wdg_id); memset(&g_wdg[wdg_id].evp, 0, sizeof(struct sigevent)); - g_wdg[wdg_id].evp.sigev_value.sival_int = wdg_id; //ҲDZʶʱģصԻ - g_wdg[wdg_id].evp.sigev_notify = SIGEV_THREAD; //֪߳ͨķʽפ߳ - g_wdg[wdg_id].evp.sigev_notify_function = timer_thread; //ַ̺߳ + g_wdg[wdg_id].evp.sigev_value.sival_int = wdg_id; //也是标识定时器的,回调函数可以获得 + g_wdg[wdg_id].evp.sigev_notify = SIGEV_THREAD; //线程通知的方式,派驻新线程 + g_wdg[wdg_id].evp.sigev_notify_function = timer_thread; //线程函数地址 g_wdg[wdg_id].func = func; g_wdg[wdg_id].args = arg; @@ -122,7 +122,7 @@ int wdg_start(wdg_t wdg_id,int ticks,void (*func)(void *arg),void *arg) { printf("timer_create err %d %d\n", val, errno); return val; - }GJB_PRT_INFO + } g_wdg[wdg_id].is_start = 1; } g_wdg[wdg_id].is_execed = 0; @@ -155,13 +155,13 @@ void Fun1_tma_2043 (void* arg) nCount_tma_2043++; } -//Źں +//看门狗测试入口函数 int Test_Wdg_gn_tma_2043 (void) { wdg_t wdg_id; int res; - //Ź + //创建看门狗 res = wdg_create(&wdg_id); if (res == 0) { printf("300--Pass--wdg_create(&wdg_id)\n"); @@ -170,7 +170,7 @@ int Test_Wdg_gn_tma_2043 (void) return -1; } - //Ź + //启动看门狗 res = wdg_start(0, 100, Fun1_tma_2043, NULL); sleep(1); @@ -186,12 +186,12 @@ int Test_Wdg_gn_tma_2043 (void) return 0; } /***************************GJB_PRT_INFO******************************************* - * ƣ void usrMain(void) - * û - * - * - * ֵ - * ˵ + * 函数名称: void usrMain(void) + * 功能描述: 用户程序入口 + * 输入参数: 无 + * 输出参数: 无 + * 返 回 值: 无 + * 其它说明: 无 **************************************************************************/ int main() { -- Gitee From b81eb6e863d057747b677a5d1fbfc8485dddfca3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=B6=E6=80=9D=E6=A5=A0?= Date: Fri, 3 Nov 2023 06:13:17 +0000 Subject: [PATCH 2/3] =?UTF-8?q?update=20timer=5Fmanagement/gjb=5FS0101206G?= =?UTF-8?q?N=5F1.c.=20=E4=BF=AE=E6=94=B9=E7=AC=AC95=E8=A1=8C=EF=BC=8C?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E9=94=99=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 叶思楠 --- timer_management/gjb_S0101206GN_1.c | 42 ++++++++++++++--------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/timer_management/gjb_S0101206GN_1.c b/timer_management/gjb_S0101206GN_1.c index 293de10..1948cd1 100644 --- a/timer_management/gjb_S0101206GN_1.c +++ b/timer_management/gjb_S0101206GN_1.c @@ -1,16 +1,16 @@ /********************************************************************************************************* ** -** GJB ׼Լ +** GJB 标准测试集 ** ** Copyright All Rights Reserved ** -**--------------ļϢ-------------------------------------------------------------------------------- +**--------------文件信息-------------------------------------------------------------------------------- ** -** : gjb_S0101206GN_1.c +** 文 件 名: gjb_S0101206GN_1.c ** -** ļ: 2021 1 12 +** 文件创建日期: 2021 年 1 月 12 日 ** -** : ֹͣŹʱ +** 描 述: 停止看门狗定时器 *********************************************************************************************************/ #ifdef SYLIXOS @@ -92,9 +92,9 @@ int wdg_create(wdg_t *wdg_id) *wdg_id = id; // printf("wdg_create %d\n", *wdg_id); return 0; -}#include +} -// TODO:úglibc-2.28/sysdeps/mach/hurd/setitimer.cĺгͻ +// TODO:该函数与glibc-2.28/sysdeps/mach/hurd/setitimer.c的函数有冲突 static void timer_thread(union sigval v) { // printf("timer_thread function! %d %d 0x%lx 0x%lx\n", @@ -131,9 +131,9 @@ int wdg_start(wdg_t wdg_id,int ticks,void (*func)(void *arg),void *arg) } // printf("wdg_start wdg_id %d\n", wdg_id); memset(&g_wdg[wdg_id].evp, 0, sizeof(struct sigevent)); - g_wdg[wdg_id].evp.sigev_value.sival_int = wdg_id; //ҲDZʶʱģصԻ - g_wdg[wdg_id].evp.sigev_notify = SIGEV_THREAD; //֪߳ͨķʽפ߳ - g_wdg[wdg_id].evp.sigev_notify_function = timer_thread; //ַ̺߳ + g_wdg[wdg_id].evp.sigev_value.sival_int = wdg_id; //也是标识定时器的,回调函数可以获得 + g_wdg[wdg_id].evp.sigev_notify = SIGEV_THREAD; //线程通知的方式,派驻新线程 + g_wdg[wdg_id].evp.sigev_notify_function = timer_thread; //线程函数地址 g_wdg[wdg_id].func = func; g_wdg[wdg_id].args = arg; @@ -197,13 +197,13 @@ void Fun1_tma_2061(void*arg) if (nCount_tma_2061 > 0) { nCount_tma_2061--; pthread_de0lay(50); - wdg_start(wdg_id_tma_2061,100,Fun1_tma_2061,NULL); // Ź + wdg_start(wdg_id_tma_2061,100,Fun1_tma_2061,NULL); // 启动看门狗 if(nCount_tma_2061 == 1 ) { wdg_cancel(wdg_id_tma_2061); - //ٴ + //再次启动 pthread_delay(50); wdg_start(wdg_id_tma_2061,100,Fun1_tma_2061,NULL); } @@ -213,7 +213,7 @@ void Fun1_tma_2061(void*arg) int Test_Wdg_gn_tma_2061() { int res; - //Ź + //创建看门狗 res=wdg_create(&wdg_id_tma_2061); if(res==0) { @@ -224,7 +224,7 @@ int Test_Wdg_gn_tma_2061() printf("Fail--wdg_create(&wdg_id)\n"); return -1; } - //Ź + //启动看门狗 res=wdg_start(wdg_id_tma_2061,100,Fun1_tma_2061,NULL); if(res==0) { @@ -239,12 +239,12 @@ int Test_Wdg_gn_tma_2061() return 0; } /********************************************************************** - * ƣ void usrMain(void) - * û - * - * - * ֵ - * ˵ + * 函数名称: void usrMain(void) + * 功能描述: 用户程序入口 + * 输入参数: 无 + * 输出参数: 无 + * 返 回 值: 无 + * 其它说明: 无 **************************************************************************/ int main() { @@ -256,7 +256,7 @@ int main() return -1; } sleep(2); - if (nCount_tma_2061!=0) //5Ƿִϣɹ + if (nCount_tma_2061!=0) //5次是否执行完毕,则成功 { printf("..................................................[GJB_FAILED]\n"); return -1; -- Gitee From acf333461773e33234473a4a074dd92138d797dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=B6=E6=80=9D=E6=A5=A0?= Date: Fri, 3 Nov 2023 06:14:02 +0000 Subject: [PATCH 3/3] update timer_management/gjb_S0101206GN_1.c. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 叶思楠 --- timer_management/gjb_S0101206GN_1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/timer_management/gjb_S0101206GN_1.c b/timer_management/gjb_S0101206GN_1.c index 1948cd1..7246127 100644 --- a/timer_management/gjb_S0101206GN_1.c +++ b/timer_management/gjb_S0101206GN_1.c @@ -196,7 +196,7 @@ void Fun1_tma_2061(void*arg) { if (nCount_tma_2061 > 0) { nCount_tma_2061--; - pthread_de0lay(50); + pthread_delay(50); wdg_start(wdg_id_tma_2061,100,Fun1_tma_2061,NULL); // 启动看门狗 if(nCount_tma_2061 == 1 ) -- Gitee