User`s guide

50
#include "benchmark.h"
#include "benchmark_private.h"
/* Block signals (auto storage) */
BlockIO_benchmark benchmark_B;
/* Block states (auto storage) */
D_Work_benchmark benchmark_DWork;
/* Previous zero-crossings (trigger) states */
PrevZCSigStates_benchmark benchmark_PrevZCSigState;
/* Real-time model */
RT_MODEL_benchmark benchmark_M_;
RT_MODEL_benchmark *benchmark_M = &benchmark_M_;
/* Model output function */
static void benchmark_output(int_T tid)
{
/* S-Function Block: <Root>/Digital Input (c28xgpio_di) */
{
benchmark_B.DigitalInput = GpioDataRegs.GPADAT.bit.GPIOA15;
}
if ((benchmark_B.DigitalInput > 0U) &&
(benchmark_PrevZCSigState.TriggeredSubsystem_ZCE == 0L)) {
/* Output and update for trigger system: '<Root>/Triggered Subsystem' */
/* DiscreteFilter: '<S2>/Discrete Filter' incorporates:
* Constant: '<Root>/Constant'
*/
benchmark_B.DiscreteFilter = benchmark_P.DiscreteFilter_D*
benchmark_P.Constant_Value;
{
int_T nx = 999;
const real_T *x = &benchmark_DWork.DiscreteFilter_DSTATE[0];
const real_T *Cmtx = &benchmark_P.DiscreteFilter_C[0];
while (nx--) {
benchmark_B.DiscreteFilter += (*Cmtx) * (*x++);
Cmtx += 1;
}
}
/* S-Function Block: <S2>/Read From Timer (smemsrc) */
{
/* Memory Mapped Input */
const uint16_T *memind = (uint16_T *) 29697U;
benchmark_B.ReadFromTimer = *(uint16_T*)(memind++);
}
/* S-Function Block: <S2>/Write Timer To Memorypos. (smemsnk) */
{
/* Memory Mapped Output */
const uint16_T *memind = (uint16_T *) 2147483711U;
*(uint16_T *)(memind++) = (uint16_T) benchmark_B.ReadFromTimer;
}
/* DiscreteFilter Block: '<S2>/Discrete Filter' */