Преглед на файлове

Merge branch '4G_ZK_01B-Debug' of http://git.fast-fun.cn:92/RuiLiWuLian/4G into 4G_ZK_01B-Debug

# Conflicts:
#	.settings/language.settings.xml
#	code/app/AppGlobalVar.c
#	code/app/AppTaskCan.c
#	code/hal/hal_adapter.c
LAPTOP-KB7QFH2U\ChenJie-PC преди 1 година
родител
ревизия
7877e3ceb0

+ 2 - 3
code/app/AppTaskCan.c

@@ -40,8 +40,7 @@ void CanTask(void *pvParameters)
 				{
 					DoRoutinePositiveAnswer();
 					RequestEnterBootloader();
-					SystemSoftwareReset();
-//					DoResetECUWithWdg();
+					DoResetECUWithWdg();
 					break;
 				}
 				else
@@ -498,7 +497,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:

+ 43 - 22
code/hal/hal_adapter.c

@@ -662,7 +662,7 @@ Std_ReturnType CanIf_SendMessage(uint8 ControllerId, Can_Msg_Type CanMsg)
             u8TimeOut--;
         }
     }
-    else
+    else //send message fail, we need to recover the send function by make the can controller bus off
     {
     	Can_MainFunction_BusOff();
     }
@@ -699,7 +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);
+    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)
@@ -1016,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)
 {
@@ -1042,7 +1050,7 @@ void SystemDeinit(void)
 
 	Adc_DeInit();
 
-	Gpt_DisableNotification(GptConf_GptChannelConfiguration_GptChannelConfiguration_0);
+//	Gpt_DisableNotification(GptConf_GptChannelConfiguration_GptChannelConfiguration_0);
 
 	Gpt_DeInit();
 
@@ -1075,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)
@@ -1092,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();
+		}
 	}
 }
 
@@ -1146,7 +1160,7 @@ void SystemModulesInit(void)
 	/* Initialize Mcl module */
 	Mcl_Init(NULL_PTR);
 
-	SEGGER_RTT_Init();
+//	SEGGER_RTT_Init();
 
 
 	/* Initializes an UART driver*/
@@ -1181,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 */
@@ -1206,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)
 
 /*==================================================================================================*/
 /**

Файловите разлики са ограничени, защото са твърде много
+ 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}

Някои файлове не бяха показани, защото твърде много файлове са промени