1 line
15 KiB
JavaScript
1 line
15 KiB
JavaScript
![]() |
var dataJson = {"arch":{"ispc":true,"isunix":false,"ismac":false},"build":"test1","ref":false,"files":[{"name":"ert_main.c","type":"source","group":"main","path":"F:\\desktop\\EMS(能量管理系统)\\simulink\\test1_ert_rtw","tag":"","groupDisplay":"主文件","code":"/*\r\n * File: ert_main.c\r\n *\r\n * Code generated for Simulink model 'test1'.\r\n *\r\n * Model version : 1.12\r\n * Simulink Coder version : 9.8 (R2022b) 13-May-2022\r\n * C/C++ source code generated on : Mon Jan 29 10:36:35 2024\r\n *\r\n * Target selection: ert.tlc\r\n * Embedded hardware selection: Intel->x86-64 (Windows64)\r\n * Code generation objectives: Unspecified\r\n * Validation result: Not run\r\n */\r\n\r\n#include <stddef.h>\r\n#include <stdio.h> /* This example main program uses printf/fflush */\r\n#include \"test1.h\" /* Model header file */\r\n\r\n/*\r\n * Associating rt_OneStep with a real-time clock or interrupt service routine\r\n * is what makes the generated code \"real-time\". The function rt_OneStep is\r\n * always associated with the base rate of the model. Subrates are managed\r\n * by the base rate from inside the generated code. Enabling/disabling\r\n * interrupts and floating point context switches are target specific. This\r\n * example code indicates where these should take place relative to executing\r\n * the generated code step function. Overrun behavior should be tailored to\r\n * your application needs. This example simply sets an error status in the\r\n * real-time model and returns from rt_OneStep.\r\n */\r\nvoid rt_OneStep(void);\r\nvoid rt_OneStep(void)\r\n{\r\n static boolean_T OverrunFlag = false;\r\n\r\n /* Disable interrupts here */\r\n\r\n /* Check for overrun */\r\n if (OverrunFlag) {\r\n rtmSetErrorStatus(rtM, \"Overrun\");\r\n return;\r\n }\r\n\r\n OverrunFlag = true;\r\n\r\n /* Save FPU context here (if necessary) */\r\n /* Re-enable timer or interrupt here */\r\n /* Set model inputs here */\r\n\r\n /* Step the model */\r\n test1_step();\r\n\r\n /* Get model outputs here */\r\n\r\n /* Indicate task complete */\r\n OverrunFlag = false;\r\n\r\n /* Disable interrupts here */\r\n /* Restore FPU context here (if necessary) */\r\n /* Enable interrupts here */\r\n}\r\n\r\n/*\r\n * The example main function illustrates what is required by your\r\n * application code to initialize, execute, and terminate the generated code.\r\n * Attaching rt_OneStep to a real-time clock is target specific. This example\r\n * illustrates how you do this relative to initializing the model.\r\n */\r\nint_T main(int_T argc, const char *argv[])\r\n{\r\n /* Unused arguments */\r\n (void)(argc);\r\n (void)(argv);\r\n\r\n /* Initialize model */\r\n test1_initialize();\r\n\r\n /* Attach rt_OneStep to a timer or interrupt service routine with\r\n * period 0.01 seconds (base rate of the model) here.\r\n * The call syntax for rt_OneStep is\r\n *\r\n * rt_OneStep();\r\n */\r\n printf(\"Warning: The simulation will run forever. \"\r\n \"Generated ERT main won't simulate model step behavior. \"\r\n \"To change this behavior select the 'MAT-file logging' option.\\n\");\r\n fflush((NULL));\r\n while (rtmGetErrorStatus(rtM) == (NULL)) {\r\n /* Perform application tasks here */\r\n }\r\n\r\n /* Terminate model */\r\n test1_terminate();\r\n return 0;\r\n}\r\n\r\n/*\r\n * File trailer for generated code.\r\n *\r\n * [EOF]\r\n */\r\n"},{"name":"test1.c","type":"source","group":"model","path":"F:\\desktop\\EMS(能量管理系统)\\simulink\\test1_ert_rtw","tag":"","groupDisplay":"模型文件","code":"/*\r\n * File: test1.c\r\n *\r\n * Code generated for Simulink model 'test1'.\r\n *\r\n * Model version : 1.12\r\n * Simulink Coder version : 9.8 (R2022b) 13-May-2022\r\n * C/C++ source code generated on : Mon Jan 29 10:36:35 2024\r\n *\r\n * Target selection: ert.tlc\r\n * Embedded hardware selection: Intel->x86-64 (Windows64)\r\n * Code generation objectives: Unspecified\r\n * Validation result: N
|