plugger.py
changeset 601 d0e3fc4b9951
parent 592 c6408f92da0a
child 604 5b1c92060fc2
equal deleted inserted replaced
599:c7be4d09c5f4 601:d0e3fc4b9951
  1318            "programs_declarations":
  1318            "programs_declarations":
  1319                "\n".join(["extern %(type)s %(C_path)s;"%p for p in self._ProgramList]),
  1319                "\n".join(["extern %(type)s %(C_path)s;"%p for p in self._ProgramList]),
  1320            "extern_variables_declarations":"\n".join([
  1320            "extern_variables_declarations":"\n".join([
  1321               {"EXT":"extern __IEC_%(type)s_p %(C_path)s;",
  1321               {"EXT":"extern __IEC_%(type)s_p %(C_path)s;",
  1322                "IN":"extern __IEC_%(type)s_p %(C_path)s;",
  1322                "IN":"extern __IEC_%(type)s_p %(C_path)s;",
       
  1323                "MEM":"extern __IEC_%(type)s_p %(C_path)s;",
  1323                "OUT":"extern __IEC_%(type)s_p %(C_path)s;",
  1324                "OUT":"extern __IEC_%(type)s_p %(C_path)s;",
  1324                "VAR":"extern __IEC_%(type)s_t %(C_path)s;"}[v["vartype"]]%v 
  1325                "VAR":"extern __IEC_%(type)s_t %(C_path)s;"}[v["vartype"]]%v 
  1325                for v in self._VariablesList if v["vartype"] != "FB" and v["C_path"].find('.')<0]),
  1326                for v in self._VariablesList if v["vartype"] != "FB" and v["C_path"].find('.')<0]),
  1326            "for_each_variable_do_code":"\n".join([
  1327            "for_each_variable_do_code":"\n".join([
  1327                {"EXT":"    (*fp)((void*)&%(C_path)s,%(type)s_P_ENUM);\n",
  1328                {"EXT":"    (*fp)((void*)&%(C_path)s,%(type)s_P_ENUM);\n",
  1328                 "IN":"    (*fp)((void*)&%(C_path)s,%(type)s_P_ENUM);\n",
  1329                 "IN":"    (*fp)((void*)&%(C_path)s,%(type)s_P_ENUM);\n",
       
  1330                 "MEM":"    (*fp)((void*)&%(C_path)s,%(type)s_P_ENUM);\n",
  1329                 "OUT":"    (*fp)((void*)&%(C_path)s,%(type)s_O_ENUM);\n",
  1331                 "OUT":"    (*fp)((void*)&%(C_path)s,%(type)s_O_ENUM);\n",
  1330                 "VAR":"    (*fp)((void*)&%(C_path)s,%(type)s_ENUM);\n"}[v["vartype"]]%v
  1332                 "VAR":"    (*fp)((void*)&%(C_path)s,%(type)s_ENUM);\n"}[v["vartype"]]%v
  1331                 for v in self._VariablesList if v["vartype"] != "FB" and v["type"] in DebugTypesSize ]),
  1333                 for v in self._VariablesList if v["vartype"] != "FB" and v["type"] in DebugTypesSize ]),
  1332            "find_variable_case_code":"\n".join([
  1334            "find_variable_case_code":"\n".join([
  1333                "    case %(num)s:\n"%v+
  1335                "    case %(num)s:\n"%v+
  1334                "        *varp = (void*)&%(C_path)s;\n"%v+
  1336                "        *varp = (void*)&%(C_path)s;\n"%v+
  1335                {"EXT":"        return %(type)s_P_ENUM;\n",
  1337                {"EXT":"        return %(type)s_P_ENUM;\n",
  1336                 "IN":"        return %(type)s_P_ENUM;\n",
  1338                 "IN":"        return %(type)s_P_ENUM;\n",
       
  1339                 "MEM":"        return %(type)s_P_ENUM;\n",
  1337                 "OUT":"        return %(type)s_O_ENUM;\n",
  1340                 "OUT":"        return %(type)s_O_ENUM;\n",
  1338                 "VAR":"        return %(type)s_ENUM;\n"}[v["vartype"]]%v
  1341                 "VAR":"        return %(type)s_ENUM;\n"}[v["vartype"]]%v
  1339                 for v in self._VariablesList if v["vartype"] != "FB" and v["type"] in DebugTypesSize ])}
  1342                 for v in self._VariablesList if v["vartype"] != "FB" and v["type"] in DebugTypesSize ])}
  1340         
  1343         
  1341         return debug_code
  1344         return debug_code