|
@@ -23,9 +23,9 @@
|
|
|
#include "plat_config.h"
|
|
|
|
|
|
//空间及变量定义
|
|
|
-#define PROC_MAIN_TASK_STACK_SIZE (2048)
|
|
|
+#define PROC_MAIN_TASK_STACK_SIZE (1024*2)
|
|
|
#define PROC_UART_TASK_STACK_SIZE (1024)
|
|
|
-#define PROC_CAN_TASK_STACK_SIZE (1024*2)
|
|
|
+#define PROC_CAN_TASK_STACK_SIZE (1024)
|
|
|
#define PROC_TCP_TASK_STACK_SIZE (2048)
|
|
|
#define APP_EVENT_QUEUE_SIZE (10)
|
|
|
uint8_t deepslpTimerID = DEEPSLP_TIMER_ID7;
|
|
@@ -231,16 +231,27 @@ static void Main_Task(void* arg)
|
|
|
|
|
|
slpManRegisterUsrdefinedBackupCb(appBeforeSlp2,NULL,SLPMAN_SLEEP2_STATE);
|
|
|
slpManRegisterUsrdefinedRestoreCb(appAfterSlp2,NULL,SLPMAN_SLEEP2_STATE);
|
|
|
-
|
|
|
+ #ifdef BL_FILE_LOG
|
|
|
+ if(lockoutState)
|
|
|
+ bluejoy_del_logfile();
|
|
|
+ bluejoy_read_logfile();
|
|
|
+ bluejoy_printf(BL_LEVEL3,"processAppTask\n");
|
|
|
+ #endif
|
|
|
slpManSlpState_t slpstate = slpManGetLastSlpState();
|
|
|
|
|
|
#ifdef USING_PRINTF
|
|
|
printf("slpstate:%d \n",slpstate);
|
|
|
#endif
|
|
|
+ #ifdef BL_FILE_LOG
|
|
|
+ bluejoy_printf(BL_LEVEL3,"Last slpstate:%d \n",slpstate);
|
|
|
+ #endif
|
|
|
Wakeup_source = slpManGetWakeupSrc();//获取唤醒源
|
|
|
#ifdef USING_PRINTF
|
|
|
printf("Wakeup_source:%d \n",Wakeup_source);
|
|
|
#endif
|
|
|
+ #ifdef BL_FILE_LOG
|
|
|
+ bluejoy_printf(BL_LEVEL3,"Wakeup_source:%d \n",Wakeup_source);
|
|
|
+ #endif
|
|
|
if (Wakeup_source==0)
|
|
|
{
|
|
|
sleep_time_flag = Wakeup_Work_time;
|
|
@@ -301,6 +312,9 @@ static void Main_Task(void* arg)
|
|
|
{
|
|
|
PROC_TCP_STATE_SWITCH(PROCESS_TCP_STATE_LINK);
|
|
|
Tcp_index = 0;
|
|
|
+ #ifdef BL_FILE_LOG
|
|
|
+ bluejoy_printf(BL_LEVEL3,"Uart_Rece_BattI:%d,sleep_index:%d\n",Uart_Rece_BattI,sleep_index);
|
|
|
+ #endif
|
|
|
}
|
|
|
if((!Can_Enable)&&((Uart_Rece_BattI==0x0000)||(Uart_Rece_BattI==0xffff)))
|
|
|
{
|
|
@@ -334,7 +348,7 @@ static void Main_Task(void* arg)
|
|
|
}
|
|
|
osDelay(10000);
|
|
|
#ifdef USING_PRINTF
|
|
|
- printf("Ms_sleep:uart_%d,can_%d,tcp_%d\r\n",gProcess_Uart_Task,gProcess_Can_Task,gProcess_Tcp_Task);
|
|
|
+ printf("Ms_sleep:uart_%d,can_%d,tcp_%d\r\n",gProcess_Uart_Task,gProcess_Can_Task,gProcess_Tcp_Task);
|
|
|
#endif
|
|
|
slpManSlpState_t State;
|
|
|
uint8_t cnt;
|
|
@@ -749,7 +763,7 @@ static void Can_Task(void* arg)
|
|
|
//加入GPS启动程序
|
|
|
if(gpsMsgQueue == NULL)
|
|
|
{
|
|
|
- gpsMsgQueue = osMessageQueueNew(1,sizeof(GPS_INFO), NULL);
|
|
|
+ gpsMsgQueue = osMessageQueueNew(2,sizeof(GPS_INFO), NULL);
|
|
|
}
|
|
|
osMessageQueueGet(gpsMsgQueue, &Gps_Data, 0, 1000);
|
|
|
#ifdef USING_PRINTF
|
|
@@ -1197,12 +1211,6 @@ static void Tcp_Task(void* arg)
|
|
|
{
|
|
|
Tcp_statuts = 1;
|
|
|
}
|
|
|
- #ifdef BL_FILE_LOG
|
|
|
- if(lockoutState)
|
|
|
- bluejoy_del_logfile();
|
|
|
- bluejoy_read_logfile();
|
|
|
- bluejoy_printf(BL_LEVEL3,"processAppTask\n");
|
|
|
- #endif
|
|
|
NetSocDisplay(LED_SOC_2,LED_TURN_ON);
|
|
|
appSetCFUN(1);
|
|
|
while(true)
|
|
@@ -1404,10 +1412,7 @@ static void Tcp_Task(void* arg)
|
|
|
// }
|
|
|
// printf("\n");
|
|
|
// #endif
|
|
|
- if(gpsbuffer[13]==0x01)
|
|
|
- {
|
|
|
- TcpsendID = send(sockfd, TcpSendBuffer, NB_send_len, 0 );
|
|
|
- }
|
|
|
+ TcpsendID = send(sockfd, TcpSendBuffer, NB_send_len, 0 );
|
|
|
free(TcpSendBuffer);
|
|
|
if (TcpsendID<0)
|
|
|
{
|