Bladeren bron

发布版本V0.2.0.6
Merge branch '4G_ZK_01B-Debug_CJ' into 4G_ZK_01B_Release

LAPTOP-KB7QFH2U\ChenJie-PC 1 jaar geleden
bovenliggende
commit
44412ee9a9

+ 4 - 4
.settings/language.settings.xml

@@ -5,7 +5,7 @@
 			<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
 			<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
 			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
-			<provider class="com.freescale.s32ds.cross.gnu.CrossGCCBuiltinSpecsDetector" console="false" env-hash="-784252839826050432" id="com.freescale.s32ds.cross.gnu.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT S32DS Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
+			<provider class="com.freescale.s32ds.cross.gnu.CrossGCCBuiltinSpecsDetector" console="false" env-hash="-161505450438682623" id="com.freescale.s32ds.cross.gnu.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT S32DS Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
 				<language-scope id="org.eclipse.cdt.core.gcc"/>
 				<language-scope id="org.eclipse.cdt.core.g++"/>
 			</provider>
@@ -16,7 +16,7 @@
 			<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
 			<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
 			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
-			<provider class="com.freescale.s32ds.cross.gnu.CrossGCCBuiltinSpecsDetector" console="false" env-hash="-784252839826050432" id="com.freescale.s32ds.cross.gnu.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT S32DS Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
+			<provider class="com.freescale.s32ds.cross.gnu.CrossGCCBuiltinSpecsDetector" console="false" env-hash="-161505450438682623" id="com.freescale.s32ds.cross.gnu.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT S32DS Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
 				<language-scope id="org.eclipse.cdt.core.gcc"/>
 				<language-scope id="org.eclipse.cdt.core.g++"/>
 			</provider>
@@ -27,7 +27,7 @@
 			<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
 			<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
 			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
-			<provider class="com.freescale.s32ds.cross.gnu.CrossGCCBuiltinSpecsDetector" console="false" env-hash="-784252839826050432" id="com.freescale.s32ds.cross.gnu.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT S32DS Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
+			<provider class="com.freescale.s32ds.cross.gnu.CrossGCCBuiltinSpecsDetector" console="false" env-hash="-161505450438682623" id="com.freescale.s32ds.cross.gnu.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT S32DS Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
 				<language-scope id="org.eclipse.cdt.core.gcc"/>
 				<language-scope id="org.eclipse.cdt.core.g++"/>
 			</provider>
@@ -38,7 +38,7 @@
 			<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
 			<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
 			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
-			<provider class="com.freescale.s32ds.cross.gnu.CrossGCCBuiltinSpecsDetector" console="false" env-hash="-784252839826050432" id="com.freescale.s32ds.cross.gnu.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT S32DS Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
+			<provider class="com.freescale.s32ds.cross.gnu.CrossGCCBuiltinSpecsDetector" console="false" env-hash="-161505450438682623" id="com.freescale.s32ds.cross.gnu.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT S32DS Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
 				<language-scope id="org.eclipse.cdt.core.gcc"/>
 				<language-scope id="org.eclipse.cdt.core.g++"/>
 			</provider>

+ 4 - 3
code/app/AppGlobalVar.c

@@ -35,10 +35,10 @@ uint16 WebSitePort = 8812;
 #endif
 
 //*全局变量*//
-const uint32 AppSwVersion = 0x00020004;
+const uint32 AppSwVersion = 0x00020006;
 const uint8 DataModuleType = 0x02; // 01=NB,02-4G
 const uint16 HwVersion = 0x0102;
-const uint32 BlSwVersion = 0x00000001;
+const uint32 BlSwVersion = 0x00000002;
 const uint32 DrvSwVersion = 0x00000004;
 const uint8 BmsManuFacture = 0xff;
 const uint8 BmsInfo = 0xff;
@@ -50,6 +50,7 @@ uint16 ErrorArray[10] = {0};
 uint8 Fota_update_flag = 0;
 boolean Fota_Process_Going = false;
 uint8 Fota_error_flag = 0;
+uint8 DeviceErrNum = 0;
 /*GPS*/
 QueueHandle_t GpsDataQueueHandle;
 sint16 xyzData[3] = {0};
@@ -180,7 +181,7 @@ UINT8 BMS_CharSysNum = 0x00;					// 可充电储能子系统总数(保留),,Re-1
 UINT8 BMS_FtCode = 0x00;						// 电池系统故障码,详见附表电池系统故障码列表,Re-1,Off-0,
 UINT8 BMS_ST1CheckSum = 0x00;					// B2V_ST1的CheckSum,Byte0=Byte1 XOR Byte2 XOR Byte3 XOR Byte4 XOR Byte5 XOR Byte6 XOR Byte7,Re-1,Off-0,
 UINT8 BMS_ST1Counter = 0x00;					// B2V_ST1的生命信号,0~14循环,15:信号无效,Re-1,Off-0,
-UINT8 BMS_Mode = 0x00;							// BMS当前状态,0:预留;1:高压上电;2:高压下电;3:无效;,Re-1,Off-0,
+UINT8 BMS_Mode = 0x00;							// BMS当前状态,和新版协议不匹配
 UINT8 BMS_AuxRlySt = 0x00;						// 附件继电器状态,0:开启;1:闭合;,Re-1,Off-0,
 UINT8 BMS_BattBalaSt = 0x00;					// BMS当前均衡状态,0:未开启均衡;1:开启均衡;,Re-1,Off-0,
 UINT8 BMS_CharGunSt = 0x00;						// 直流充电枪连接状态,0:未连接1 : 连接, Re - 1, Off - 0,

+ 6 - 3
code/app/AppGlobalVar.h

@@ -76,10 +76,13 @@ extern uint16 WebSitePort;
 extern char ImeiNum[15];
 extern char IccidNum[20];
 extern uint8 TcpWorkState;
+extern uint8 DeviceErrNum;
 typedef struct _AppEppType
 {
-    uint32 battDischrgAccCap;
-    uint32 battDischrgAccEnrg;
+    uint32 battDischrgAccCap;//单位mah
+    uint32 battChrgAccCap;//单位mah
+    uint32 battDischrgAccEnrg;//单位wh
+    uint32 battChrgAccEnrg;//单位wh
     uint16 battCycleTimes;
     uint32 AccMileage;
 } AppEppBody;
@@ -89,7 +92,7 @@ typedef struct _AppConfigType
     bool eolFlg;
     uint8 deviceSn[17];
     AppEppBody AppDataInfo;
-    uint8 re[20];
+    uint8 re[128];
 } AppConfigBody;
 extern AppConfigBody AppConfigInfo;
 

+ 39 - 6
code/app/AppTaskCan.c

@@ -15,7 +15,7 @@ static uint8 BattSendFlg = 0;
 static void UDSAnsFunc(uint8 *rawData);
 static void UdsAns(bool PosFlg, uint8 UdsService, uint8 UdsSubService, uint8 Idx, uint8 *AnsData, uint8 AnsDataLen);
 static void BattSendFunc(void);
-
+static void CalAccAhFunc(void);
 void CanTask(void *pvParameters)
 {
 	uint32 timerCANIdle = 0x00;
@@ -40,7 +40,7 @@ void CanTask(void *pvParameters)
 				{
 					DoRoutinePositiveAnswer();
 					RequestEnterBootloader();
-					SystemSoftwareReset();
+					DoResetECUWithWdg();
 					break;
 				}
 				else
@@ -66,8 +66,41 @@ void CanTask(void *pvParameters)
 			timerCANIdle = timerCANIdle + 100;
 			BcuRxDiagnose();
 			timerCounterNow = TimerCounter;
+			//累计放电Ah和充电Ah积分计算
+			CalAccAhFunc();
+		}
+	}
+}
+static void CalAccAhFunc(void)//100ms运行一次
+{
+	static float tmp_DischrgAh = 0;//mah
+	static float tmp_ChrgAh = 0;//mah
+//	if(BcuRxLongError[3]==0 && (BcuRxLongError[24]==1||BcuRxShortError[24]==1))//在CAN消息正常,CAN[24]存在时间长的问题,不建议用丢帧处理
+	if(BcuRxLongError[3]==0 && BMS_Mode==0)
+	{
+		if(BMS_CharSt==1)//1是正在充电
+		{
+			tmp_ChrgAh = tmp_ChrgAh + (float)(abs(BMS_PackCurr - 10000)/360);
+		}
+		else//放电计算
+		{
+			tmp_DischrgAh = tmp_DischrgAh + (float)(abs(BMS_PackCurr - 10000)/360);
+		}
+		if(tmp_ChrgAh>1000)
+		{
+			AppConfigInfo.AppDataInfo.battChrgAccCap = AppConfigInfo.AppDataInfo.battChrgAccCap + (uint32)tmp_ChrgAh;
+			tmp_ChrgAh = 0;
+			AppConfigInfo.appSaveFlg = 1;
+		}
+		if(tmp_DischrgAh>1000)
+		{
+			AppConfigInfo.AppDataInfo.battDischrgAccCap = AppConfigInfo.AppDataInfo.battDischrgAccCap + (uint32)tmp_DischrgAh;
+			tmp_DischrgAh = 0;
+			AppConfigInfo.appSaveFlg = 1;
 		}
 	}
+	BMS_TotalCharCapy = AppConfigInfo.AppDataInfo.battChrgAccCap/100;
+	BMS_TotalDisCharCapy = AppConfigInfo.AppDataInfo.battDischrgAccCap/100;
 }
 // 注意解码超限问题
 void BcuDecodeFunction(uint32 ID, uint8 *rawData)
@@ -497,7 +530,7 @@ static void UDSAnsFunc(uint8 *rawData)
 				UdsAns(true, UdsService, UdsSubService, 0x00, AnsData, 4);
 				AppConfigInfo.appSaveFlg = true;
 				vTaskDelay(pdMS_TO_TICKS(1000));
-				SystemSoftwareReset();
+				DoResetECUWithWdg();
 				break;
 			}
 			default:
@@ -1203,9 +1236,9 @@ void BcuRxMsgSetInvalidValue(uint32 ID)
 		BMS_TotalGunCharCapy = 0xFFFFFFFF;
 		break;
 	case 0x18F4D0F3:
-		BMS_TotalCharCapy = 0xFFFFFFFF;
-		BMS_TotalDisCharCapy = 0xFFFFFFFF;
-		BMS_SingleCharCapy = 0xFFFF;
+//		BMS_TotalCharCapy = 0xFFFFFFFF;
+//		BMS_TotalDisCharCapy = 0xFFFFFFFF;
+//		BMS_SingleCharCapy = 0xFFFF;
 		break;
 	case 0x18F5D0F3:
 		BMS_TotalBackCharCapy = 0xFFFFFFFF;

+ 1 - 1
code/app/AppTaskMain.c

@@ -41,7 +41,7 @@ void MainTask(void *pvParameters)
 			AppConfigInfo.appSaveFlg = false;
 			HAL_EEP_Write(0, (uint8 *)&AppConfigInfo, sizeof(AppConfigInfo));
 		}
-		if (Fota_update_flag || Fota_error_flag)
+		if (Fota_update_flag==1)
 		{
 			// 重启前保存数据
 			AppConfigInfo.appSaveFlg = false;

+ 36 - 7
code/app/AppTaskUart1.c

@@ -161,6 +161,11 @@ void Uart_4G_Task(void *pvParameters)
 					PROC_TCP_STATE_SWITCH(PROCESS_TCP_ERROR);
 				}
 			}
+			if(Fota_error_flag==1)
+			{
+				SocketId = -1;
+				PROC_TCP_STATE_SWITCH(PROCESS_TCP_ERROR);
+			}
 			break;
 		}
 		case PROCESS_TCP_RECV: // 网络数据接收,100ms空闲状态下即可接收
@@ -190,13 +195,14 @@ void Uart_4G_Task(void *pvParameters)
 		{
 			vTaskDelay(pdMS_TO_TICKS(1000));
 			tcpErrorCounter++;
-			if (tcpErrorCounter > 60 || TcpSysReboot == 1) // 无法驻网或者联网
+			if (tcpErrorCounter > 60 || TcpSysReboot == 1||Fota_error_flag == 1) // 无法驻网或者联网或者FTP失败
 			{
 				Dio_WriteChannel(DioConf_DioChannel_PTA7_GPIO_OUT_MCU_4G_PWRKEY, STD_ON);
 				vTaskDelay(pdMS_TO_TICKS(2500));
 				Dio_WriteChannel(DioConf_DioChannel_PTA7_GPIO_OUT_MCU_4G_PWRKEY, STD_OFF);
 				vTaskDelay(pdMS_TO_TICKS(2500));
 				tcpErrorCounter = 0;
+				Fota_error_flag = 0;
 				PROC_TCP_STATE_SWITCH(PROCESS_TCP_INIT);
 			}
 			else
@@ -243,6 +249,23 @@ static void TcpDataSendFeqHandFunc(uint8* DataIdx)
 			*DataIdx = 0;
 		}
 	}
+	//以下为发送频率可变判定
+	if(BMS_CharSt==1)//充电中
+	{
+		TcpDataFeq.GpsFeqCnt[1] = 60*3;
+		TcpDataFeq.TrkBattFeqCnt[1]  = 10;
+	}
+	else if(BMS_Mode==0)//放电中
+	{
+		TcpDataFeq.GpsFeqCnt[1] = 10;
+		TcpDataFeq.TrkBattFeqCnt[1]  = 30;
+	}
+	else//没有上高压状态
+	{
+		TcpDataFeq.GpsFeqCnt[1] = 60;
+		TcpDataFeq.TrkBattFeqCnt[1]  = 60;
+	}
+
 	return;
 }
 sint8 TcpDataSendFunc(sint8 ConnectId,uint8 DataSendIdxIn)
@@ -944,7 +967,7 @@ void TcpDataEncode(uint8 DataIdx,uint32 *PtrSendAddr, uint16 *SendLen)
 								{%.2f,%.2f,%.2f,%.2f,%.2f;\
 								%.2f,%.2f,%.2f,%.2f,%.2f,}\
 								{%.2f,%.2f,%.2f,%.2f,%.2f;\
-								%.2f,%.2f,%.2f,%.2f,%.2f,},%s",
+								%.2f,%.2f,%.2f,%.2f,%.2f,},%s,%d",
 				returnFreq[0][0], returnFreq[0][1], returnFreq[0][2], returnFreq[0][3], returnFreq[0][4],
 				returnP[0][0], returnP[0][1], returnP[0][2], returnP[0][3], returnP[0][4],
 
@@ -952,7 +975,7 @@ void TcpDataEncode(uint8 DataIdx,uint32 *PtrSendAddr, uint16 *SendLen)
 				returnP[1][0], returnP[1][1], returnP[1][2], returnP[1][3], returnP[1][4],
 
 				returnFreq[2][0], returnFreq[2][1], returnFreq[2][2], returnFreq[2][3], returnFreq[2][4],
-				returnP[2][0], returnP[2][1], returnP[2][2], returnP[2][3], returnP[2][4],tmp);
+				returnP[2][0], returnP[2][1], returnP[2][2], returnP[2][3], returnP[2][4],tmp,DeviceErrNum);
 
 		BufferLen = strlen((const char *)rbuf);
 		*SendLen = BufferLen + sizeof(DebugMsgInfo);
@@ -1085,8 +1108,8 @@ void TcpDataEncode(uint8 DataIdx,uint32 *PtrSendAddr, uint16 *SendLen)
 		*(SendBuffer + 0x23) = (UTC8TimeTcp.minute & 0xFF);	   // uint8	minute
 		*(SendBuffer + 0x24) = (UTC8TimeTcp.second & 0xFF);	   // uint8	second
 		*(SendBuffer + 0x25) = (CSQValue & 0xFF);			   // uint8	csq
-		*(SendBuffer + 0x26) = (BMS_Mode & 0xFF);			   // uint8	电池管理系统工作状态,0-初始化 1-自检完成允许上电 2-运行状态 3-高压切断 4-故障状态,精度_1,偏移量_0,单位_
-		*(SendBuffer + 0x27) = (BMS_CharGunSt & 0xFF);		   // uint8	直流充电枪连接状态,0-未连接 1-单枪连接 2-双枪连接 3-无效,精度_1,偏移量_0,单位_
+		*(SendBuffer + 0x26) = (BMS_Mode & 0xFF);			   // uint8	BMS当前状态,0:预留;1:高压上电;2:高压下电;3:无效;,Re-1,Off-0,
+		*(SendBuffer + 0x27) = (BMS_CharGunSt & 0xFF);		   // uint8	直流充电枪连接状态,0:未连接1 : 连接, Re - 1, Off - 0,
 		*(SendBuffer + 0x28) = (BMS_FtLvl & 0xFF);			   // uint8	当前最高故障等级,0-正常 1-1级 轻微故障 2-2级 较严重故障 3-3级 最严重故障,精度_1,偏移量_0,单位_
 		*(SendBuffer + 0x29) = (BMS_FtCode & 0xFF);			   // uint8	故障码,见BMS_ErrCode,精度_1,偏移量_0,单位_
 		*(SendBuffer + 0x2A) = (BMS_ReqHVOff & 0xFF);		   // uint8	BMS下高压请求,0-无效 1-请求下高压 2-不请求下高压 3-无效,精度_1,偏移量_0,单位_
@@ -1581,6 +1604,7 @@ void Fota_Ftp(uint8 *dataPtrIn)
 			}
 			else
 			{
+				DeviceErrNum = 10;
 				ftp_EndFlg = 1;
 			}
 			break;
@@ -1597,6 +1621,7 @@ void Fota_Ftp(uint8 *dataPtrIn)
 			}
 			else
 			{
+				DeviceErrNum = 11;
 				ftp_EndFlg = 1;
 			}
 			break;
@@ -1613,6 +1638,7 @@ void Fota_Ftp(uint8 *dataPtrIn)
 			}
 			else
 			{
+				DeviceErrNum = 12;
 				ftp_EndFlg = 1;
 			}
 			break;
@@ -1629,6 +1655,7 @@ void Fota_Ftp(uint8 *dataPtrIn)
 			}
 			else
 			{
+				DeviceErrNum = 13;
 				ftp_EndFlg = 1;
 			}
 			break;
@@ -1758,16 +1785,19 @@ void Fota_Ftp(uint8 *dataPtrIn)
 					if (getDataLenErrCount < 50 && Hal_FlsCheckIsTransferSucceed() == TRUE)
 					{
 						ftp_process++;
+						Fota_update_flag = 1;
 					}
 					else
 					{
 						ftp_process++;
+						DeviceErrNum = 15;
 					}
 				}
 			}
 			else
 			{
 				ftp_process++;
+				DeviceErrNum = 14;
 			}
 			break;
 		}
@@ -1777,7 +1807,6 @@ void Fota_Ftp(uint8 *dataPtrIn)
 			sprintf(ATSendDataBuffer, "AT+FSDEL=*.*\r\n");
 			UART_Query_Data(UART_LPUART1, UART_LPUART1, ATSendDataBuffer, mstrlen(ATSendDataBuffer), UartRecvBuffer, &ReadLen, pdMS_TO_TICKS(5000));
 			ftp_process++;
-			Fota_update_flag = TRUE;
 			break;
 		}
 		default:
@@ -1785,7 +1814,7 @@ void Fota_Ftp(uint8 *dataPtrIn)
 			break;
 		}
 	}
-	if (ftp_process < 6)
+	if (Fota_update_flag==0)
 	{
 		Fota_error_flag = 1;
 	}

+ 4 - 4
code/hal/Hal_Wdg.c

@@ -111,10 +111,10 @@ void DoResetECUWithWdg(void)
 {
 	IsFeedWdg = FALSE;
 	Wdg_43_Instance0_SetTriggerCondition(0);
-//	while(1)
-//	{
+	while(1)
+	{
 //		AppAddr resetHandle = (AppAddr)(0x00);
 //		    (resetHandle)();
-//		;
-//	}
+		;
+	}
 }

+ 46 - 20
code/hal/hal_adapter.c

@@ -662,6 +662,10 @@ Std_ReturnType CanIf_SendMessage(uint8 ControllerId, Can_Msg_Type CanMsg)
             u8TimeOut--;
         }
     }
+    else //send message fail, we need to recover the send function by make the can controller bus off
+    {
+    	Can_MainFunction_BusOff();
+    }
 
     if (CanIf_bTxFlag == TRUE)
     {
@@ -695,6 +699,7 @@ Can_Msg_Type Can_GetMsgInfo(Can_IdType id, uint8 length, uint8 *sdu)
 void CanIf_ControllerBusOff(uint8 ControllerId)
 {
     (void)ControllerId;
+    Can_SetControllerMode(ControllerId, CAN_CS_STARTED);  //if the bus off occured, we need to restart the can controller
 }
 
 void CanIf_ControllerModeIndication(uint8 ControllerId, Can_ControllerStateType ControllerMode)
@@ -1011,6 +1016,14 @@ void MCUSleep(void)
 //	coreInit();
 }
 
+void LPTMR_WakeUp_Notification(void)
+{
+	Mcu_InitClock(McuClockSettingConfig_0);
+	Mcu_SetMode(McuModeSettingConf_Run);
+	Gpt_StopTimer(GptConf_GptChannelConfiguration_GptChannelConfiguration_LPTMR);
+	Gpt_DisableWakeup(GptConf_GptChannelConfiguration_GptChannelConfiguration_LPTMR);
+	Gpt_DisableNotification(GptConf_GptChannelConfiguration_GptChannelConfiguration_LPTMR);
+}
 
 void SystemDeinit(void)
 {
@@ -1037,7 +1050,7 @@ void SystemDeinit(void)
 
 	Adc_DeInit();
 
-	Gpt_DisableNotification(GptConf_GptChannelConfiguration_GptChannelConfiguration_0);
+//	Gpt_DisableNotification(GptConf_GptChannelConfiguration_GptChannelConfiguration_0);
 
 	Gpt_DeInit();
 
@@ -1070,13 +1083,20 @@ void MCUEnterSleep(void)
 {
 	if(pdTRUE == xSemaphoreTake(sleep_mutex,1) && Fota_Process_Going == false)
 	{
-		extern boolean Uart_4G_Task_Sleep_FLag;
-		WdgDeInit();
-		Std_ReturnType Ret = E_NOT_OK;
-		uint8 appConfigWriteTimes = 0;
-		do
+		// if the IO wakeup exists(high side), the mcu should not go to vlps, either.
+		Dio_LevelType wakeup1,wakeup2 = STD_HIGH;
+		wakeup1 = Dio_ReadChannel(DioConf_DioChannel_PTB0_GPIO_IN_MCU_WAKEUP1);
+		wakeup2 = Dio_ReadChannel(DioConf_DioChannel_PTE2_GPIO_IN_MCU_WAKEUP2);
+
+		if(wakeup1==STD_LOW && wakeup2 == STD_LOW)
 		{
-			waitForSleepFlag = true;
+			extern boolean Uart_4G_Task_Sleep_FLag;
+			WdgDeInit();
+			Std_ReturnType Ret = E_NOT_OK;
+			uint8 appConfigWriteTimes = 0;
+			do
+			{
+				waitForSleepFlag = true;
 
 			//save the app configure before power off
 			if(Ret == E_NOT_OK)
@@ -1087,20 +1107,19 @@ void MCUEnterSleep(void)
 			}
 
 			vTaskDelay(pdMS_TO_TICKS(10));
-		}while(Uart_4G_Task_Sleep_FLag == false || (Ret == E_NOT_OK && appConfigWriteTimes<5) );
+			}while(Uart_4G_Task_Sleep_FLag == false || (Ret == E_NOT_OK && appConfigWriteTimes<5) );
 
-		vTaskDelete(Uart_Hal_RecvTask_Handle);
-		vTaskDelete(Uart_Hal_SendTask_Handle);
-		vTaskDelete(CanTask_Handle);
-		vTaskDelete(GpsTask_Handle);
-		vTaskDelete(Uart_4G_Task_Handle);
-//		vTaskDelete(MainTask_Handle);
+			vTaskDelete(Uart_Hal_RecvTask_Handle);
+			vTaskDelete(Uart_Hal_SendTask_Handle);
+			vTaskDelete(CanTask_Handle);
+			vTaskDelete(GpsTask_Handle);
+			vTaskDelete(Uart_4G_Task_Handle);
+//			vTaskDelete(MainTask_Handle);
 
-		SystemDeinit();
+			SystemDeinit();
 
-		MCUSleep();
-//		WdgInit();
-//		DoResetECUWithWdg();
+			MCUSleep();
+		}
 	}
 }
 
@@ -1141,7 +1160,7 @@ void SystemModulesInit(void)
 	/* Initialize Mcl module */
 	Mcl_Init(NULL_PTR);
 
-	SEGGER_RTT_Init();
+//	SEGGER_RTT_Init();
 
 
 	/* Initializes an UART driver*/
@@ -1176,6 +1195,13 @@ void SystemModulesInit(void)
 	Adc_Init(&Adc_Config_VS_0);
 #endif /* ADC_PRECOMPILE_SUPPORT == STD_ON */
 
+	//the calibration is needed to increase the ADC accuracy
+	Adc_CalibrationStatusType CalibStatus;
+	Adc_Calibrate(AdcHwUnit_1, &CalibStatus);
+	if (CalibStatus.Adc_UnitSelfTestStatus == E_NOT_OK)
+	{
+		// if so, the adc is failed to Calibrate;
+	}
 	/* Partition only if it was not partitioned before for EERAM with code 0x4 */
 //    Eep_DepartParitition(T_EEEPROM_SIZE);
 	/* Initialize Eep driver */
@@ -1201,7 +1227,7 @@ 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_0);
 
 	Icu_DeInit();
 

+ 1 - 1
code/hal/hal_adapter.h

@@ -116,7 +116,7 @@ typedef enum
     UartSendOnGoing,
     UartSendComplete,
     UartNoDataSend,
-};
+}UartState;
 typedef enum
 {
     SystemTPChannel = 0,

+ 9 - 7
generate/include/Adc_CfgDefines.h

@@ -350,7 +350,7 @@ extern "C"{
 * @details         Values generated are the ADC Logical Unit ID selected from configurator.
 *                  These defines are recommended to be used with any ADC driver API that takes as input parameter Adc Unit.
 */
-#define AdcHwUnit_0                               (0U)
+#define AdcHwUnit_1                               (0U)
 
 /**
 * @brief          Adc channel id.
@@ -396,17 +396,19 @@ extern "C"{
 #define AdcGroupSoftwareOneShot_Adc1_VREFH                   (0U)
 #define AdcGroupSoftwareOneShot_Adc1_BANDGAP                   (1U)
 #define AdcGroupSoftwareOneShot_Adc1_VREFL                   (2U)
-#define AdcGroupSoftwareOneShot_PTE6_ADC1_SE11_MCU_SYS_TP                   (3U)
+#define AdcGroupSoftwareOneShot_PTB12_ADC1_SE7_MCU_TP1                   (3U)
 #define AdcGroupSoftwareOneShot_PTD4_ADC1_SE6_MCU_TP2                   (4U)
-#define AdcGroupSoftwareOneShot_PTB12_ADC1_SE7_MCU_TP1                   (5U)
-#define AdcGroupSoftwareOneShot_PTC7_ADC1_SE5_MCU_TP3                   (6U)
+#define AdcGroupSoftwareOneShot_PTC7_ADC1_SE5_MCU_TP3                   (5U)
+#define AdcGroupSoftwareOneShot_PTC6_ADC1_SE4_MCU_TP4                   (6U)
+#define AdcGroupSoftwareOneShot_PTE6_ADC1_SE11_MCU_SYS_TP                   (7U)
 #define AdcGroupHardwareOneShot_Adc1_VREFH                   (0U)
 #define AdcGroupHardwareOneShot_Adc1_BANDGAP                   (1U)
 #define AdcGroupHardwareOneShot_Adc1_VREFL                   (2U)
-#define AdcGroupHardwareOneShot_PTE6_ADC1_SE11_MCU_SYS_TP                   (3U)
+#define AdcGroupHardwareOneShot_PTB12_ADC1_SE7_MCU_TP1                   (3U)
 #define AdcGroupHardwareOneShot_PTD4_ADC1_SE6_MCU_TP2                   (4U)
-#define AdcGroupHardwareOneShot_PTB12_ADC1_SE7_MCU_TP1                   (5U)
-#define AdcGroupHardwareOneShot_PTC7_ADC1_SE5_MCU_TP3                   (6U)
+#define AdcGroupHardwareOneShot_PTC7_ADC1_SE5_MCU_TP3                   (5U)
+#define AdcGroupHardwareOneShot_PTC6_ADC1_SE4_MCU_TP4                   (6U)
+#define AdcGroupHardwareOneShot_PTE6_ADC1_SE11_MCU_SYS_TP                   (7U)
 
 /**
 * @brief           Symbolic names of groups.

+ 1 - 1
generate/include/Adc_Ip_CfgDefines.h

@@ -105,7 +105,7 @@ extern "C"{
 #define ADC_IP_TIMEOUT_TYPE                    (OSIF_COUNTER_DUMMY)
 #define ADC_IP_TIMEOUT_VAL                     (100000UL)
 #define ADC_IP_ENABLE_USER_MODE_SUPPORT        (STD_OFF)
-#define ADC_IP_SUPPLY_MONITORING_ENABLED       (STD_OFF)
+#define ADC_IP_SUPPLY_MONITORING_ENABLED       (STD_ON)
 #define ADC_IP_ENABLE_SIM_SOURCE_SELECTION     (STD_OFF)
 
 /*! @brief ADC default Sample Time from RM */

+ 2 - 2
generate/include/Adc_VS_0_PBcfg.h

@@ -97,8 +97,8 @@ extern "C"{
 *
 */
 
-#define ADC_CFGSET_VS_0_GROUP_0_CHANNELS      (7U)
-#define ADC_CFGSET_VS_0_GROUP_1_CHANNELS      (7U)
+#define ADC_CFGSET_VS_0_GROUP_0_CHANNELS      (8U)
+#define ADC_CFGSET_VS_0_GROUP_1_CHANNELS      (8U)
 
 /**
 * @brief          Total number of groups in Config.

+ 2 - 2
generate/include/Ftm_Gpt_Ip_Cfg.h

@@ -87,7 +87,7 @@ extern "C"{
 * @brief   Dev error detect switch
 * @details Enable/disable GptDevErrorDetect
 */
-#define FTM_GPT_IP_DEV_ERROR_DETECT (STD_OFF)
+#define FTM_GPT_IP_DEV_ERROR_DETECT (STD_ON)
 
 /*================================================================================================*/
 /**
@@ -101,7 +101,7 @@ extern "C"{
 * @brief    FTM_GPT_IP_CHANGE_NEXT_TIMEOUT_VALUE switch
 * @details  Enable/disable support for changing timeout value during timer running
 */
-#define FTM_GPT_IP_CHANGE_NEXT_TIMEOUT_VALUE     (STD_OFF)
+#define FTM_GPT_IP_CHANGE_NEXT_TIMEOUT_VALUE     (STD_ON)
 /*================================================================================================*/
 /**
 * @brief    FTM_GPT_IP_ENABLE_USER_MODE_SUPPORT switch

+ 11 - 9
generate/include/Gpt_Cfg.h

@@ -97,13 +97,13 @@ extern "C"{
 * @brief    GPT_DEV_ERROR_DETECT switch
 * @details  Enable/disable GPT_DEV_ERROR_DETECT.
 */
-#define GPT_DEV_ERROR_DETECT (STD_OFF)
+#define GPT_DEV_ERROR_DETECT (STD_ON)
 /*================================================================================================*/
 /**
 * @brief    GPT_REPORT_WAKEUP_SOURCE switch
 * @details  Enable/disable GPT_REPORT_WAKEUP_SOURCE.
 */
-#define GPT_REPORT_WAKEUP_SOURCE (STD_OFF)
+#define GPT_REPORT_WAKEUP_SOURCE (STD_ON)
 
 /*================================================================================================*/
 /**
@@ -140,14 +140,14 @@ extern "C"{
 * @brief    GPT_WAKEUP_FUNCTIONALITY_API switch
 * @details  Enable/disable GPT_VERSION_INFO_API.
 */
-#define GPT_WAKEUP_FUNCTIONALITY_API (STD_OFF)
+#define GPT_WAKEUP_FUNCTIONALITY_API (STD_ON)
 
 /*================================================================================================*/
 /**
 * @brief    GPT_CHANGE_NEXT_TIMEOUT_VALUE switch
 * @details  Enable/disable support for changing timeout value during timer running
 */
-#define GPT_CHANGE_NEXT_TIMEOUT_VALUE     (STD_OFF)
+#define GPT_CHANGE_NEXT_TIMEOUT_VALUE     (STD_ON)
 
 /*================================================================================================*/
 /**
@@ -171,7 +171,7 @@ extern "C"{
 *           the interrupt enable bit and also should not disable the counter, during init *(Gpt_Rtc_Init()) the flag is already set.
 *
 */
-#define GPT_STANDBY_WAKEUP_SUPPORT    (STD_OFF)
+#define GPT_STANDBY_WAKEUP_SUPPORT    (STD_ON)
 /*================================================================================================*/
 /**
 * @brief    GPT_ENABLE_USER_MODE_SUPPORT switch
@@ -215,9 +215,11 @@ extern "C"{
 * @brief        Define symbolic names of channels
 * @details      Symbolic names of channels.
 */
-    #define GptConf_GptChannelConfiguration_GptChannelConfiguration_0  (0U)
+    #define GptConf_GptChannelConfiguration_GptChannelConfiguration_LPIT0_CH0  (0U)
             
-    #define GptConf_GptChannelConfiguration_GptChannelConfiguration_1  (1U)
+    #define GptConf_GptChannelConfiguration_GptChannelConfiguration_FTM  (1U)
+            
+    #define GptConf_GptChannelConfiguration_GptChannelConfiguration_LPTMR  (2U)
             
 
 
@@ -228,7 +230,7 @@ extern "C"{
 * @brief       GPT_HW_CHANNEL_NUM
 * @details     The maximum number of HW channels. This is used to allocate memory space for channel runtime info.
 */
-#define GPT_HW_CHANNEL_NUM   (2U)
+#define GPT_HW_CHANNEL_NUM   (3U)
 
 /*================================================================================================*/
 /**
@@ -245,7 +247,7 @@ extern "C"{
 * @brief        GPT_NUM_CONFIG.
 * @details      Number of ChannelConfiguration
 */
-#define GPT_NUM_CONFIG             (2U)
+#define GPT_NUM_CONFIG             (3U)
 /**
 *   @brief      GPT_HW_PREDEFTIMER_NUM
 *   @details    Number of Predefined timers supported

+ 2 - 2
generate/include/Gpt_Ipw_VS_0_PBcfg.h

@@ -106,12 +106,12 @@ extern "C"
 /** 
  * @brief   Gpt HwInstanceConfig configuration array
  */
-extern Gpt_Ipw_HwInstanceConfigType Gpt_Ipw_HwInstanceConfig_PB_VS_0[2U];
+extern Gpt_Ipw_HwInstanceConfigType Gpt_Ipw_HwInstanceConfig_PB_VS_0[3U];
 
 /** 
  * @brief   Gpt channels IP related configuration array
  */
-extern Gpt_Ipw_HwChannelConfigType Gpt_Ipw_ChannelConfig_PB_VS_0[2U];
+extern Gpt_Ipw_HwChannelConfigType Gpt_Ipw_ChannelConfig_PB_VS_0[3U];
 
 
 

+ 2 - 0
generate/include/IntCtrl_Ip_Cfg.h

@@ -109,6 +109,7 @@ extern void LPUART_UART_IP_1_IRQHandler(void);
 extern void LPUART_UART_IP_2_IRQHandler(void);
 extern void Adc_1_Isr(void);
 extern void LPIT_0_CH_0_ISR(void);
+extern void Lptmr_0_Ch_0_ISR(void);
 extern void PORT_CI_ICU_IP_A_EXT_IRQ_ISR(void);
 extern void PORT_CI_ICU_IP_B_EXT_IRQ_ISR(void);
 extern void PORT_CI_ICU_IP_D_EXT_IRQ_ISR(void);
@@ -126,6 +127,7 @@ extern void CAN1_ORED_16_31_MB_IRQHandler(void);
 extern void CAN2_ORED_IRQHandler(void);
 extern void CAN2_Error_IRQHandler(void);
 extern void CAN2_ORED_0_15_MB_IRQHandler(void);
+extern void FTM_0_CH_0_CH_1_ISR(void);
 
 
 

+ 1 - 1
generate/include/LPit_Gpt_Ip_Cfg.h

@@ -86,7 +86,7 @@ extern "C"{
 /**
 * @brief Dev error detect switch
 */
-#define LPIT_GPT_IP_DEV_ERROR_DETECT (STD_OFF)
+#define LPIT_GPT_IP_DEV_ERROR_DETECT (STD_ON)
 
 /*==================================================================================================*/
 /**

File diff suppressed because it is too large
+ 0 - 0
generate/include/LPit_Gpt_Ip_Cfg_Defines.h


+ 2 - 2
generate/include/Lptmr_Gpt_Ip_Cfg.h

@@ -86,7 +86,7 @@ extern "C"{
 /**
 * @brief Dev error detect switch
 */
-#define LPTMR_GPT_IP_DEV_ERROR_DETECT (STD_OFF)
+#define LPTMR_GPT_IP_DEV_ERROR_DETECT (STD_ON)
 
 /**
 * @brief    LPTMR_GPT_IP_ENABLE_USER_MODE_SUPPORT switch
@@ -98,7 +98,7 @@ extern "C"{
 * @brief    LPTMR_GPT_IP_STANDBY_WAKEUP_SUPPORT 
 * @details  StandBy Mode is not supported in this release
 */
-#define LPTMR_GPT_IP_STANDBY_WAKEUP_SUPPORT    (STD_OFF)
+#define LPTMR_GPT_IP_STANDBY_WAKEUP_SUPPORT    (STD_ON)
 
 /*==================================================================================================
 *                                             ENUMS

+ 1 - 0
generate/include/Lptmr_Gpt_Ip_VS_0_PBcfg.h

@@ -101,6 +101,7 @@ extern "C"
 #define GPT_START_SEC_CONFIG_DATA_UNSPECIFIED
 #include "Gpt_MemMap.h"
 
+extern Lptmr_Gpt_Ip_ConfigType LPTMR_0_InitConfig_PB_VS_0;
 
 
 #define GPT_STOP_SEC_CONFIG_DATA_UNSPECIFIED

+ 2 - 2
generate/include/SRtc_Ip_Cfg.h

@@ -86,7 +86,7 @@ extern "C"{
 /**
 * @brief Dev error detect switch
 */
-#define SRTC_IP_DEV_ERROR_DETECT (STD_OFF)
+#define SRTC_IP_DEV_ERROR_DETECT (STD_ON)
 
 /**
 * @brief    SRTC_IP_ENABLE_USER_MODE_SUPPORT switch
@@ -98,7 +98,7 @@ extern "C"{
 * @brief    SRTC_IP_STANDBY_WAKEUP_SUPPORT
 * @details  StandBy Mode is not supported in this release
 */
-#define SRTC_IP_STANDBY_WAKEUP_SUPPORT    (STD_OFF)
+#define SRTC_IP_STANDBY_WAKEUP_SUPPORT    (STD_ON)
 
 /*==================================================================================================
 *                                             ENUMS

+ 10 - 8
generate/src/Adc_VS_0_PBcfg.c

@@ -148,10 +148,11 @@ static const Adc_ChannelType Adc_Group0_Assignment_1_VS_0[ADC_CFGSET_VS_0_GROUP_
     0U,
     1U,
     2U,
-    7U,
-    4U,
     3U,
-    5U
+    4U,
+    5U,
+    6U,
+    7U
 };
 
 /**
@@ -163,10 +164,11 @@ static const Adc_ChannelType Adc_Group1_Assignment_1_VS_0[ADC_CFGSET_VS_0_GROUP_
     0U,
     1U,
     2U,
-    7U,
-    4U,
     3U,
-    5U
+    4U,
+    5U,
+    6U,
+    7U
 };
 
 /**
@@ -229,7 +231,7 @@ static const Adc_GroupConfigurationType Adc_GroupsCfg_VS_0[] =
         /**< @brief Last Channel configured */
         (Adc_ChannelType)(ADC_ID_CHANNEL_U8(30)), /* LastCh */
         /**< @brief First Channel configured */
-        (Adc_ChannelType)(ADC_ID_CHANNEL_U8(5)), /* FirstCh */
+        (Adc_ChannelType)(ADC_ID_CHANNEL_U8(4)), /* FirstCh */
         /**< @brief Enables or Disables the ADC and DMA interrupts */
         (uint8)(STD_OFF), /* u8AdcWithoutInterrupt */
         /**< @brief Enables or Disables configuring external DMA channel in the group */
@@ -303,7 +305,7 @@ static const Adc_GroupConfigurationType Adc_GroupsCfg_VS_0[] =
         /**< @brief Last Channel configured */
         (Adc_ChannelType)(ADC_ID_CHANNEL_U8(30)), /* LastCh */
         /**< @brief First Channel configured */
-        (Adc_ChannelType)(ADC_ID_CHANNEL_U8(5)), /* FirstCh */
+        (Adc_ChannelType)(ADC_ID_CHANNEL_U8(4)), /* FirstCh */
         /**< @brief Enables or Disables the ADC and DMA interrupts */
         (uint8)(STD_OFF), /* u8AdcWithoutInterrupt */
         /**< @brief Enables or Disables configuring external DMA channel in the group */

+ 2 - 2
generate/src/Clock_Ip_VS_0_PBcfg.c

@@ -357,7 +357,7 @@ const Clock_Ip_ClockConfigType Mcu_aClockConfigPB_VS_0[1U] = {
             #if CLOCK_SELECTORS_NO > 14U
             {
                 FTM0_CLK,                     /* Clock name associated to selector */
-                SOSCDIV1_CLK,                       /* Name of the selected input source */
+                SIRCDIV1_CLK,                       /* Name of the selected input source */
             },
             #endif
         
@@ -476,7 +476,7 @@ const Clock_Ip_ClockConfigType Mcu_aClockConfigPB_VS_0[1U] = {
             #if CLOCK_SELECTORS_NO > 31U
             {
                 LPTMR0_CLK,                     /* Clock name associated to selector */
-                CLOCK_IS_OFF,                       /* Name of the selected input source */
+                SIRCDIV2_CLK,                       /* Name of the selected input source */
             },
             #endif
         

+ 33 - 4
generate/src/Gpt_Ipw_VS_0_PBcfg.c

@@ -182,7 +182,7 @@ extern "C"{
 #define GPT_START_SEC_CONFIG_DATA_UNSPECIFIED
 #include "Gpt_MemMap.h"
 
-Gpt_Ipw_HwInstanceConfigType Gpt_Ipw_HwInstanceConfig_PB_VS_0[2U]=
+Gpt_Ipw_HwInstanceConfigType Gpt_Ipw_HwInstanceConfig_PB_VS_0[3U]=
 {
     {
         /** @brief IP type  */
@@ -196,6 +196,18 @@ Gpt_Ipw_HwInstanceConfigType Gpt_Ipw_HwInstanceConfig_PB_VS_0[2U]=
         }
     }
     ,
+    {
+        /** @brief IP type  */
+        GPT_LPTMR_MODULE,
+        /** @brief IP instance */
+        0U,
+        /** @brief IP instance pointer */
+        {
+            NULL_PTR,
+            NULL_PTR
+        }
+    }
+    ,
     {
         /** @brief IP type  */
         GPT_LPIT_MODULE,
@@ -215,9 +227,9 @@ Gpt_Ipw_HwInstanceConfigType Gpt_Ipw_HwInstanceConfig_PB_VS_0[2U]=
 /** 
  * @brief   Gpt channels IP related configuration array
  */
-Gpt_Ipw_HwChannelConfigType Gpt_Ipw_ChannelConfig_PB_VS_0[2U] =
+Gpt_Ipw_HwChannelConfigType Gpt_Ipw_ChannelConfig_PB_VS_0[3U] =
 {
-    /** @brief GptChannelConfiguration_0 */
+    /** @brief GptChannelConfiguration_LPIT0_CH0 */
     {
         /** @brief IP type  */
         GPT_LPIT_MODULE,
@@ -234,7 +246,7 @@ Gpt_Ipw_HwChannelConfigType Gpt_Ipw_ChannelConfig_PB_VS_0[2U] =
         }
     }
     ,
-    /** @brief GptChannelConfiguration_1 */
+    /** @brief GptChannelConfiguration_FTM */
     {
         /** @brief IP type  */
         GPT_FTM_MODULE,
@@ -250,6 +262,23 @@ Gpt_Ipw_HwChannelConfigType Gpt_Ipw_ChannelConfig_PB_VS_0[2U] =
             NULL_PTR
         }
     }
+    ,
+    /** @brief GptChannelConfiguration_LPTMR */
+    {
+        /** @brief IP type  */
+        GPT_LPTMR_MODULE,
+        /** @brief IP instance */
+        0U,
+        /** @brief IP channel */
+        0U,
+        /** @brief IP instance config pointer */
+        {
+            NULL_PTR,
+            NULL_PTR,
+            &LPTMR_0_InitConfig_PB_VS_0,
+            NULL_PTR
+        }
+    }
 
 };
 

+ 20 - 7
generate/src/Gpt_VS_0_PBcfg.c

@@ -118,6 +118,7 @@ extern "C"{
 */
 extern void Wdg_Cbk_GptNotification0(void);
 extern void Wdg_Cbk_GptNotification1(void);
+extern void LPTMR_WakeUp_Notification(void);
 
 
 
@@ -155,7 +156,7 @@ extern void Wdg_Cbk_GptNotification1(void);
 
 
 /* Number of channels per variant without partitions */
-#define GPT_CONF_CHANNELS_PB_VS_0    2U
+#define GPT_CONF_CHANNELS_PB_VS_0    3U
 #define GPT_STOP_SEC_CONFIG_DATA_UNSPECIFIED
 #include "Gpt_MemMap.h"
 
@@ -179,8 +180,9 @@ static const Gpt_HwPredefChannelConfigType *const Gpt_pInitPredefTimerChannelPB_
 
 static const uint8 u8GptChannelIdToIndexMap_VS_0[GPT_NUM_CONFIG] =
 {
-    0,        /* Logical Channel GptChannelConfiguration_0 */
-    1         /* Logical Channel GptChannelConfiguration_1 */
+    0,        /* Logical Channel GptChannelConfiguration_LPIT0_CH0 */
+    1,        /* Logical Channel GptChannelConfiguration_FTM */
+    2         /* Logical Channel GptChannelConfiguration_LPTMR */
 };
 
 #define GPT_STOP_SEC_CONST_UNSPECIFIED
@@ -190,7 +192,7 @@ static const uint8 u8GptChannelIdToIndexMap_VS_0[GPT_NUM_CONFIG] =
 #include "Gpt_MemMap.h"
 static const Gpt_ChannelConfigType Gpt_InitChannelPB_VS_0[GPT_CONF_CHANNELS_PB_VS_0] =
 {
-    {   /*GptChannelConfiguration_0 configuration data*/
+    {   /*GptChannelConfiguration_LPIT0_CH0 configuration data*/
         (boolean)FALSE, /* Wakeup capability */
         &Wdg_Cbk_GptNotification0, /* Channel notification */
 #if ((GPT_WAKEUP_FUNCTIONALITY_API == STD_ON) && (GPT_REPORT_WAKEUP_SOURCE == STD_ON))
@@ -201,7 +203,7 @@ static const Gpt_ChannelConfigType Gpt_InitChannelPB_VS_0[GPT_CONF_CHANNELS_PB_V
         &Gpt_Ipw_ChannelConfig_PB_VS_0[0U]
     }
 ,
-    {   /*GptChannelConfiguration_1 configuration data*/
+    {   /*GptChannelConfiguration_FTM configuration data*/
         (boolean)FALSE, /* Wakeup capability */
         &Wdg_Cbk_GptNotification1, /* Channel notification */
 #if ((GPT_WAKEUP_FUNCTIONALITY_API == STD_ON) && (GPT_REPORT_WAKEUP_SOURCE == STD_ON))
@@ -211,6 +213,17 @@ static const Gpt_ChannelConfigType Gpt_InitChannelPB_VS_0[GPT_CONF_CHANNELS_PB_V
         (GPT_CH_MODE_CONTINUOUS), /* Timer mode:continous/one-shot */
         &Gpt_Ipw_ChannelConfig_PB_VS_0[1U]
     }
+,
+    {   /*GptChannelConfiguration_LPTMR configuration data*/
+        (boolean)FALSE, /* Wakeup capability */
+        &LPTMR_WakeUp_Notification, /* Channel notification */
+#if ((GPT_WAKEUP_FUNCTIONALITY_API == STD_ON) && (GPT_REPORT_WAKEUP_SOURCE == STD_ON))
+        (EcuM_WakeupSourceType)0U, /* Wakeup information */
+#endif
+        (Gpt_ValueType)(65535U), /* Maximum ticks value*/
+        (GPT_CH_MODE_CONTINUOUS), /* Timer mode:continous/one-shot */
+        &Gpt_Ipw_ChannelConfig_PB_VS_0[2U]
+    }
 };
 
     
@@ -226,11 +239,11 @@ static const Gpt_ChannelConfigType Gpt_InitChannelPB_VS_0[GPT_CONF_CHANNELS_PB_V
 const Gpt_ConfigType Gpt_Config_VS_0 =
 {
     /** @brief Number of GPT channels (configured in tresos plugin builder)*/
-    (Gpt_ChannelType)2U,
+    (Gpt_ChannelType)3U,
     /** @brief Pointer to the GPT channel configuration */
     &Gpt_InitChannelPB_VS_0,
     /** @brief Number of GPT instances (configured in tresos plugin builder)*/
-    2U,
+    3U,
     /** @brief Pointer to the GPT instance configuration */    
     &Gpt_Ipw_HwInstanceConfig_PB_VS_0,
 #if(GPT_PREDEFTIMER_FUNCTIONALITY_API == STD_ON)

+ 4 - 4
generate/src/IntCtrl_Ip_Cfg.c

@@ -106,7 +106,7 @@ static const IntCtrl_Ip_IrqConfigType aIrqConfiguration[] = {
     {LPIT0_Ch3_IRQn, (boolean)FALSE, 0U},
     {PDB0_IRQn, (boolean)FALSE, 0U},
     {SCG_IRQn, (boolean)FALSE, 0U},
-    {LPTMR0_IRQn, (boolean)FALSE, 0U},
+    {LPTMR0_IRQn, (boolean)TRUE, 0U},
     {PORTA_IRQn, (boolean)TRUE, 0U},
     {PORTB_IRQn, (boolean)TRUE, 0U},
     {PORTC_IRQn, (boolean)FALSE, 0U},
@@ -127,7 +127,7 @@ static const IntCtrl_Ip_IrqConfigType aIrqConfiguration[] = {
     {CAN2_ORed_IRQn, (boolean)TRUE, 6U},
     {CAN2_Error_IRQn, (boolean)TRUE, 6U},
     {CAN2_ORed_0_15_MB_IRQn, (boolean)TRUE, 6U},
-    {FTM0_Ch0_Ch1_IRQn, (boolean)FALSE, 0U},
+    {FTM0_Ch0_Ch1_IRQn, (boolean)TRUE, 0U},
     {FTM0_Ch2_Ch3_IRQn, (boolean)FALSE, 0U},
     {FTM0_Ch4_Ch5_IRQn, (boolean)FALSE, 0U},
     {FTM0_Ch6_Ch7_IRQn, (boolean)FALSE, 0U},
@@ -218,7 +218,7 @@ static const IntCtrl_Ip_IrqRouteConfigType aIrqRouteConfig[] = {
         {LPIT0_Ch3_IRQn, 0U, undefined_handler},
         {PDB0_IRQn, 0U, undefined_handler},
         {SCG_IRQn, 0U, undefined_handler},
-        {LPTMR0_IRQn, 0U, undefined_handler},
+        {LPTMR0_IRQn, 0U, Lptmr_0_Ch_0_ISR},
         {PORTA_IRQn, 0U, PORT_CI_ICU_IP_A_EXT_IRQ_ISR},
         {PORTB_IRQn, 0U, PORT_CI_ICU_IP_B_EXT_IRQ_ISR},
         {PORTC_IRQn, 0U, undefined_handler},
@@ -239,7 +239,7 @@ static const IntCtrl_Ip_IrqRouteConfigType aIrqRouteConfig[] = {
         {CAN2_ORed_IRQn, 0U, CAN2_ORED_IRQHandler},
         {CAN2_Error_IRQn, 0U, CAN2_Error_IRQHandler},
         {CAN2_ORed_0_15_MB_IRQn, 0U, CAN2_ORED_0_15_MB_IRQHandler},
-        {FTM0_Ch0_Ch1_IRQn, 0U, undefined_handler},
+        {FTM0_Ch0_Ch1_IRQn, 0U, FTM_0_CH_0_CH_1_ISR},
         {FTM0_Ch2_Ch3_IRQn, 0U, undefined_handler},
         {FTM0_Ch4_Ch5_IRQn, 0U, undefined_handler},
         {FTM0_Ch6_Ch7_IRQn, 0U, undefined_handler},

+ 17 - 0
generate/src/Lptmr_Gpt_Ip_VS_0_PBcfg.c

@@ -103,6 +103,23 @@ extern "C"{
  *================================================================================================*/
 #define GPT_START_SEC_CONFIG_DATA_UNSPECIFIED
 #include "Gpt_MemMap.h"
+Lptmr_Gpt_Ip_ConfigType LPTMR_0_InitConfig_PB_VS_0 = 
+{
+    /** @brief PrescalerEnable */
+    (boolean)TRUE, 
+    /** @brief clockAlternatePrescaler value */
+    #if(LPTMR_GPT_IP_SET_CLOCK_MODE == STD_ON)
+    0U, /* LPTMR alternate Clock divider */ 
+    #endif
+    /** @brief Prescaler value */
+    1U, /* LPTMR Prescaler */ 
+    /** @brief LPtimer clock source  */
+    LPTMR_GPT_IP_CLOCK_SIRCDIV2,
+    /** @brief LPtimer callback name */
+    &Gpt_ProcessCommonInterrupt,
+    /** @brief LPtimer callbackparam */
+    (uint8)2U
+};
 #define GPT_STOP_SEC_CONFIG_DATA_UNSPECIFIED
 #include "Gpt_MemMap.h"
 /*==================================================================================================

+ 1 - 1
generate/src/Port_Ci_Port_Ip_VS_0_PBcfg.c

@@ -547,7 +547,7 @@ const Port_Ci_Port_Ip_PinSettingsConfig g_pin_mux_InitConfigArr_VS_0[NUM_OF_CONF
         .pinPortIdx                  = 7,
         .mux                         = PORT_MUX_AS_GPIO,
         .direction                   = PORT_CI_PORT_PIN_OUT,
-        .pullConfig                  = PORT_INTERNAL_PULL_UP_ENABLED,
+        .pullConfig                  = PORT_INTERNAL_PULL_NOT_ENABLED,
         .driveStrength               = PORT_DRIVE_STRENGTH_LOW,
         .passiveFilter               = (boolean)FALSE,
         .lockRegister                = PORT_LOCK_REGISTER_DISABLED,

+ 1 - 1
generate/src/Port_VS_0_PBcfg.c

@@ -355,7 +355,7 @@ static const Port_PinConfigType Port_aPinConfigDefault_VS_0[PORT_MAX_CONFIGURED_
     /* PCR Id, PCR Value, Output Level, Direction, IsGpio, Direction Configurable, Mode Changeable */
     {(uint16)129, (uint32)0x00000100, (uint8)1, (Port_PinDirectionType)2, (boolean)TRUE, (boolean)TRUE, (boolean)TRUE},
     /* PCR Id, PCR Value, Output Level, Direction, IsGpio, Direction Configurable, Mode Changeable */
-    {(uint16)135, (uint32)0x00000103, (uint8)1, (Port_PinDirectionType)2, (boolean)TRUE, (boolean)TRUE, (boolean)TRUE},
+    {(uint16)135, (uint32)0x00000100, (uint8)1, (Port_PinDirectionType)2, (boolean)TRUE, (boolean)TRUE, (boolean)TRUE},
     /* PCR Id, PCR Value, Output Level, Direction, IsGpio, Direction Configurable, Mode Changeable */
     {(uint16)36, (uint32)0x00000100, (uint8)0, (Port_PinDirectionType)2, (boolean)TRUE, (boolean)TRUE, (boolean)TRUE},
     /* PCR Id, PCR Value, Output Level, Direction, IsGpio, Direction Configurable, Mode Changeable */

+ 1 - 1
generate/src/Wdg_43_Instance0_VS_0_PBcfg.c

@@ -167,7 +167,7 @@ const Wdg_ConfigType Wdg_Config_0_VS_0=
     WDGIF_SLOW_MODE,
     WDG_IPW_INSTANCE0,
 #if (WDG_DIRECT_SERVICE == STD_OFF)
-        (Gpt_ChannelType)GptConf_GptChannelConfiguration_GptChannelConfiguration_0,
+        (Gpt_ChannelType)GptConf_GptChannelConfiguration_GptChannelConfiguration_LPIT0_CH0,
     (uint32)4000,
     #endif
     {&Wdg_OffModeSettings_0_VS_0, &Wdg_SlowModeSettings_0_VS_0, &Wdg_FastModeSettings_0_VS_0}

+ 1 - 1
generate/src/Wdg_43_Instance1_VS_0_PBcfg.c

@@ -156,7 +156,7 @@ const Wdg_ConfigType Wdg_Config_1_VS_0=
     WDGIF_SLOW_MODE,
     WDG_IPW_INSTANCE1,
 #if (WDG_DIRECT_SERVICE == STD_OFF)
-        (Gpt_ChannelType)GptConf_GptChannelConfiguration_GptChannelConfiguration_1,
+        (Gpt_ChannelType)GptConf_GptChannelConfiguration_GptChannelConfiguration_FTM,
     (uint32)4000,
     #endif
     {NULL_PTR, &Wdg_Settings_1_VS_0, NULL_PTR}

Some files were not shown because too many files changed in this diff