From 10e17adc8dbad1fe5db7281a826326ee3f6c3215 Mon Sep 17 00:00:00 2001 From: liumin Date: Sun, 6 Jul 2025 16:12:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=20MAIN.C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MAIN.C | 273 --------------------------------------------------------- 1 file changed, 273 deletions(-) delete mode 100644 MAIN.C diff --git a/MAIN.C b/MAIN.C deleted file mode 100644 index be592b2..0000000 --- a/MAIN.C +++ /dev/null @@ -1,273 +0,0 @@ -//**************************************************************************** -// @Module Project Settings -// @Filename MAIN.C -// @Project CL2.0.dav -//---------------------------------------------------------------------------- -// @Controller Infineon XC886CLM-8FF -// -// @Compiler Keil -// -// @Codegenerator 1.3 -// -// @Description This file contains the Project initialization function. -// -//---------------------------------------------------------------------------- -// @Date 2025/1/18 20:45:29 -// -//**************************************************************************** - -// USER CODE BEGIN (MAIN_General,1) - -// USER CODE END - - - -//**************************************************************************** -// @Project Includes -//**************************************************************************** - -#include "MAIN.H" - -// USER CODE BEGIN (MAIN_General,2) - -// USER CODE END - - -//**************************************************************************** -// @Macros -//**************************************************************************** - -// USER CODE BEGIN (MAIN_General,3) - -// USER CODE END - - -//**************************************************************************** -// @Defines -//**************************************************************************** - -// USER CODE BEGIN (MAIN_General,4) - -// USER CODE END - - -//**************************************************************************** -// @Typedefs -//**************************************************************************** - -// USER CODE BEGIN (MAIN_General,5) - -// USER CODE END - - -//**************************************************************************** -// @Imported Global Variables -//**************************************************************************** - -// USER CODE BEGIN (MAIN_General,6) - -// USER CODE END - - -//**************************************************************************** -// @Global Variables -//**************************************************************************** - -// USER CODE BEGIN (MAIN_General,7) - -// USER CODE END - - -//**************************************************************************** -// @External Prototypes -//**************************************************************************** - - -// USER CODE BEGIN (MAIN_General,8) - -// USER CODE END - - -//**************************************************************************** -// @Prototypes Of Local Functions -//**************************************************************************** - -// USER CODE BEGIN (MAIN_General,9) - -// USER CODE END - - -//**************************************************************************** -// @Function void MAIN_vInit(void) -// -//---------------------------------------------------------------------------- -// @Description This function initializes the microcontroller. It is -// assumed that the SFRs are in their reset state. -// -//---------------------------------------------------------------------------- -// @Returnvalue None -// -//---------------------------------------------------------------------------- -// @Parameters None -// -//---------------------------------------------------------------------------- -// @Date 2025/1/18 -// -//**************************************************************************** - -// USER CODE BEGIN (MAIN_Init,1) - -// USER CODE END - -void MAIN_vInit(void) -{ - // USER CODE BEGIN (MAIN_Init,2) - - // USER CODE END - - /// ----------------------------------------------------------------------- - /// Configuration of the System Clock: - /// ----------------------------------------------------------------------- - /// - External Osc is selected (configuration is done in the startup file - /// 'START_XC.A51') - /// - PLL Mode, NDIV = 24 - /// - input frequency is 8 MHz - - - // FCLK runs at 2 times the frequency of PCLK. - SFR_PAGE(_su1, noSST); // switch to page1 - - CMCON = 0x10; // load Clock Control Register - - SFR_PAGE(_su0, noSST); // switch to page0 - - - /// ********************************************************************************* - /// Note : All peripheral related IO configurations are done in the - /// respective peripheral modules (alternate functions selection) - /// ********************************************************************************* - - /// Initialization of module 'GPIO' - IO_vInit(); - - /// Initialization of module 'Timer 2' - T2_vInit(); - - /// Initialization of module 'Watch Dog Timer' - WDT_vInit(); - - /// Initialization of module 'Power Saving Modes' - PS_vInit(); - - /// Initialization of module 'MultiCAN Controller ' - CAN_vInit(); - - /// Initialization of 'Shared interrupts' - SHINT_vInit(); - - // Interrupt Priority - - IP = 0x00; // load Interrupt Priority Register - IPH = 0x00; // load Interrupt Priority High Register - IP1 = 0x00; // load Interrupt Priority 1 Register - IPH1 = 0x00; // load Interrupt Priority 1 High Register - - - // USER CODE BEGIN (MAIN_Init,3) - - // USER CODE END - - //// Interrupt structure 2 mode 0 is selected. - - //// Interrupt service routine choice 2 is selected. - - // globally enable interrupts - EA = 1; - -} // End of function MAIN_vInit - - -//**************************************************************************** -// @Function void main(void) -// -//---------------------------------------------------------------------------- -// @Description This is the main function. -// -//---------------------------------------------------------------------------- -// @Returnvalue None -// -//---------------------------------------------------------------------------- -// @Parameters None -// -//---------------------------------------------------------------------------- -// @Date 2025/1/18 -// -//**************************************************************************** - -// USER CODE BEGIN (MAIN_Main,1) - -// USER CODE END - -void main(void) -{ - // USER CODE BEGIN (MAIN_Main,2) -// ulong i,j; -// static ubyte tmp[8] = {0}; -// for(j=0;j<200;j++){for(i=0;i<133;i++);} - - // USER CODE END - - MAIN_vInit(); - - // USER CODE BEGIN (MAIN_Main,3) - SCU_PAGE = 0; - SP = 0xC0; // Initialize Stack Pointer to 0xC0; -// CanTransmit(); - -// BM8563_InitTime(); -// BM8563_Set4HourAlarm();// - KGF_PIN = 1;//KGF唤醒 - BATTERY_PIN = 1; - - - SetConfig(CFG_MPS_Single,CFG_Repeatbility_High); -// FlgCan_1 = 1;//复位后延时一段时间再调用CAN发送 - // USER CODE END - -// SetConfig(1,CFG_MPS_Single,CFG_Repeatbility_High); - - RomNum = Search_ROM(romid); //搜索当前总线上的所有芯片,将ROM ID存入数组romid,并返回芯片个数 - - - while(1) - { - - // USER CODE BEGIN (MAIN_Main,4) -// for(j=0;j<200;j++){for(i=0;i<133;i++)WDT_vRefresh();} -// tmp[3] = (ubyte)CntCan_1; -// tmp[2] = (ubyte)(CntCan_1>>8); - -// SwSample(); - CanRXTX(); - CanErrorProcess(); - WDT_vRefresh(); -// LedDr(); - BootMain(); - - -// tmp[1] = (ubyte)CntCan_1; -// tmp[0] = (ubyte)(CntCan_1>>8); -// CAN_vLoadData(0x2, (ulong *)(tmp)); // Add this Line -// CAN_vTransmit(2); -// for(j=0;j<200;j++){for(i=0;i<133;i++)WDT_vRefresh();} - // USER CODE END - - } - -} // End of function main - - -// USER CODE BEGIN (MAIN_General,10) - -// USER CODE END -