1/*
2 * File: ert_main.c
3 *
4 * Code generated for Simulink model 'Blinky'.
5 *
6 * Model version : 1.145
7 * Simulink Coder version : 9.3 (R2020a) 18-Nov-2019
8 * MBDT for IMXRT Series Version : Version 1.3.0 (R2019a-R2021b) 18-Apr-2022
9 * C/C++ source code generated on : Sat Nov 26 13:09:17 2022
10 *
11 * Target selection: ert.tlc
12 * Embedded hardware selection: ARM Compatible->ARM Cortex
13 * Code generation objective: Execution efficiency
14 * Validation result: All passed
15 */
16
17 #include "Blinky.h"
18 #include "rtwtypes.h"
19
20 volatile int IsrOverrun = 0;
21 static boolean_T OverrunFlag = 0;
22 void rt_OneStep(void)
23 {
24 /* Check for overrun. Protect OverrunFlag against preemption */
25 if (OverrunFlag++) {
26 IsrOverrun = 1;
27 OverrunFlag--;
28 return;
29 }
30
31 Blinky_step();
32
33 /* Get model outputs here */
34 OverrunFlag--;
35 }
36
37 volatile boolean_T stopRequested;
38 volatile boolean_T runModel;
39 int main(int argc, char **argv)
40 {
41 float modelBaseRate = 0.25;
42 float systemClock = 600;
43
44 /* Initialize variables */
45 stopRequested = false;
46 runModel = false;
47
48 /* Board pin init */
49 BOARD_ConfigMPU();
50 BOARD_InitBootPins();
51 BOARD_BootClockRUN();
52 BOARD_InitDebugConsole();
53
54 /* Update the core clock */
55 SystemCoreClockUpdate();
56 BOARD_InitBootPeripherals();
57
58 /* Workaround for R2019b */
59 runModel = true;
60 ;
61 ((void) 0);
62 Blinky_initialize();
63 imxrt_trigger_config(modelBaseRate);
64 runModel = true;
65 while (runModel) {
66 FMSTR_Poll();
67 }
68
69 /* Disable rt_OneStep() here */
70
71 /* Terminate model */
72 Blinky_terminate();
73 return 0;
74 }
75
76 /*
77 * File trailer for generated code.
78 *
79 * [EOF]
80 */
81