平湖秋月 发表于 2017-11-8 09:23
ert_main.c:
/*
* File: ert_main.c
*
* Code generated for Simulink model 'c280xx_adcpwmasynctest_ert'.
*
* Model version : 1.71
* Simulink Coder version : 8.12 (R2017a) 16-Feb-2017
* C/C++ source code generated on : Wed Nov 08 09:10:37 2017
*
* Target selection: ert.tlc
* Embedded hardware selection: Texas Instruments->C2000
* Code generation objectives: Unspecified
* Validation result: Not run
*/
#include "c280xx_adcpwmasynctest_ert.h"
#include "rtwtypes.h"
volatile int IsrOverrun = 0;
static boolean_T OverrunFlag = 0;
void rt_OneStep(void)
{
}
int main(void)
{
volatile boolean_T runModel = 1;
float modelBaseRate = 0.2;
float systemClock = 60;
c2000_flash_init();
init_board();
#ifdef MW_EXEC_PROFILER_ON
config_profilerTimer();
#endif
;
rtmSetErrorStatus(c280xx_adcpwmasynctest_ert_M, 0);
c280xx_adcpwmasynctest_ert_initialize();
configureTimer0(modelBaseRate, systemClock);
runModel =
rtmGetErrorStatus(c280xx_adcpwmasynctest_ert_M) == (NULL);
enableTimer0Interrupt();
enable_interrupts();
globalInterruptEnable();
while (runModel) {
runModel =
rtmGetErrorStatus(c280xx_adcpwmasynctest_ert_M) == (NULL);
}
/* Disable rt_OneStep() here */
/* Terminate model */
c280xx_adcpwmasynctest_ert_terminate();
globalInterruptDisable();
return 0;
}
/*
* File trailer for generated code.
*
* [EOF]
*/
看来生成的代码也不太难懂!!!!