|
@@ -358,6 +358,10 @@ Std_ReturnType UART_Send_Data(uint8 transChannel, const uint8 *txBuffer, uint32
|
|
|
ret = xQueueReceive(UartSendQueue[UartIdx],&UartSendMsg,1);
|
|
|
if(ret==pdTRUE)
|
|
|
{
|
|
|
+ if(UartIdx==UART_LPUART0)
|
|
|
+ {
|
|
|
+ Dio_WriteChannel(DioConf_DioChannel_PTB4_GPIO_OUT_MCU_RS485_EN, STD_ON);
|
|
|
+ }
|
|
|
T_Uart_Status[UartIdx] = Uart_AsyncSend(UartIdx, UartSendMsg.dataPtr, UartSendMsg.DataLen);
|
|
|
if (E_OK != T_Uart_Status[UartIdx])
|
|
|
{
|
|
@@ -574,6 +578,10 @@ void UART_Callback(uint32 hwInstance, Lpuart_Uart_Ip_EventType event)
|
|
|
// (void)userData;
|
|
|
Lpuart_Uart_Ip_StateStructureType * UartState;
|
|
|
UartState = (Lpuart_Uart_Ip_StateStructureType *)Lpuart_Uart_Ip_apStateStructuresArray[hwInstance];
|
|
|
+ if (hwInstance==0&&event == LPUART_UART_IP_EVENT_END_TRANSFER)
|
|
|
+ {
|
|
|
+ Dio_WriteChannel(DioConf_DioChannel_PTB4_GPIO_OUT_MCU_RS485_EN, STD_OFF);
|
|
|
+ }
|
|
|
/* Check the event type */
|
|
|
if (event == LPUART_UART_IP_EVENT_RX_FULL)
|
|
|
{
|
|
@@ -1005,9 +1013,23 @@ void MCUSleep(void)
|
|
|
Icu_Init(&Icu_Config_VS_0);
|
|
|
#endif
|
|
|
|
|
|
+#define TIME_S_GPT_WEAKUP(X) ((unsigned int)(1.9073 * (X)))
|
|
|
+ /* 最大定时时间 = 65535/1.907 34365 S
|
|
|
+ * 9.5H
|
|
|
+*/
|
|
|
+ Gpt_StartTimer(GptConf_GptChannelConfiguration_GptChannelConfiguration_LPTMR, TIME_S_GPT_WEAKUP(60));
|
|
|
+ Gpt_EnableWakeup(GptConf_GptChannelConfiguration_GptChannelConfiguration_LPTMR);
|
|
|
+ Gpt_EnableNotification(GptConf_GptChannelConfiguration_GptChannelConfiguration_LPTMR);
|
|
|
+ IP_SCG->SIRCCSR |= SCG_SIRCCSR_SIRCSTEN(1U);
|
|
|
+ Gpt_SetMode(GPT_MODE_SLEEP);
|
|
|
Mcu_SetMode(McuModeSettingConf_VLPS);
|
|
|
|
|
|
|
|
|
+ Mcu_SetMode(McuModeSettingConf_Run);
|
|
|
+ Gpt_GetTimeElapsed(GptConf_GptChannelConfiguration_GptChannelConfiguration_LPTMR);
|
|
|
+ //Gpt_GetTimeElapsed(GptConf_GptChannelConfiguration_GptChannelConfiguration_LPTMR);
|
|
|
+ Gpt_GetTimeRemaining(GptConf_GptChannelConfiguration_GptChannelConfiguration_LPTMR);
|
|
|
+
|
|
|
// typedef void (*AppAddr)(void);
|
|
|
// AppAddr resetHandle = (AppAddr)(0x14601);
|
|
|
// OsIf_SuspendAllInterrupts();
|
|
@@ -1052,7 +1074,7 @@ void SystemDeinit(void)
|
|
|
|
|
|
// Gpt_DisableNotification(GptConf_GptChannelConfiguration_GptChannelConfiguration_0);
|
|
|
|
|
|
- Gpt_DeInit();
|
|
|
+// Gpt_DeInit();
|
|
|
|
|
|
Spi_DeInit();
|
|
|
|
|
@@ -1229,16 +1251,16 @@ void SystemModulesInit(void)
|
|
|
Gpt_Init(&Gpt_Config_VS_0);
|
|
|
|
|
|
/* Enable the Gpt notification to periodically service the Wdg */
|
|
|
-// Gpt_EnableNotification(GptConf_GptChannelConfiguration_GptChannelConfiguration_0);
|
|
|
+ Gpt_EnableNotification(GptConf_GptChannelConfiguration_GptChannelConfiguration_LPIT0_CH0);
|
|
|
|
|
|
//enable the batt power
|
|
|
Dio_WriteChannel(DioConf_DioChannel_PTA1_GPIO_OUT_MCU_BAT_PWR_EN,STD_ON);
|
|
|
|
|
|
Icu_DeInit();
|
|
|
|
|
|
- WdgInit();
|
|
|
-
|
|
|
- IsFeedWdg = true;
|
|
|
+// WdgInit();
|
|
|
+//
|
|
|
+// IsFeedWdg = true;
|
|
|
}
|
|
|
|
|
|
void displayResetReasonWithLED(void)
|