|
@@ -24,9 +24,19 @@
|
|
|
|
|
|
//空间及变量定义
|
|
|
#define PROC_MAIN_TASK_STACK_SIZE (1024)
|
|
|
+#define PROC_UART_TASK_STACK_SIZE (1024)
|
|
|
|
|
|
-uint8_t deepslpTimerID = DEEPSLP_TIMER_ID1;
|
|
|
+uint8_t deepslpTimerID = DEEPSLP_TIMER_ID7;
|
|
|
uint8_t MainSlpHandler = 0xff;
|
|
|
+uint8_t UartSlpHandler = 0xfe;
|
|
|
+
|
|
|
+#define Uart_Send_LEN (8)
|
|
|
+#define Uart_Rece_LEN (40)
|
|
|
+
|
|
|
+extern ARM_DRIVER_USART Driver_USART1;
|
|
|
+static ARM_DRIVER_USART *USARTdrv = &Driver_USART1;
|
|
|
+volatile bool isRecvTimeout = false;
|
|
|
+volatile bool isRecvComplete = false;
|
|
|
//状态机定义
|
|
|
typedef enum
|
|
|
{
|
|
@@ -162,21 +172,21 @@ static void Main_Task(void* arg)
|
|
|
Can_index++;
|
|
|
Uart_index++;
|
|
|
NB_index++;
|
|
|
- if (Uart_index >10)//Uart 100ms 调用一次
|
|
|
+ if (Uart_index >100)//Uart 1s 调用一次
|
|
|
{
|
|
|
#ifdef USING_PRINTF
|
|
|
printf("Uart_start \n");
|
|
|
#endif
|
|
|
Uart_index = 0;
|
|
|
}
|
|
|
- if (Can_index >=100)//Can 1000ms 调用一次
|
|
|
+ if (Can_index >=100)//Can 1s 调用一次
|
|
|
{
|
|
|
#ifdef USING_PRINTF
|
|
|
printf("Can_start \n");
|
|
|
#endif
|
|
|
Can_index = 0;
|
|
|
}
|
|
|
- if (NB_index >=100)//NB 10s 调用一次
|
|
|
+ if (NB_index >=100)//NB 1s 调用一次
|
|
|
{
|
|
|
#ifdef USING_PRINTF
|
|
|
printf("NB_start \n");
|