1/*
2 * Academic License - for use in teaching, academic research, and meeting
3 * course requirements at degree granting institutions only. Not for
4 * government, commercial, or other organizational use.
5 *
6 * File: ert_main.c
7 *
8 * Code generated for Simulink model 'TwoPhaseForStuck'.
9 *
10 * Model version : 1.138
11 * Simulink Coder version : 9.0 (R2018b) 24-May-2018
12 * C/C++ source code generated on : Tue Dec 8 01:36:02 2020
13 *
14 * Target selection: ert.tlc
15 * Embedded hardware selection: Texas Instruments->C2000
16 * Code generation objectives: Unspecified
17 * Validation result: Not run
18 */
19
20#include "TwoPhaseForStuck.h"
21#include "rtwtypes.h"
22
23volatile int IsrOverrun = 0;
24static boolean_T OverrunFlag = 0;
25void rt_OneStep(void)
26{
27 /* Check for overrun. Protect OverrunFlag against preemption */
28 if (OverrunFlag++) {
29 IsrOverrun = 1;
30 OverrunFlag--;
31 return;
32 }
33
34 enableTimer0Interrupt();
35 TwoPhaseForStuck_step();
36
37 /* Get model outputs here */
38 disableTimer0Interrupt();
39 OverrunFlag--;
40}
41
42volatile boolean_T stopRequested = false;
43int main(void)
44{
45 volatile boolean_T runModel = true;
46 float modelBaseRate = 1.25E-6;
47 float systemClock = 200;
48 c2000_flash_init();
49 init_board();
50
51#ifdef MW_EXEC_PROFILER_ON
52
53 config_profilerTimer();
54
55#endif
56
57 ;
58 rtmSetErrorStatus(TwoPhaseForStuck_M, 0);
59 TwoPhaseForStuck_initialize();
60 configureTimer0(modelBaseRate, systemClock);
61 runModel =
62 rtmGetErrorStatus(TwoPhaseForStuck_M) == (NULL);
63 enableTimer0Interrupt();
64 globalInterruptEnable();
65 while (runModel) {
66 stopRequested = !(
67 rtmGetErrorStatus(TwoPhaseForStuck_M) == (NULL));
68 runModel = !(stopRequested);
69 }
70
71 /* Disable rt_OneStep() here */
72
73 /* Terminate model */
74 TwoPhaseForStuck_terminate();
75 globalInterruptDisable();
76 return 0;
77}
78
79/*
80 * File trailer for generated code.
81 *
82 * [EOF]
83 */
84