diff --git a/HARDWARE/TIMER/timer.c b/HARDWARE/TIMER/timer.c index 6729303..1fe7376 100644 --- a/HARDWARE/TIMER/timer.c +++ b/HARDWARE/TIMER/timer.c @@ -214,7 +214,7 @@ void TIM3_IRQHandler(void) /* 输出50ms脉冲,用于测量同步时钟精度*/ /*! @note 测试时,需要关闭串口打印功能 @ref PRINT_UART_LOG*/ #if IO_SHINE_IN_TIMER - if(MS_TIME%20==0){//50ms输出一个脉冲 + if(MS_TIME%50==0){//50ms输出一个脉冲 PAout(9) = ~PAout(9); PAout(10) = ~PAout(10); } diff --git a/HARDWARE/TIMER/timer.h b/HARDWARE/TIMER/timer.h index 825476d..66f08dc 100644 --- a/HARDWARE/TIMER/timer.h +++ b/HARDWARE/TIMER/timer.h @@ -17,7 +17,7 @@ //! 基本是10s(10000ms)更新一下 -#define SYNC_INTERVAL_TIME 10000 +#define SYNC_INTERVAL_TIME 2000 //! 是否让工作灯在定时器中闪烁 #define WORKING_LED_SHINE_IN_TIMER 1 //! 是否让展示nodeId灯在定时器中闪烁 diff --git a/HARDWARE/WIFI/userwifi.c b/HARDWARE/WIFI/userwifi.c index bcb549a..7418035 100644 --- a/HARDWARE/WIFI/userwifi.c +++ b/HARDWARE/WIFI/userwifi.c @@ -19,7 +19,7 @@ #include "can1.h" #include "can2.h" -u8 DATA_AUTO_CHECK_EN = 1; //是否在中断中自动check数据 +volatile u8 DATA_AUTO_CHECK_EN = 1; //是否在中断中自动check数据 u32 SYSTEMTIME = 0; //系统时间 u32 YYMMDD =0; //年月日 u8 Time_Sync_Flag = 0; //最近时钟是否同步 diff --git a/HARDWARE/WIFI/userwifi.h b/HARDWARE/WIFI/userwifi.h index 5267de3..bcfb38a 100644 --- a/HARDWARE/WIFI/userwifi.h +++ b/HARDWARE/WIFI/userwifi.h @@ -158,7 +158,7 @@ extern unsigned short localModuleSocket_txrx; extern unsigned short localSocketDescriptor_txrx; //!是否在中断中自动check数据 -extern u8 DATA_AUTO_CHECK_EN; +extern volatile u8 DATA_AUTO_CHECK_EN; //!字节数据发送个数 extern u32 bytes_sent; diff --git a/HARDWARE/WIFI/wificonf.c b/HARDWARE/WIFI/wificonf.c index bf5e15d..516690e 100644 --- a/HARDWARE/WIFI/wificonf.c +++ b/HARDWARE/WIFI/wificonf.c @@ -148,6 +148,7 @@ void EXTI4_IRQHandler(void) { EXTI->PR |=1<<4; rsi_app_cb.pkt_pending ++;//= RSI_TRUE; + printf("[%d] pkt_pending : %d\r\n",SYSTEMTIME,rsi_app_cb.pkt_pending); /* 初始化时不能进行自动check*/ if( BOARD_STA == BOARD_RUNNING){ if((DATA_AUTO_CHECK_EN)&&(RSI_WIFI_OPER_MODE == RSI_WIFI_CLIENT_MODE_VAL)){//处于Clien模式,而且要使能自动check diff --git a/USER/main.c b/USER/main.c index 1275fe3..c63af79 100644 --- a/USER/main.c +++ b/USER/main.c @@ -126,9 +126,8 @@ void testAdc(void){ * @param None * @retval None */ -u8 data[1500]; void testMaxWifiSpeed(){ - + u8 data[1500]; rsi_send_ludp_data(localSocketDescriptor_txrx, data,1500, RSI_PROTOCOL_UDP_V4, (uint8 *)localDestIp_txrx, localDestSocket_txrx, &bytes_sent); } int main(void) @@ -136,13 +135,13 @@ int main(void) setBoardSta(BOARD_INITING);Initialization();setBoardSta(BOARD_INITED);//初始化系统 setBoardSta(BOARD_RUNNING);//运行中 u8 RspCode;u16 tcpRecvBuffLen;u8 * pRecvData; - memset(data,32,1500); while(1) { + // testMaxWifiSpeed(); if(RSI_WIFI_OPER_MODE == RSI_WIFI_CLIENT_MODE_VAL){ if(IAM_MASTER_CLOCK == 'Y'){ - if(sync_interval_time >= SYNC_INTERVAL_TIME&&Wifi_Send_EN){ + if(sync_interval_time >= SYNC_INTERVAL_TIME){ INFO_LED_CONV();//翻转 sync_interval_time = 0; Send_Sync_Time();//时钟同步一下 diff --git a/USER/wifi_user_main.c b/USER/wifi_user_main.c index 88abce9..9af30e7 100644 --- a/USER/wifi_user_main.c +++ b/USER/wifi_user_main.c @@ -22,7 +22,6 @@ #include "wificonf.h" #include "userwifi.h" #include "typetrans.h" - extern u8 DATA_AUTO_CHECK_EN; #include "rsi_global.h" #include "rsi_config.h" #include "rsi_app_util.h"