/* 
 * File: ert_main.c 
 * 
 * Code generated for Simulink model 'adc_dma_bctu'. 
 * 
 * Model version                   : 4.44 
 * Simulink Coder version          : 24.1 (R2024a) 19-Nov-2023 
 * MBDT for S32K3 Series Version  :  Version 1.8.0 (R2023b-R2025b) 11-Dec-2025 
 * C/C++ source code generated on  : Thu Mar 12 15:19:47 2026 
 * 
 * Target selection: ert.tlc 
 * Embedded hardware selection: ARM Compatible->ARM Cortex 
 * Code generation objectives: Unspecified 
 * Validation result: Not run 
 */ 
  
 #include "adc_dma_bctu.h" 
 #include "rtwtypes.h" 
 #include "MW_target_hardware_resources.h" 
  
 volatile int IsrOverrun = 0; 
 boolean_T isRateRunning[2] = { 0, 0 }; 
  
 boolean_T need2runFlags[2] = { 0, 0 }; 
  
 void rt_OneStep(void) 
 { 
 boolean_T eventFlags[2]; 
  
 /* Check base rate for overrun */ 
 if (isRateRunning[0]++) { 
 IsrOverrun = 1; 
 isRateRunning[0]--;                /* allow future iterations to succeed*/ 
 return; 
 } 
  
 /* 
 * For a bare-board target (i.e., no operating system), the rates 
 * that execute this base step are buffered locally to allow for 
 * overlapping preemption. 
 */ 
 adc_dma_bctu_SetEventsForThisBaseStep(eventFlags); 
 adc_dma_bctu_step0(); 
  
 /* Get model outputs here */ 
 isRateRunning[0]--; 
 if (eventFlags[1]) { 
 if (need2runFlags[1]++) { 
 IsrOverrun = 1; 
 need2runFlags[1]--;              /* allow future iterations to succeed*/ 
 return; 
 } 
 } 
  
 if (need2runFlags[1]) { 
 if (isRateRunning[1]) { 
 /* Yield to higher priority*/ 
 return; 
 } 
  
 isRateRunning[1]++; 
  
 /* Step the model for subrate "1" */ 
 switch (1) 
 { 
 case 1 : 
 adc_dma_bctu_step1(); 
  
 /* Get model outputs here */ 
 break; 
  
 default : 
 break; 
 } 
  
 need2runFlags[1]--; 
 isRateRunning[1]--; 
 } 
 } 
  
 volatile boolean_T stopRequested; 
 volatile boolean_T runModel; 
 int main(int argc, char **argv) 
 { 
 float modelBaseRate = 0.001; 
 float systemClock = 240; 
  
 /* Initialize variables */ 
 stopRequested = false; 
 runModel = false; 
 (void)argc; 
 (void)argv; 
 (void)systemClock; 
  
 /* Board init */ 
 board_init(); 
 ; 
 rtmSetErrorStatus(adc_dma_bctu_M, 0); 
 adc_dma_bctu_initialize(); 
 s32k3_trigger_config(modelBaseRate); 
 runModel = 
 rtmGetErrorStatus(adc_dma_bctu_M) == (NULL); 
 while (runModel) { 
 FMSTR_Poll(); 
 stopRequested = !( 
 rtmGetErrorStatus(adc_dma_bctu_M) == (NULL)); 
 runModel = !(stopRequested); 
 } 
  
 /* Terminate model */ 
 adc_dma_bctu_terminate(); 
 return 0; 
 } 
  
 /* 
 * File trailer for generated code. 
 * 
 * [EOF] 
 */ 
