| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- #include "User_Dri_main.h"
- extern uint16 sendMessagelength;
- void User_Dri_main(void) //
- {
- TargetRef_Process1(); //转速获取
- #if (Debugg==1)
- {
- /*工具程序*/
- PC_MONITOR_MAIN();
- senddeal();
- }
- #else
- {
- trace2();
- }
- #endif
- }
- void User_Dri_timer1ms(void) //
- {
- if (Uart.uarttimejishu <= 500)
- {
- Uart.uarttimejishu++;
- }
-
- if (Uart.Uart_Tmreset <= 5050)
- {
- Uart.Uart_Tmreset++;
- }
-
- if (Uart.Uart_Tmcomcyc <= 550)
- {
- Uart.Uart_Tmcomcyc++;
- }
-
- if (Uart.Uart_Recivetime <= 200)
- {
- Uart.Uart_Recivetime++;
- }
-
- if ((Uart.TxCnt >= (sendMessagelength - 1)) && (Uart.Uart_Recivetime >= 15))
- {
- Uart.Recive_Flag = 0;
- }
- }
- void TargetRef_Process1(void)
- {
- #if (SPEED_MODE == UARTMODE)// uart调速模式
- {
- #if (Debugg==1)
- Trace_Select_write(); //电脑上位机控制指令
- #endif
-
- #if (Uart_Select==Uart_MoNi)
- UartDealResponse(); //串口上位机数据处理
- #elif (Uart_Select==Uart_Yingjian)
- #if (Uart_COMMUNICATION==0)
- {
- UartDealResponse1();
- }
- #elif (Uart_COMMUNICATION==1)
- {
- UartDealResponse2();
- }
- #endif
- #endif
- }
- #elif (SPEED_MODE == NONEMODE)// 直接上电运行模式
- {
- ConTrolCmd.yajispeed = 5400;//压机闭环目标转速
- ConTrolCmd.fengjispeed = 300; //风机闭环目标转速
- ConTrolCmd.sitongfa = 1;
- }
- #endif
- //ConTrolCmd.yajispeed = 5400;//压机闭环目标转速
- Control_Cmd(); //指令执行
- }
|