From: kyz Date: Mon, 21 Mar 2022 03:16:49 +0000 (+0800) Subject: repeater slave recv timeout X-Git-Url: http://kyz.pub/gitweb/?a=commitdiff_plain;h=657b2fd1008af31dca00da7845ca08aac4987570;p=zh%2Falarmboard.git repeater slave recv timeout --- diff --git a/Core/Inc/user.h b/Core/Inc/user.h index fab1583..02b4d4e 100644 --- a/Core/Inc/user.h +++ b/Core/Inc/user.h @@ -11,7 +11,7 @@ #include "main.h" #define DEVICE_TYPE 0x4241 //'AB' -#define DEVICE_SWVER 0x0001 +#define DEVICE_SWVER 0x0002 #define DEBUG_PRINT 1 #define DEBUG_PORT_UART 0 @@ -399,6 +399,7 @@ int32_t vdr_init( void ); int32_t repeater_master_handler( void ); int32_t repeater_slave_handler( void ); +int32_t is_repeater_slave_recv_timeout( void ); int32_t led_bright( uint8_t brightness ); diff --git a/Core/Src/user_app.c b/Core/Src/user_app.c index f9e9fd9..01feef5 100644 --- a/Core/Src/user_app.c +++ b/Core/Src/user_app.c @@ -956,13 +956,18 @@ int32_t device_hw_output( void ) led_out( i, p_out->led[i] ); } } + + if( is_repeater_slave_recv_timeout() ){ + //复示器通信故障 + for( i=0; i 60*1000 ){ //60s timeout + g_repeater_slave_recv_timeout = 1; + }else{ + dev_timeout += 10; + } } - + return 0; } diff --git a/MDK-ARM/AlarmBoard.uvprojx b/MDK-ARM/AlarmBoard.uvprojx index aa01bc9..6078158 100644 --- a/MDK-ARM/AlarmBoard.uvprojx +++ b/MDK-ARM/AlarmBoard.uvprojx @@ -80,9 +80,9 @@ 0 - 0 + 1 0 - + fromelf --bin --output=$L@L.bin !L 0 0