mirror of
https://github.com/Dev-KATECH/ADM.git
synced 2026-05-17 01:43:59 +09:00
- LongitudinalCtrlMode 함수 비활성화 - Param match에서 가속도 관련 변수 0으로 비활성화 - Drive_ACC_Cmd 오프셋 적용 - GV_RC_Drive_ACC_Cmd 변수 생성 - Fault 시 명령 0으로 설정하는 조건 수정 - 속도 - 가속도 제어 전환 조건 추가 - 통합 로직 수정 : 가속도 제어 로직 적용 : 가속도 명령을 처리하는 Pre-processing 과정에 문제가 있어 해당 부분 재검토 필요 : 가속도 제어 로직이 동작하지 않도록 AccCmd_Out, AccControlFlag 0으로 설정
107 lines
3.1 KiB
C
107 lines
3.1 KiB
C
/*
|
|
* Academic License - for use in teaching, academic research, and meeting
|
|
* course requirements at degree granting institutions only. Not for
|
|
* government, commercial, or other organizational use.
|
|
*
|
|
* File: ert_main.c
|
|
*
|
|
* Code generated for Simulink model 'ADM_Integrated_Logic'.
|
|
*
|
|
* Model version : 14.98
|
|
* Simulink Coder version : 24.2 (R2024b) 21-Jun-2024
|
|
* C/C++ source code generated on : Tue Oct 21 13:14:18 2025
|
|
*
|
|
* Target selection: ert.tlc
|
|
* Embedded hardware selection: NXP->Cortex-M4
|
|
* Code generation objectives:
|
|
* 1. Execution efficiency
|
|
* 2. RAM efficiency
|
|
* 3. Debugging
|
|
* Validation result: Not run
|
|
*/
|
|
|
|
#include <stddef.h>
|
|
#include <stdio.h> /* This example main program uses printf/fflush */
|
|
#include "ADM_Integrated_Logic.h" /* Model header file */
|
|
|
|
/*
|
|
* Associating rt_OneStep with a real-time clock or interrupt service routine
|
|
* is what makes the generated code "real-time". The function rt_OneStep is
|
|
* always associated with the base rate of the model. Subrates are managed
|
|
* by the base rate from inside the generated code. Enabling/disabling
|
|
* interrupts and floating point context switches are target specific. This
|
|
* example code indicates where these should take place relative to executing
|
|
* the generated code step function. Overrun behavior should be tailored to
|
|
* your application needs. This example simply sets an error status in the
|
|
* real-time model and returns from rt_OneStep.
|
|
*/
|
|
void rt_OneStep(void);
|
|
void rt_OneStep(void)
|
|
{
|
|
static bool OverrunFlag = false;
|
|
|
|
/* Disable interrupts here */
|
|
|
|
/* Check for overrun */
|
|
if (OverrunFlag) {
|
|
rtmSetErrorStatus(ADM_Integrated_Logic_M, "Overrun");
|
|
return;
|
|
}
|
|
|
|
OverrunFlag = true;
|
|
|
|
/* Save FPU context here (if necessary) */
|
|
/* Re-enable timer or interrupt here */
|
|
/* Set model inputs here */
|
|
|
|
/* Step the model */
|
|
ADM_Integrated_Logic_step();
|
|
|
|
/* Get model outputs here */
|
|
|
|
/* Indicate task complete */
|
|
OverrunFlag = false;
|
|
|
|
/* Disable interrupts here */
|
|
/* Restore FPU context here (if necessary) */
|
|
/* Enable interrupts here */
|
|
}
|
|
|
|
/*
|
|
* The example main function illustrates what is required by your
|
|
* application code to initialize, execute, and terminate the generated code.
|
|
* Attaching rt_OneStep to a real-time clock is target specific. This example
|
|
* illustrates how you do this relative to initializing the model.
|
|
*/
|
|
int main(int argc, const char *argv[])
|
|
{
|
|
/* Unused arguments */
|
|
(void)(argc);
|
|
(void)(argv);
|
|
|
|
/* Initialize model */
|
|
ADM_Integrated_Logic_initialize();
|
|
|
|
/* Attach rt_OneStep to a timer or interrupt service routine with
|
|
* period 0.002 seconds (base rate of the model) here.
|
|
* The call syntax for rt_OneStep is
|
|
*
|
|
* rt_OneStep();
|
|
*/
|
|
printf("Warning: The simulation will run forever. "
|
|
"Generated ERT main won't simulate model step behavior. "
|
|
"To change this behavior select the 'MAT-file logging' option.\n");
|
|
fflush((NULL));
|
|
while (rtmGetErrorStatus(ADM_Integrated_Logic_M) == (NULL)) {
|
|
/* Perform application tasks here */
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
|
|
/*
|
|
* File trailer for generated code.
|
|
*
|
|
* [EOF]
|
|
*/
|