123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169 |
- #include "VehCo.h"
- #include "HardwareLib.h"
- #include "CANNet.h"
- #include "AccPedCD.h"
- #define APPLAYERVER_START_SEC_VAR
- #include "MemMap.h"
- const uint8 AppLayer_idxVerUBA[64] = "P156V101";
- #define APPLAYERVER_STOP_SEC_VAR
- #include "MemMap.h"
- #ifdef _SAMPLE_CODE_
- #endif
-
- #define MAPDATA_START_SEC_VAR_CONST
- #include "MemMap.h"
- PRAGMA_MAPDATA const uint16 VehCo_bTestCANWuFinUW_C = 0;
- PRAGMA_MAPDATA const uint16 VehCo_bTestCPCtrlUW_C = 0;
- #define MAPDATA_STOP_SEC_VAR_CONST
- #include "MemMap.h"
- #define _BOOTLOADER_EMBEDDED
- #ifdef _BOOTLOADER_EMBEDDED
- uint32 VehCo_pBootloaderUIP;
- #pragma section ".bootloader_entry" ax
- void Bootloader_Entry(void);
- #pragma section
- #endif
- void VehCo_Init(void)
- {
- #ifdef _BOOTLOADER_EMBEDDED
- VehCo_pBootloaderUIP = (uint32)Bootloader_Entry;
- #endif
- #ifdef _SAMPLE_CODE_
- AccPedCD_Init();
-
- #endif
-
- CANNet_Init();
-
- PSwtDrv_Interface(_PSWT_INDEX_MAINRELAY_CHAN, 1);
-
- PSwtDrv_Interface(_PSWT_INDEX_BLEPWRCONTROL, 1);
- }
- void VehCo_Manage10ms(void)
- {
- #ifdef _SAMPLE_CODE_
- VehCo_Ctrl();
- VcuRxDiagnose();
- BcuRxDiagnose();
- #endif
-
- }
- void VehCo_Manage1ms(void)
- {
- CAN0Net_Manage1ms();
- CAN1Net_Manage1ms();
- CAN2Net_Manage1ms();
- }
- uint8 VehCo_Afterrun(void)
- {
- uint8 stRetUB = 0;
- if (HardwareDrv_bBootloaderReqUB == 1)
- {
-
- {
- stRetUB = 1;
- }
- }
- else
- {
- #ifdef _SAMPLE_CODE_
- VehCo_Ctrl();
- #endif
- {
- stRetUB = 1;
- }
- }
- return stRetUB;
- }
- #ifdef _SAMPLE_CODE_
- void VehCo_Ctrl(void)
- {
-
- if (BattCD_stWakeupU.B.bCAN == 1)
- {
- if (VehCo_bTestCANWuFinUW_C == 1)
- {
- BattCD_stWakeupU.B.bCAN = 0;
- }
- }
- #ifdef _APP_TEST_CODE
- TestDeviceFun();
- VehCo_uBattF = (float32)BattCD_uFltUW / 100.0F;
- #endif
- #ifdef _APP_RELEASE_CODE
-
- GetHVLockState();
- GetDIOState();
- GetAIOValue();
- #endif
- }
- #endif
|