/**
 * @file main.c
 * @author Landworld0321 (Landworld@landworld.com)
 * @brief 主入口文件
 * @version V1.1
 * @date 2025-04-22
 *
 * @copyright Copyright (c) 2025
 * 修改记录：
 * 版本号    修改日期        修改人        修改内容
 * ---------------------------------------------------------------------------
 * v1.0    2025-04-22     wuhonghui      整理初版代码
 * v1.1    2025-04-22     wuhonghui      增加AB回滚功能
 */

/*VARIABLE*********************************************************/

volatile int exit_code = 0;
/*INCLUDE HEAD*********************************************************/

#include "CommonInc.h"

/**
 * @brief 上电后执行的主函数
 * 
 * @return int 如果出现返回
 */
int main(void)
{
/* Write your local variable definition here */

/*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
#ifdef PEX_RTOS_INIT
	PEX_RTOS_INIT(); /* Initialization of the selected RTOS. Macro is defined by the RTOS component. */
#endif
	/*** End of Processor Expert internal initialization. ***/

	SystemMiddle_InitClock();
	GpioMiddle_Init();
	TimerMiddle_Init();
	TimerMiddle_Start();
	EepromMiddle_Init();

	for (;;)
	{
		BootModule_Init();
	}

	/*** Don't write any code pass this line, or it will be deleted during code generation. ***/
  /*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON'T MODIFY THIS CODE!!! ***/
  #ifdef PEX_RTOS_START
    PEX_RTOS_START();                  /* Startup of the selected RTOS. Macro is defined by the RTOS component. */
  #endif
  /*** End of RTOS startup code.  ***/
  /*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
  for(;;) {
    if(exit_code != 0) {
      break;
    }
  }
  return exit_code;
  /*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/
/* END main */
/*!
** @}
*/



