Skip to content

Commit

Permalink
force push
Browse files Browse the repository at this point in the history
  • Loading branch information
Neyzoter committed Jun 27, 2019
1 parent 501d691 commit 8f79811
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 5 deletions.
2 changes: 2 additions & 0 deletions HARDWARE/CAN/can1.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ void CAN1_Mode_Init(u8 tsjw,u8 tbs2,u8 tbs1,u16 brp,u8 mode,u32 * filter_list,u8
}else{ //还有大于等于2个ID没有过滤
ext_id2 = filter_list[filter_num+1];
}
#if PRINT_UART_LOG
printf(" 0x%X , 0x%X \r\n",ext_id1,ext_id2);
#endif
CAN_FilterInitStructure.CAN_FilterIdHigh = (u16)((ext_id1<<3)>>16) & 0xffff;
CAN_FilterInitStructure.CAN_FilterIdLow = (u16)((ext_id1<<3) & 0xffff) | CAN_ID_EXT;
CAN_FilterInitStructure.CAN_FilterMaskIdHigh = (u16)((ext_id2<<3)>>16) & 0xffff;
Expand Down
2 changes: 2 additions & 0 deletions HARDWARE/CAN/can2.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ void CAN2_Mode_Init(u8 tsjw,u8 tbs2,u8 tbs1,u16 brp,u8 mode,u32 * filter_list,u8
}else{ //还有大于等于2个ID没有过滤
ext_id2 = filter_list[filter_num+1];
}
#if PRINT_UART_LOG
printf(" 0x%X , 0x%X \r\n",ext_id1,ext_id2);
#endif
CAN_FilterInitStructure.CAN_FilterIdHigh = (u16)((ext_id1<<3)>>16) & 0xffff;
CAN_FilterInitStructure.CAN_FilterIdLow = (u16)((ext_id1<<3) & 0xffff) | CAN_ID_EXT;
CAN_FilterInitStructure.CAN_FilterMaskIdHigh = (u16)((ext_id2<<3)>>16) & 0xffff;
Expand Down
2 changes: 1 addition & 1 deletion HARDWARE/TIMER/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ void TIM3_IRQHandler(void)
adc_queue.YYYY_MM_DD = YYMMDD;
}
/* 开始发数据了再开始采集*/
if((Wifi_Send_EN == 1) && (ADC_Get_EN == 1)){
if((Wifi_Send_EN) && (ADC_Get_EN)){
/*! @note
// 转换时间 = N * Tconv + (N-1) * 1us,Tconv = 2us for AD7606-4,Tconv = 3us for AD7606-6
// AD7606-4,64 Sample ratio,T = 193
Expand Down
12 changes: 9 additions & 3 deletions HARDWARE/WIFI/userwifi.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
u8 Time_Sync_Flag = 0; //最近时钟是否同步
volatile u8 Wifi_Send_EN = 0; //数据采集和发送使能,是CAN和ADC采集的总开关
u8 CAN_Get_EN = CAN1_ENABLE_BIT_SLC|CAN2_ENABLE_BIT_SLC; //CAN数据发送使能(第0位使能can1,第1位使能can2),默认开启(必须满足Wifi_Send_EN=1,才能采集)
u8 ADC_Get_EN = 0; //ADC数据采集使能,默认开启(必须满足Wifi_Send_EN=1,才能采集)
u8 ADC_Get_EN = 1; //ADC数据采集使能,默认开启(必须满足Wifi_Send_EN=1,才能采集)
Queue adc_queue; //ADC数据存储
Queue can_queue; //can数据存储
u8 localDestIp_txrx[4] = {255,255,255,255};
Expand Down Expand Up @@ -347,16 +347,20 @@ u8 order_anay(u8 arr[])
return NOT_NEED_RETURN_INFO;//表示不需要返回信息
case GET_WIFI_SEND_EN:
//如果启动了本设备
if(arr[1]==nodeId){
if(arr[1] == nodeId){
Wifi_Send_EN =1; //wifi开始发送
CAN_Get_EN = arr[2]&(CAN1_ENABLE_BIT_SLC|CAN2_ENABLE_BIT_SLC);
ADC_Get_EN = arr[3];
}
else{
return NOT_NEED_RETURN_INFO;
}
break;
case GET_WIFI_SEND_DISABLE:
if(arr[1]==nodeId){
Wifi_Send_EN =0;//wifi停止发送
Wifi_Send_EN = 0;//wifi停止发送
CAN_Get_EN = 0;
ADC_Get_EN = 0;
}
else{
return NOT_NEED_RETURN_INFO;
Expand Down Expand Up @@ -402,7 +406,9 @@ u8 order_anay(u8 arr[])
if(strlen((c8*)(arr+1)) < MAX_TEST_NAME_LENGTH){
memset((u8 *)test_name,0,MAX_TEST_NAME_LENGTH);//全部reset为0
strcpy((char *)test_name,(c8*)(arr+1));
#if PRINT_UART_LOG
printf("\r\nGet Test Name : \"%s\"(UTF-8)\r\n",(arr+1));//输出UTF-8中文
#endif
}
break;
case PAGING://寻呼信号
Expand Down
5 changes: 4 additions & 1 deletion HARDWARE/WIFI/wificonf.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ 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
Expand Down Expand Up @@ -320,9 +319,13 @@ void openAllSocket(void){
DATA_AUTO_CHECK_EN= 0;
status = OpenLudpSocket(destIp_txrx,destSocket_txrx,moduleSocket_txrx,&socketDescriptor_txrx);//服务器的数据
if(status != 0){//有问题
#if PRINT_UART_LOG
printf("WiFi Data-UDP Connect Unsuccessfully!\r\n");
#endif
}else if(status == 0){
#if PRINT_UART_LOG
printf("WiFi Data-UDP Connect Successfully!\r\n");
#endif
}
OpenLudpSocket(localDestIp_txrx,localDestSocket_txrx,localModuleSocket_txrx,&localSocketDescriptor_txrx);//局域网内数据传输
OpenLudpSocket(destIp_sync,destSocket_sync,moduleSocket_sync,&socketDescriptor_sync);//时钟同步socket
Expand Down
2 changes: 2 additions & 0 deletions USER/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ void Initialization (void)
}else if(RSI_WIFI_OPER_MODE == RSI_WIFI_AP_MODE_VAL){
OpenSocket((u8*)AP_MODE_SOCKET_DEST_IP,AP_MODE_SOCKET_DEST_PORT,AP_MODE_SOCKET_MODULE_PORT,RSI_SOCKET_TCP_SERVER);
Read_PKT();
#if PRINT_UART_LOG
printf("Open TCP Socket!\r\n");
#endif
}

/*队列配置*/
Expand Down
4 changes: 4 additions & 0 deletions USER/wifi_user_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,9 @@ u8 WIFI_BOOT(void)
RspCode = rsi_sys_init();
if(RspCode != 0)
{
#if PRINT_UART_LOG
printf("Module Sys Inited Unsuccessfully!\r\n");
#endif
return 1;
}
/*加载BOOT*/
Expand All @@ -465,7 +467,9 @@ u8 WIFI_BOOT(void)
/*选择固件*/
RspCode = rsi_select_option(RSI_HOST_BOOTUP_OPTION);
if(RspCode < 0){
#if PRINT_UART_LOG
printf("Module Selected FW Unsuccessfully!\r\n");
#endif
return 1;
}
/*等待card read Rsp=0x89*/
Expand Down

0 comments on commit 8f79811

Please sign in to comment.