⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 c1_sim_netcon.c

📁 RFID读卡器与标签之间在AWGN和加入其它读写器干扰下的BER仿真
💻 C
📖 第 1 页 / 共 4 页
字号:
        _SFD_CS_CALL(STATE_ENTER_DURING_FUNCTION_TAG,0);
        if(CV_TRANSITION_EVAL(9U, (int32_T)_SFD_CCP_CALL(9,0,(chartInstance.c1_i
            == 1))) != 0) {
          if(sf_debug_transition_conflict_check_enabled()) {
            unsigned int transitionList[3];
            unsigned int numTransitions=1;
            transitionList[0] = 9;
            sf_debug_transition_conflict_check_begin();
            if((chartInstance.c1_code == 1) && (chartInstance.c1_i == 0)) {
              transitionList[numTransitions] = 10;
              numTransitions++;
            }
            if((chartInstance.c1_code == 0) && (chartInstance.c1_i == 0)) {
              transitionList[numTransitions] = 4;
              numTransitions++;
            }
            sf_debug_transition_conflict_check_end();
            if(numTransitions>1) {
              _SFD_TRANSITION_CONFLICT(&(transitionList[0]),numTransitions);
            }
          }
          _SFD_CT_CALL(TRANSITION_ACTIVE_TAG,9);
          _SFD_CT_CALL(TRANSITION_ACTIVE_TAG,16);
          chartInstance.c1_count = c1__u16_s32_(chartInstance.c1_count + 1);
          _SFD_DATA_RANGE_CHECK((real_T)chartInstance.c1_count, 3U);
          output(chartInstance.c1_convec);
          chartInstance.c1_i = c1__u8_s8_(0);
          _SFD_DATA_RANGE_CHECK((real_T)chartInstance.c1_i, 0U);
          _SFD_CT_CALL(TRANSITION_ACTIVE_TAG,14);
          chartInstance.c1_code = (uint8_T)In1(chartInstance.c1_count);
          _SFD_DATA_RANGE_CHECK((real_T)chartInstance.c1_code, 1U);
          if(CV_TRANSITION_EVAL(17U, (_SFD_CCP_CALL(17,0,(chartInstance.c1_code
               == 0)) != 0) || (_SFD_CCP_CALL(17,1,(chartInstance.c1_code ==
               1)) != 0)) != 0) {
            _SFD_CT_CALL(TRANSITION_ACTIVE_TAG,17);
            c1_exit_internal_Road();
            chartInstance.c1_tp_Road = 0;
            chartInstance.c1_is_c1_sim_netcon = (uint8_T)c1_IN_NO_ACTIVE_CHILD;
            _SFD_CS_CALL(STATE_INACTIVE_TAG,4);
            chartInstance.c1_is_c1_sim_netcon = (uint8_T)c1_IN_Road;
            _SFD_CS_CALL(STATE_ACTIVE_TAG,4);
            chartInstance.c1_tp_Road = 1;
            c1_enter_internal_Road();
          } else {
            _SFD_CT_CALL(TRANSITION_ACTIVE_TAG,0);
          }
        } else if(CV_TRANSITION_EVAL(10U,
          (_SFD_CCP_CALL(10,0,(chartInstance.c1_code == 1)) != 0) &&
          (_SFD_CCP_CALL(10,1,(chartInstance.c1_i
             == 0)) != 0)) != 0) {
          if(sf_debug_transition_conflict_check_enabled()) {
            unsigned int transitionList[2];
            unsigned int numTransitions=1;
            transitionList[0] = 10;
            sf_debug_transition_conflict_check_begin();
            if((chartInstance.c1_code == 0) && (chartInstance.c1_i == 0)) {
              transitionList[numTransitions] = 4;
              numTransitions++;
            }
            sf_debug_transition_conflict_check_end();
            if(numTransitions>1) {
              _SFD_TRANSITION_CONFLICT(&(transitionList[0]),numTransitions);
            }
          }
          _SFD_CT_CALL(TRANSITION_ACTIVE_TAG,10);
          chartInstance.c1_convec[1] = c1__u8_s8_(0);
          _SFD_DATA_RANGE_CHECK((real_T)chartInstance.c1_convec[1], 2U);
          chartInstance.c1_convec[0] = c1__u8_s8_(0);
          _SFD_DATA_RANGE_CHECK((real_T)chartInstance.c1_convec[0], 2U);
          chartInstance.c1_i = c1__u8_s8_(1);
          _SFD_DATA_RANGE_CHECK((real_T)chartInstance.c1_i, 0U);
          chartInstance.c1_tp_S2 = 0;
          chartInstance.c1_is_Road = (uint8_T)c1_IN_NO_ACTIVE_CHILD;
          _SFD_CS_CALL(STATE_INACTIVE_TAG,0);
          chartInstance.c1_is_Road = (uint8_T)c1_IN_S1;
          chartInstance.c1_was_Road = (uint8_T)c1_IN_S1;
          _SFD_CS_CALL(STATE_ACTIVE_TAG,2);
          chartInstance.c1_tp_S1 = 1;
        } else if(CV_TRANSITION_EVAL(4U,
          (_SFD_CCP_CALL(4,0,(chartInstance.c1_code == 0)) != 0) &&
          (_SFD_CCP_CALL(4,1,(chartInstance.c1_i
             == 0)) != 0)) != 0) {
          _SFD_CT_CALL(TRANSITION_ACTIVE_TAG,4);
          chartInstance.c1_convec[1] = c1__u8_s8_(1);
          _SFD_DATA_RANGE_CHECK((real_T)chartInstance.c1_convec[1], 2U);
          chartInstance.c1_convec[0] = c1__u8_s8_(1);
          _SFD_DATA_RANGE_CHECK((real_T)chartInstance.c1_convec[0], 2U);
          chartInstance.c1_i = c1__u8_s8_(1);
          _SFD_DATA_RANGE_CHECK((real_T)chartInstance.c1_i, 0U);
          chartInstance.c1_tp_S2 = 0;
          chartInstance.c1_is_Road = (uint8_T)c1_IN_NO_ACTIVE_CHILD;
          _SFD_CS_CALL(STATE_INACTIVE_TAG,0);
          chartInstance.c1_is_Road = (uint8_T)c1_IN_S0;
          chartInstance.c1_was_Road = (uint8_T)c1_IN_S0;
          _SFD_CS_CALL(STATE_ACTIVE_TAG,3);
          chartInstance.c1_tp_S0 = 1;
        }
        _SFD_CS_CALL(EXIT_OUT_OF_FUNCTION_TAG,0);
        break;
       case c1_IN_S3:
        CV_STATE_EVAL(4,0,4);
        _SFD_CS_CALL(STATE_ENTER_DURING_FUNCTION_TAG,1);
        if(CV_TRANSITION_EVAL(12U, (_SFD_CCP_CALL(12,0,(chartInstance.c1_code ==
             0)) != 0) && (_SFD_CCP_CALL(12,1,(chartInstance.c1_i == 0))
           != 0)) != 0) {
          if(sf_debug_transition_conflict_check_enabled()) {
            unsigned int transitionList[3];
            unsigned int numTransitions=1;
            transitionList[0] = 12;
            sf_debug_transition_conflict_check_begin();
            if((chartInstance.c1_code == 1) && (chartInstance.c1_i == 0)) {
              transitionList[numTransitions] = 3;
              numTransitions++;
            }
            if(chartInstance.c1_i == 1) {
              transitionList[numTransitions] = 2;
              numTransitions++;
            }
            sf_debug_transition_conflict_check_end();
            if(numTransitions>1) {
              _SFD_TRANSITION_CONFLICT(&(transitionList[0]),numTransitions);
            }
          }
          _SFD_CT_CALL(TRANSITION_ACTIVE_TAG,12);
          chartInstance.c1_convec[1] = c1__u8_s8_(0);
          _SFD_DATA_RANGE_CHECK((real_T)chartInstance.c1_convec[1], 2U);
          chartInstance.c1_convec[0] = c1__u8_s8_(1);
          _SFD_DATA_RANGE_CHECK((real_T)chartInstance.c1_convec[0], 2U);
          chartInstance.c1_i = c1__u8_s8_(1);
          _SFD_DATA_RANGE_CHECK((real_T)chartInstance.c1_i, 0U);
          chartInstance.c1_tp_S3 = 0;
          chartInstance.c1_is_Road = (uint8_T)c1_IN_NO_ACTIVE_CHILD;
          _SFD_CS_CALL(STATE_INACTIVE_TAG,1);
          chartInstance.c1_is_Road = (uint8_T)c1_IN_S2;
          chartInstance.c1_was_Road = (uint8_T)c1_IN_S2;
          _SFD_CS_CALL(STATE_ACTIVE_TAG,0);
          chartInstance.c1_tp_S2 = 1;
        } else if(CV_TRANSITION_EVAL(3U,
          (_SFD_CCP_CALL(3,0,(chartInstance.c1_code == 1)) != 0) &&
          (_SFD_CCP_CALL(3,1,(chartInstance.c1_i
             == 0)) != 0)) != 0) {
          if(sf_debug_transition_conflict_check_enabled()) {
            unsigned int transitionList[2];
            unsigned int numTransitions=1;
            transitionList[0] = 3;
            sf_debug_transition_conflict_check_begin();
            if(chartInstance.c1_i == 1) {
              transitionList[numTransitions] = 2;
              numTransitions++;
            }
            sf_debug_transition_conflict_check_end();
            if(numTransitions>1) {
              _SFD_TRANSITION_CONFLICT(&(transitionList[0]),numTransitions);
            }
          }
          _SFD_CT_CALL(TRANSITION_ACTIVE_TAG,3);
          chartInstance.c1_convec[1] = c1__u8_s8_(1);
          _SFD_DATA_RANGE_CHECK((real_T)chartInstance.c1_convec[1], 2U);
          chartInstance.c1_convec[0] = c1__u8_s8_(0);
          _SFD_DATA_RANGE_CHECK((real_T)chartInstance.c1_convec[0], 2U);
          chartInstance.c1_i = c1__u8_s8_(1);
          _SFD_DATA_RANGE_CHECK((real_T)chartInstance.c1_i, 0U);
          chartInstance.c1_tp_S3 = 0;
          chartInstance.c1_is_Road = (uint8_T)c1_IN_NO_ACTIVE_CHILD;
          _SFD_CS_CALL(STATE_INACTIVE_TAG,1);
          chartInstance.c1_is_Road = (uint8_T)c1_IN_S3;
          chartInstance.c1_was_Road = (uint8_T)c1_IN_S3;
          _SFD_CS_CALL(STATE_ACTIVE_TAG,1);
          chartInstance.c1_tp_S3 = 1;
        } else if(CV_TRANSITION_EVAL(2U,
          (int32_T)_SFD_CCP_CALL(2,0,(chartInstance.c1_i == 1))) != 0) {
          _SFD_CT_CALL(TRANSITION_ACTIVE_TAG,2);
          _SFD_CT_CALL(TRANSITION_ACTIVE_TAG,16);
          chartInstance.c1_count = c1__u16_s32_(chartInstance.c1_count + 1);
          _SFD_DATA_RANGE_CHECK((real_T)chartInstance.c1_count, 3U);
          output(chartInstance.c1_convec);
          chartInstance.c1_i = c1__u8_s8_(0);
          _SFD_DATA_RANGE_CHECK((real_T)chartInstance.c1_i, 0U);
          _SFD_CT_CALL(TRANSITION_ACTIVE_TAG,14);
          chartInstance.c1_code = (uint8_T)In1(chartInstance.c1_count);
          _SFD_DATA_RANGE_CHECK((real_T)chartInstance.c1_code, 1U);
          if(CV_TRANSITION_EVAL(17U, (_SFD_CCP_CALL(17,0,(chartInstance.c1_code
               == 0)) != 0) || (_SFD_CCP_CALL(17,1,(chartInstance.c1_code ==
               1)) != 0)) != 0) {
            _SFD_CT_CALL(TRANSITION_ACTIVE_TAG,17);
            c1_exit_internal_Road();
            chartInstance.c1_tp_Road = 0;
            chartInstance.c1_is_c1_sim_netcon = (uint8_T)c1_IN_NO_ACTIVE_CHILD;
            _SFD_CS_CALL(STATE_INACTIVE_TAG,4);
            chartInstance.c1_is_c1_sim_netcon = (uint8_T)c1_IN_Road;
            _SFD_CS_CALL(STATE_ACTIVE_TAG,4);
            chartInstance.c1_tp_Road = 1;
            c1_enter_internal_Road();
          } else {
            _SFD_CT_CALL(TRANSITION_ACTIVE_TAG,0);
          }
        }
        _SFD_CS_CALL(EXIT_OUT_OF_FUNCTION_TAG,1);
        break;
       default:
        CV_STATE_EVAL(4,0,0);
        break;
      }
      _SFD_CS_CALL(EXIT_OUT_OF_FUNCTION_TAG,4);
    }
    _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG,0);
    _SFD_CE_CALL(EVENT_AFTER_BROADCAST_TAG,c1_event_event);
    _sfEvent_ = c1_previousEvent;
  }
}

static void c1_enter_internal_Road(void)
{
  switch(chartInstance.c1_was_Road) {
   case c1_IN_S0:
    CV_STATE_EVAL(4,2,1);
    chartInstance.c1_is_Road = (uint8_T)c1_IN_S0;
    chartInstance.c1_was_Road = (uint8_T)c1_IN_S0;
    _SFD_CS_CALL(STATE_ACTIVE_TAG,3);
    chartInstance.c1_tp_S0 = 1;
    break;
   case c1_IN_S1:
    CV_STATE_EVAL(4,2,2);
    chartInstance.c1_is_Road = (uint8_T)c1_IN_S1;
    chartInstance.c1_was_Road = (uint8_T)c1_IN_S1;
    _SFD_CS_CALL(STATE_ACTIVE_TAG,2);
    chartInstance.c1_tp_S1 = 1;
    break;
   case c1_IN_S2:
    CV_STATE_EVAL(4,2,3);
    chartInstance.c1_is_Road = (uint8_T)c1_IN_S2;
    chartInstance.c1_was_Road = (uint8_T)c1_IN_S2;
    _SFD_CS_CALL(STATE_ACTIVE_TAG,0);
    chartInstance.c1_tp_S2 = 1;
    break;
   case c1_IN_S3:
    CV_STATE_EVAL(4,2,4);
    chartInstance.c1_is_Road = (uint8_T)c1_IN_S3;
    chartInstance.c1_was_Road = (uint8_T)c1_IN_S3;
    _SFD_CS_CALL(STATE_ACTIVE_TAG,1);
    chartInstance.c1_tp_S3 = 1;
    break;
   default:
    CV_STATE_EVAL(4,2,0);
    _SFD_CT_CALL(TRANSITION_ACTIVE_TAG,6);
    chartInstance.c1_is_Road = (uint8_T)c1_IN_S0;
    chartInstance.c1_was_Road = (uint8_T)c1_IN_S0;
    _SFD_CS_CALL(STATE_ACTIVE_TAG,3);
    chartInstance.c1_tp_S0 = 1;
    break;
  }
}

static void c1_exit_internal_Road(void)
{
  switch(chartInstance.c1_is_Road) {
   case c1_IN_S0:
    CV_STATE_EVAL(4,1,1);
    chartInstance.c1_tp_S0 = 0;
    chartInstance.c1_is_Road = (uint8_T)c1_IN_NO_ACTIVE_CHILD;
    _SFD_CS_CALL(STATE_INACTIVE_TAG,3);
    break;
   case c1_IN_S1:
    CV_STATE_EVAL(4,1,2);
    chartInstance.c1_tp_S1 = 0;
    chartInstance.c1_is_Road = (uint8_T)c1_IN_NO_ACTIVE_CHILD;
    _SFD_CS_CALL(STATE_INACTIVE_TAG,2);
    break;
   case c1_IN_S2:
    CV_STATE_EVAL(4,1,3);
    chartInstance.c1_tp_S2 = 0;
    chartInstance.c1_is_Road = (uint8_T)c1_IN_NO_ACTIVE_CHILD;
    _SFD_CS_CALL(STATE_INACTIVE_TAG,0);
    break;
   case c1_IN_S3:
    CV_STATE_EVAL(4,1,4);
    chartInstance.c1_tp_S3 = 0;
    chartInstance.c1_is_Road = (uint8_T)c1_IN_NO_ACTIVE_CHILD;
    _SFD_CS_CALL(STATE_INACTIVE_TAG,1);
    break;
   default:
    CV_STATE_EVAL(4,1,0);
    break;
  }
}

static uint8_T c1__u8_s8_(int8_T c1_b)
{
  uint8_T c1_a;
  c1_a = (uint8_T)c1_b;
  if(c1_b < 0) {
    sf_debug_overflow_detection(0);
  }
  return c1_a;
}

static uint16_T c1__u16_s32_(int32_T c1_b)
{
  uint16_T c1_a;
  c1_a = (uint16_T)c1_b;
  if(c1_a != c1_b) {
    sf_debug_overflow_detection(0);
  }
  return c1_a;
}

static uint16_T c1__u16_s8_(int8_T c1_b)
{
  uint16_T c1_a;
  c1_a = (uint16_T)c1_b;
  if(c1_b < 0) {
    sf_debug_overflow_detection(0);
  }
  return c1_a;
}

static void init_test_point_addr_map(void)
{
  chartInstance.c1_testPointAddrMap[0] = &chartInstance.c1_count;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -