diff --git a/lib/ini_parser.dart b/lib/ini_parser.dart index fc6cd7a..c40284f 100644 --- a/lib/ini_parser.dart +++ b/lib/ini_parser.dart @@ -22,7 +22,7 @@ class INIParser { final String raw; final List lines = []; final List settings = []; - final Map> defines = {}; + final PreProcessorDefines defines = {}; // assume that top level definitions are in the TunerStudio section (see FOME) String _currentSection = 'TunerStudio'; @@ -103,13 +103,13 @@ class INIParser { } Future _parsePcVariables() async { - _config.pcVariables = - await PcVariablesParser().parse(_sections['PcVariables'] ?? []); + _config.pcVariables = await PcVariablesParser(defines: defines) + .parse(_sections['PcVariables'] ?? []); } Future _parseConstants() async { - _config.constants = - await ConstantsParser().parse(_sections['Constants'] ?? []); + _config.constants = await ConstantsParser(defines: defines) + .parse(_sections['Constants'] ?? []); } Future _parseOutputChannels() async { diff --git a/lib/pre_processor.dart b/lib/pre_processor.dart index 0f74802..979dac1 100644 --- a/lib/pre_processor.dart +++ b/lib/pre_processor.dart @@ -1,5 +1,7 @@ import 'package:ini_parser/extensions.dart'; +typedef PreProcessorDefines = Map>; + class PreProcessor { PreProcessor({ required this.raw, @@ -8,7 +10,7 @@ class PreProcessor { late final String raw; late final List settings; final List lines = []; - final Map> defines = {}; + final PreProcessorDefines defines = {}; /// Pre-process INI: /// - remove comments @@ -88,7 +90,8 @@ class PreProcessor { if (line.startsWith('#define')) { final parts = line.substring(7).trim().split('='); final key = parts[0].sanitize(); - final values = parts[1].sanitize().split(',').map((e) => e.sanitize()); + final values = + parts[1].sanitize().split(',').map((e) => e.clearString()); defines.addAll({ key: values.toList(), diff --git a/lib/sections/constants_parser.dart b/lib/sections/constants_parser.dart index 15982af..e9d05af 100644 --- a/lib/sections/constants_parser.dart +++ b/lib/sections/constants_parser.dart @@ -2,11 +2,16 @@ import 'package:ini_parser/extensions.dart'; import 'package:ini_parser/models/ini_config.dart'; import 'package:ini_parser/parsing_exception.dart'; import 'package:ini_parser/patterns.dart'; +import 'package:ini_parser/pre_processor.dart'; import 'package:ini_parser/section.dart'; import 'package:text_parser/text_parser.dart'; class ConstantsParser { + ConstantsParser({required this.defines}); + + late final PreProcessorDefines defines; final _constants = Constants(); + int _currentPage = 0; final _parser = TextParser( @@ -96,6 +101,14 @@ class ConstantsParser { options = optionsRaw.asMap(); } + // resolve defines (ex. $loadSourceNames) + if (options[0] != null && options[0]!.startsWith(r'$')) { + final foundDefines = defines[options[0]!.substring(1)]; + if (foundDefines != null) { + options = foundDefines.asMap(); + } + } + final bitsRaw = result[4] .replaceAll(RegExp(r'[^\d:]'), '') .clearString() diff --git a/lib/sections/pc_variables_parser.dart b/lib/sections/pc_variables_parser.dart index f4a18c0..63fab36 100644 --- a/lib/sections/pc_variables_parser.dart +++ b/lib/sections/pc_variables_parser.dart @@ -2,10 +2,14 @@ import 'package:ini_parser/extensions.dart'; import 'package:ini_parser/models/ini_config.dart'; import 'package:ini_parser/parsing_exception.dart'; import 'package:ini_parser/patterns.dart'; +import 'package:ini_parser/pre_processor.dart'; import 'package:ini_parser/section.dart'; import 'package:text_parser/text_parser.dart'; class PcVariablesParser { + PcVariablesParser({required this.defines}); + + late final PreProcessorDefines defines; final List _pcVariables = []; final _parser = TextParser( @@ -73,6 +77,14 @@ class PcVariablesParser { options = optionsRaw.asMap(); } + // resolve defines (ex. $loadSourceNames) + if (options[0] != null && options[0]!.startsWith(r'$')) { + final foundDefines = defines[options[0]!.substring(1)]; + if (foundDefines != null) { + options = foundDefines.asMap(); + } + } + final bitsRaw = result[3] .replaceAll(RegExp(r'[^\d:]'), '') .clearString() diff --git a/test/data/speeduino/json/202207.json b/test/data/speeduino/json/202207.json index 86fdaa3..23aab38 100644 --- a/test/data/speeduino/json/202207.json +++ b/test/data/speeduino/json/202207.json @@ -273,7 +273,14 @@ "high": 2 }, "options": { - "0": "$loadSourceNames" + "0": "MAP", + "1": "TPS", + "2": "IMAP/EMAP", + "3": "INVALID", + "4": "INVALID", + "5": "INVALID", + "6": "INVALID", + "7": "INVALID" } }, { @@ -771,7 +778,72 @@ "high": 7 }, "options": { - "0": "$pinLayouts" + "0": "INVALID", + "1": "Speeduino v0.2", + "2": "Speeduino v0.3", + "3": "Speeduino v0.4", + "4": "INVALID", + "5": "INVALID", + "6": "01-05 MX5 PNP", + "7": "INVALID", + "8": "96-97 MX5 PNP", + "9": "NA6 MX5 PNP", + "10": "Turtana PCB", + "11": "INVALID", + "12": "INVALID", + "13": "INVALID", + "14": "INVALID", + "15": "INVALID", + "16": "INVALID", + "17": "INVALID", + "18": "INVALID", + "19": "INVALID", + "20": "Plazomat I/O 0.1", + "21": "INVALID", + "22": "INVALID", + "23": "INVALID", + "24": "INVALID", + "25": "INVALID", + "26": "INVALID", + "27": "INVALID", + "28": "INVALID", + "29": "INVALID", + "30": "Daz V6 Shield 0.1", + "31": "BMW PnP", + "32": "INVALID", + "33": "INVALID", + "34": "INVALID", + "35": "INVALID", + "36": "INVALID", + "37": "INVALID", + "38": "INVALID", + "39": "INVALID", + "40": "NO2C", + "41": "UA4C", + "42": "INVALID", + "43": "INVALID", + "44": "INVALID", + "45": "DIY-EFI CORE4 v1.0", + "46": "INVALID", + "47": "INVALID", + "48": "INVALID", + "49": "INVALID", + "50": "dvjcodec Teensy RevA", + "51": "dvjcodec Teensy RevB", + "52": "INVALID", + "53": "JUICEBOX", + "54": "INVALID", + "55": "Drop Bear", + "56": "INVALID", + "57": "INVALID", + "58": "INVALID", + "59": "INVALID", + "60": "Black STM32F407VET6 V0.1", + "61": "INVALID", + "62": "INVALID", + "63": "INVALID", + "64": "$invalid_x128", + "65": "$invalid_x64" } }, { @@ -1156,7 +1228,14 @@ "high": 6 }, "options": { - "0": "$loadSourceNames" + "0": "MAP", + "1": "TPS", + "2": "IMAP/EMAP", + "3": "INVALID", + "4": "INVALID", + "5": "INVALID", + "6": "INVALID", + "7": "INVALID" } }, { @@ -1283,7 +1362,14 @@ "high": 2 }, "options": { - "0": "$loadSourceNames" + "0": "MAP", + "1": "TPS", + "2": "IMAP/EMAP", + "3": "INVALID", + "4": "INVALID", + "5": "INVALID", + "6": "INVALID", + "7": "INVALID" } }, { @@ -7297,7 +7383,14 @@ "high": 10 }, "options": { - "0": "$CAN_ADDRESS_HEX" + "0": "$CAN_ADDRESS_HEX_01XX", + "1": "$CAN_ADDRESS_HEX_02XX", + "2": "$CAN_ADDRESS_HEX_03XX", + "3": "$CAN_ADDRESS_HEX_04XX", + "4": "$CAN_ADDRESS_HEX_05XX", + "5": "$CAN_ADDRESS_HEX_06XX", + "6": "$CAN_ADDRESS_HEX_07XX", + "7": "$CAN_ADDRESS_HEX_inv255" } }, { @@ -7310,7 +7403,14 @@ "high": 10 }, "options": { - "0": "$CAN_ADDRESS_HEX" + "0": "$CAN_ADDRESS_HEX_01XX", + "1": "$CAN_ADDRESS_HEX_02XX", + "2": "$CAN_ADDRESS_HEX_03XX", + "3": "$CAN_ADDRESS_HEX_04XX", + "4": "$CAN_ADDRESS_HEX_05XX", + "5": "$CAN_ADDRESS_HEX_06XX", + "6": "$CAN_ADDRESS_HEX_07XX", + "7": "$CAN_ADDRESS_HEX_inv255" } }, { @@ -7323,7 +7423,14 @@ "high": 10 }, "options": { - "0": "$CAN_ADDRESS_HEX" + "0": "$CAN_ADDRESS_HEX_01XX", + "1": "$CAN_ADDRESS_HEX_02XX", + "2": "$CAN_ADDRESS_HEX_03XX", + "3": "$CAN_ADDRESS_HEX_04XX", + "4": "$CAN_ADDRESS_HEX_05XX", + "5": "$CAN_ADDRESS_HEX_06XX", + "6": "$CAN_ADDRESS_HEX_07XX", + "7": "$CAN_ADDRESS_HEX_inv255" } }, { @@ -7336,7 +7443,14 @@ "high": 10 }, "options": { - "0": "$CAN_ADDRESS_HEX" + "0": "$CAN_ADDRESS_HEX_01XX", + "1": "$CAN_ADDRESS_HEX_02XX", + "2": "$CAN_ADDRESS_HEX_03XX", + "3": "$CAN_ADDRESS_HEX_04XX", + "4": "$CAN_ADDRESS_HEX_05XX", + "5": "$CAN_ADDRESS_HEX_06XX", + "6": "$CAN_ADDRESS_HEX_07XX", + "7": "$CAN_ADDRESS_HEX_inv255" } }, { @@ -7349,7 +7463,14 @@ "high": 10 }, "options": { - "0": "$CAN_ADDRESS_HEX" + "0": "$CAN_ADDRESS_HEX_01XX", + "1": "$CAN_ADDRESS_HEX_02XX", + "2": "$CAN_ADDRESS_HEX_03XX", + "3": "$CAN_ADDRESS_HEX_04XX", + "4": "$CAN_ADDRESS_HEX_05XX", + "5": "$CAN_ADDRESS_HEX_06XX", + "6": "$CAN_ADDRESS_HEX_07XX", + "7": "$CAN_ADDRESS_HEX_inv255" } }, { @@ -7362,7 +7483,14 @@ "high": 10 }, "options": { - "0": "$CAN_ADDRESS_HEX" + "0": "$CAN_ADDRESS_HEX_01XX", + "1": "$CAN_ADDRESS_HEX_02XX", + "2": "$CAN_ADDRESS_HEX_03XX", + "3": "$CAN_ADDRESS_HEX_04XX", + "4": "$CAN_ADDRESS_HEX_05XX", + "5": "$CAN_ADDRESS_HEX_06XX", + "6": "$CAN_ADDRESS_HEX_07XX", + "7": "$CAN_ADDRESS_HEX_inv255" } }, { @@ -7375,7 +7503,14 @@ "high": 10 }, "options": { - "0": "$CAN_ADDRESS_HEX" + "0": "$CAN_ADDRESS_HEX_01XX", + "1": "$CAN_ADDRESS_HEX_02XX", + "2": "$CAN_ADDRESS_HEX_03XX", + "3": "$CAN_ADDRESS_HEX_04XX", + "4": "$CAN_ADDRESS_HEX_05XX", + "5": "$CAN_ADDRESS_HEX_06XX", + "6": "$CAN_ADDRESS_HEX_07XX", + "7": "$CAN_ADDRESS_HEX_inv255" } }, { @@ -7388,7 +7523,14 @@ "high": 10 }, "options": { - "0": "$CAN_ADDRESS_HEX" + "0": "$CAN_ADDRESS_HEX_01XX", + "1": "$CAN_ADDRESS_HEX_02XX", + "2": "$CAN_ADDRESS_HEX_03XX", + "3": "$CAN_ADDRESS_HEX_04XX", + "4": "$CAN_ADDRESS_HEX_05XX", + "5": "$CAN_ADDRESS_HEX_06XX", + "6": "$CAN_ADDRESS_HEX_07XX", + "7": "$CAN_ADDRESS_HEX_inv255" } }, { @@ -7401,7 +7543,14 @@ "high": 10 }, "options": { - "0": "$CAN_ADDRESS_HEX" + "0": "$CAN_ADDRESS_HEX_01XX", + "1": "$CAN_ADDRESS_HEX_02XX", + "2": "$CAN_ADDRESS_HEX_03XX", + "3": "$CAN_ADDRESS_HEX_04XX", + "4": "$CAN_ADDRESS_HEX_05XX", + "5": "$CAN_ADDRESS_HEX_06XX", + "6": "$CAN_ADDRESS_HEX_07XX", + "7": "$CAN_ADDRESS_HEX_inv255" } }, { @@ -7414,7 +7563,14 @@ "high": 10 }, "options": { - "0": "$CAN_ADDRESS_HEX" + "0": "$CAN_ADDRESS_HEX_01XX", + "1": "$CAN_ADDRESS_HEX_02XX", + "2": "$CAN_ADDRESS_HEX_03XX", + "3": "$CAN_ADDRESS_HEX_04XX", + "4": "$CAN_ADDRESS_HEX_05XX", + "5": "$CAN_ADDRESS_HEX_06XX", + "6": "$CAN_ADDRESS_HEX_07XX", + "7": "$CAN_ADDRESS_HEX_inv255" } }, { @@ -7427,7 +7583,14 @@ "high": 10 }, "options": { - "0": "$CAN_ADDRESS_HEX" + "0": "$CAN_ADDRESS_HEX_01XX", + "1": "$CAN_ADDRESS_HEX_02XX", + "2": "$CAN_ADDRESS_HEX_03XX", + "3": "$CAN_ADDRESS_HEX_04XX", + "4": "$CAN_ADDRESS_HEX_05XX", + "5": "$CAN_ADDRESS_HEX_06XX", + "6": "$CAN_ADDRESS_HEX_07XX", + "7": "$CAN_ADDRESS_HEX_inv255" } }, { @@ -7440,7 +7603,14 @@ "high": 10 }, "options": { - "0": "$CAN_ADDRESS_HEX" + "0": "$CAN_ADDRESS_HEX_01XX", + "1": "$CAN_ADDRESS_HEX_02XX", + "2": "$CAN_ADDRESS_HEX_03XX", + "3": "$CAN_ADDRESS_HEX_04XX", + "4": "$CAN_ADDRESS_HEX_05XX", + "5": "$CAN_ADDRESS_HEX_06XX", + "6": "$CAN_ADDRESS_HEX_07XX", + "7": "$CAN_ADDRESS_HEX_inv255" } }, { @@ -7453,7 +7623,14 @@ "high": 10 }, "options": { - "0": "$CAN_ADDRESS_HEX" + "0": "$CAN_ADDRESS_HEX_01XX", + "1": "$CAN_ADDRESS_HEX_02XX", + "2": "$CAN_ADDRESS_HEX_03XX", + "3": "$CAN_ADDRESS_HEX_04XX", + "4": "$CAN_ADDRESS_HEX_05XX", + "5": "$CAN_ADDRESS_HEX_06XX", + "6": "$CAN_ADDRESS_HEX_07XX", + "7": "$CAN_ADDRESS_HEX_inv255" } }, { @@ -7466,7 +7643,14 @@ "high": 10 }, "options": { - "0": "$CAN_ADDRESS_HEX" + "0": "$CAN_ADDRESS_HEX_01XX", + "1": "$CAN_ADDRESS_HEX_02XX", + "2": "$CAN_ADDRESS_HEX_03XX", + "3": "$CAN_ADDRESS_HEX_04XX", + "4": "$CAN_ADDRESS_HEX_05XX", + "5": "$CAN_ADDRESS_HEX_06XX", + "6": "$CAN_ADDRESS_HEX_07XX", + "7": "$CAN_ADDRESS_HEX_inv255" } }, { @@ -7479,7 +7663,14 @@ "high": 10 }, "options": { - "0": "$CAN_ADDRESS_HEX" + "0": "$CAN_ADDRESS_HEX_01XX", + "1": "$CAN_ADDRESS_HEX_02XX", + "2": "$CAN_ADDRESS_HEX_03XX", + "3": "$CAN_ADDRESS_HEX_04XX", + "4": "$CAN_ADDRESS_HEX_05XX", + "5": "$CAN_ADDRESS_HEX_06XX", + "6": "$CAN_ADDRESS_HEX_07XX", + "7": "$CAN_ADDRESS_HEX_inv255" } }, { @@ -7492,7 +7683,14 @@ "high": 10 }, "options": { - "0": "$CAN_ADDRESS_HEX" + "0": "$CAN_ADDRESS_HEX_01XX", + "1": "$CAN_ADDRESS_HEX_02XX", + "2": "$CAN_ADDRESS_HEX_03XX", + "3": "$CAN_ADDRESS_HEX_04XX", + "4": "$CAN_ADDRESS_HEX_05XX", + "5": "$CAN_ADDRESS_HEX_06XX", + "6": "$CAN_ADDRESS_HEX_07XX", + "7": "$CAN_ADDRESS_HEX_inv255" } }, { @@ -8551,7 +8749,22 @@ "high": 3 }, "options": { - "0": "$tsCanId_list" + "0": "CAN ID 0", + "1": "CAN ID 1", + "2": "CAN ID 2", + "3": "CAN ID 3", + "4": "CAN ID 4", + "5": "CAN ID 5", + "6": "CAN ID 6", + "7": "CAN ID 7", + "8": "CAN ID 8", + "9": "CAN ID 9", + "10": "CAN ID 10", + "11": "CAN ID 11", + "12": "CAN ID 12", + "13": "CAN ID 13", + "14": "CAN ID 14", + "15": "INVALID" } }, { @@ -8564,7 +8777,14 @@ "high": 10 }, "options": { - "0": "$CAN_ADDRESS_HEX" + "0": "$CAN_ADDRESS_HEX_01XX", + "1": "$CAN_ADDRESS_HEX_02XX", + "2": "$CAN_ADDRESS_HEX_03XX", + "3": "$CAN_ADDRESS_HEX_04XX", + "4": "$CAN_ADDRESS_HEX_05XX", + "5": "$CAN_ADDRESS_HEX_06XX", + "6": "$CAN_ADDRESS_HEX_07XX", + "7": "$CAN_ADDRESS_HEX_inv255" } }, { @@ -8577,7 +8797,14 @@ "high": 10 }, "options": { - "0": "$CAN_ADDRESS_HEX" + "0": "$CAN_ADDRESS_HEX_01XX", + "1": "$CAN_ADDRESS_HEX_02XX", + "2": "$CAN_ADDRESS_HEX_03XX", + "3": "$CAN_ADDRESS_HEX_04XX", + "4": "$CAN_ADDRESS_HEX_05XX", + "5": "$CAN_ADDRESS_HEX_06XX", + "6": "$CAN_ADDRESS_HEX_07XX", + "7": "$CAN_ADDRESS_HEX_inv255" } }, { @@ -8590,7 +8817,14 @@ "high": 10 }, "options": { - "0": "$CAN_ADDRESS_HEX" + "0": "$CAN_ADDRESS_HEX_01XX", + "1": "$CAN_ADDRESS_HEX_02XX", + "2": "$CAN_ADDRESS_HEX_03XX", + "3": "$CAN_ADDRESS_HEX_04XX", + "4": "$CAN_ADDRESS_HEX_05XX", + "5": "$CAN_ADDRESS_HEX_06XX", + "6": "$CAN_ADDRESS_HEX_07XX", + "7": "$CAN_ADDRESS_HEX_inv255" } }, { @@ -8603,7 +8837,25 @@ "high": 5 }, "options": { - "0": "$ANALOG_PIN" + "0": "A0", + "1": "A1", + "2": "A2", + "3": "A3", + "4": "A4", + "5": "A5", + "6": "A6", + "7": "A7", + "8": "A8", + "9": "A9", + "10": "A10", + "11": "A11", + "12": "A12", + "13": "A13", + "14": "A14", + "15": "A15", + "16": "$PIN_16inv", + "17": "$PIN_16inv", + "18": "$PIN_16inv" } }, { @@ -8616,7 +8868,25 @@ "high": 5 }, "options": { - "0": "$ANALOG_PIN" + "0": "A0", + "1": "A1", + "2": "A2", + "3": "A3", + "4": "A4", + "5": "A5", + "6": "A6", + "7": "A7", + "8": "A8", + "9": "A9", + "10": "A10", + "11": "A11", + "12": "A12", + "13": "A13", + "14": "A14", + "15": "A15", + "16": "$PIN_16inv", + "17": "$PIN_16inv", + "18": "$PIN_16inv" } }, { @@ -8629,7 +8899,25 @@ "high": 5 }, "options": { - "0": "$ANALOG_PIN" + "0": "A0", + "1": "A1", + "2": "A2", + "3": "A3", + "4": "A4", + "5": "A5", + "6": "A6", + "7": "A7", + "8": "A8", + "9": "A9", + "10": "A10", + "11": "A11", + "12": "A12", + "13": "A13", + "14": "A14", + "15": "A15", + "16": "$PIN_16inv", + "17": "$PIN_16inv", + "18": "$PIN_16inv" } }, { @@ -8642,7 +8930,25 @@ "high": 5 }, "options": { - "0": "$ANALOG_PIN" + "0": "A0", + "1": "A1", + "2": "A2", + "3": "A3", + "4": "A4", + "5": "A5", + "6": "A6", + "7": "A7", + "8": "A8", + "9": "A9", + "10": "A10", + "11": "A11", + "12": "A12", + "13": "A13", + "14": "A14", + "15": "A15", + "16": "$PIN_16inv", + "17": "$PIN_16inv", + "18": "$PIN_16inv" } }, { @@ -8655,7 +8961,25 @@ "high": 5 }, "options": { - "0": "$ANALOG_PIN" + "0": "A0", + "1": "A1", + "2": "A2", + "3": "A3", + "4": "A4", + "5": "A5", + "6": "A6", + "7": "A7", + "8": "A8", + "9": "A9", + "10": "A10", + "11": "A11", + "12": "A12", + "13": "A13", + "14": "A14", + "15": "A15", + "16": "$PIN_16inv", + "17": "$PIN_16inv", + "18": "$PIN_16inv" } }, { @@ -8668,7 +8992,25 @@ "high": 5 }, "options": { - "0": "$ANALOG_PIN" + "0": "A0", + "1": "A1", + "2": "A2", + "3": "A3", + "4": "A4", + "5": "A5", + "6": "A6", + "7": "A7", + "8": "A8", + "9": "A9", + "10": "A10", + "11": "A11", + "12": "A12", + "13": "A13", + "14": "A14", + "15": "A15", + "16": "$PIN_16inv", + "17": "$PIN_16inv", + "18": "$PIN_16inv" } }, { @@ -8681,7 +9023,25 @@ "high": 5 }, "options": { - "0": "$ANALOG_PIN" + "0": "A0", + "1": "A1", + "2": "A2", + "3": "A3", + "4": "A4", + "5": "A5", + "6": "A6", + "7": "A7", + "8": "A8", + "9": "A9", + "10": "A10", + "11": "A11", + "12": "A12", + "13": "A13", + "14": "A14", + "15": "A15", + "16": "$PIN_16inv", + "17": "$PIN_16inv", + "18": "$PIN_16inv" } }, { @@ -8694,7 +9054,25 @@ "high": 5 }, "options": { - "0": "$ANALOG_PIN" + "0": "A0", + "1": "A1", + "2": "A2", + "3": "A3", + "4": "A4", + "5": "A5", + "6": "A6", + "7": "A7", + "8": "A8", + "9": "A9", + "10": "A10", + "11": "A11", + "12": "A12", + "13": "A13", + "14": "A14", + "15": "A15", + "16": "$PIN_16inv", + "17": "$PIN_16inv", + "18": "$PIN_16inv" } }, { @@ -8707,7 +9085,25 @@ "high": 5 }, "options": { - "0": "$ANALOG_PIN" + "0": "A0", + "1": "A1", + "2": "A2", + "3": "A3", + "4": "A4", + "5": "A5", + "6": "A6", + "7": "A7", + "8": "A8", + "9": "A9", + "10": "A10", + "11": "A11", + "12": "A12", + "13": "A13", + "14": "A14", + "15": "A15", + "16": "$PIN_16inv", + "17": "$PIN_16inv", + "18": "$PIN_16inv" } }, { @@ -8720,7 +9116,25 @@ "high": 5 }, "options": { - "0": "$ANALOG_PIN" + "0": "A0", + "1": "A1", + "2": "A2", + "3": "A3", + "4": "A4", + "5": "A5", + "6": "A6", + "7": "A7", + "8": "A8", + "9": "A9", + "10": "A10", + "11": "A11", + "12": "A12", + "13": "A13", + "14": "A14", + "15": "A15", + "16": "$PIN_16inv", + "17": "$PIN_16inv", + "18": "$PIN_16inv" } }, { @@ -8733,7 +9147,25 @@ "high": 5 }, "options": { - "0": "$ANALOG_PIN" + "0": "A0", + "1": "A1", + "2": "A2", + "3": "A3", + "4": "A4", + "5": "A5", + "6": "A6", + "7": "A7", + "8": "A8", + "9": "A9", + "10": "A10", + "11": "A11", + "12": "A12", + "13": "A13", + "14": "A14", + "15": "A15", + "16": "$PIN_16inv", + "17": "$PIN_16inv", + "18": "$PIN_16inv" } }, { @@ -8746,7 +9178,25 @@ "high": 5 }, "options": { - "0": "$ANALOG_PIN" + "0": "A0", + "1": "A1", + "2": "A2", + "3": "A3", + "4": "A4", + "5": "A5", + "6": "A6", + "7": "A7", + "8": "A8", + "9": "A9", + "10": "A10", + "11": "A11", + "12": "A12", + "13": "A13", + "14": "A14", + "15": "A15", + "16": "$PIN_16inv", + "17": "$PIN_16inv", + "18": "$PIN_16inv" } }, { @@ -8759,7 +9209,25 @@ "high": 5 }, "options": { - "0": "$ANALOG_PIN" + "0": "A0", + "1": "A1", + "2": "A2", + "3": "A3", + "4": "A4", + "5": "A5", + "6": "A6", + "7": "A7", + "8": "A8", + "9": "A9", + "10": "A10", + "11": "A11", + "12": "A12", + "13": "A13", + "14": "A14", + "15": "A15", + "16": "$PIN_16inv", + "17": "$PIN_16inv", + "18": "$PIN_16inv" } }, { @@ -8772,7 +9240,25 @@ "high": 5 }, "options": { - "0": "$ANALOG_PIN" + "0": "A0", + "1": "A1", + "2": "A2", + "3": "A3", + "4": "A4", + "5": "A5", + "6": "A6", + "7": "A7", + "8": "A8", + "9": "A9", + "10": "A10", + "11": "A11", + "12": "A12", + "13": "A13", + "14": "A14", + "15": "A15", + "16": "$PIN_16inv", + "17": "$PIN_16inv", + "18": "$PIN_16inv" } }, { @@ -8785,7 +9271,25 @@ "high": 5 }, "options": { - "0": "$ANALOG_PIN" + "0": "A0", + "1": "A1", + "2": "A2", + "3": "A3", + "4": "A4", + "5": "A5", + "6": "A6", + "7": "A7", + "8": "A8", + "9": "A9", + "10": "A10", + "11": "A11", + "12": "A12", + "13": "A13", + "14": "A14", + "15": "A15", + "16": "$PIN_16inv", + "17": "$PIN_16inv", + "18": "$PIN_16inv" } }, { @@ -8798,7 +9302,25 @@ "high": 5 }, "options": { - "0": "$ANALOG_PIN" + "0": "A0", + "1": "A1", + "2": "A2", + "3": "A3", + "4": "A4", + "5": "A5", + "6": "A6", + "7": "A7", + "8": "A8", + "9": "A9", + "10": "A10", + "11": "A11", + "12": "A12", + "13": "A13", + "14": "A14", + "15": "A15", + "16": "$PIN_16inv", + "17": "$PIN_16inv", + "18": "$PIN_16inv" } }, { @@ -8811,7 +9333,70 @@ "high": 5 }, "options": { - "0": "$DIGITAL_PIN" + "0": "1", + "1": "2", + "2": "3", + "3": "4", + "4": "5", + "5": "6", + "6": "7", + "7": "8", + "8": "9", + "9": "10", + "10": "11", + "11": "12", + "12": "13", + "13": "14", + "14": "15", + "15": "16", + "16": "17", + "17": "18", + "18": "19", + "19": "20", + "20": "21", + "21": "22", + "22": "23", + "23": "24", + "24": "25", + "25": "26", + "26": "27", + "27": "28", + "28": "29", + "29": "30", + "30": "31", + "31": "32", + "32": "33", + "33": "34", + "34": "35", + "35": "36", + "36": "37", + "37": "38", + "38": "39", + "39": "40", + "40": "41", + "41": "42", + "42": "43", + "43": "44", + "44": "45", + "45": "46", + "46": "47", + "47": "48", + "48": "49", + "49": "50", + "50": "51", + "51": "52", + "52": "53", + "53": "INVALID", + "54": "INVALID", + "55": "INVALID", + "56": "INVALID", + "57": "INVALID", + "58": "INVALID", + "59": "INVALID", + "60": "INVALID", + "61": "INVALID", + "62": "INVALID", + "63": "INVALID" } }, { @@ -8824,7 +9409,70 @@ "high": 5 }, "options": { - "0": "$DIGITAL_PIN" + "0": "1", + "1": "2", + "2": "3", + "3": "4", + "4": "5", + "5": "6", + "6": "7", + "7": "8", + "8": "9", + "9": "10", + "10": "11", + "11": "12", + "12": "13", + "13": "14", + "14": "15", + "15": "16", + "16": "17", + "17": "18", + "18": "19", + "19": "20", + "20": "21", + "21": "22", + "22": "23", + "23": "24", + "24": "25", + "25": "26", + "26": "27", + "27": "28", + "28": "29", + "29": "30", + "30": "31", + "31": "32", + "32": "33", + "33": "34", + "34": "35", + "35": "36", + "36": "37", + "37": "38", + "38": "39", + "39": "40", + "40": "41", + "41": "42", + "42": "43", + "43": "44", + "44": "45", + "45": "46", + "46": "47", + "47": "48", + "48": "49", + "49": "50", + "50": "51", + "51": "52", + "52": "53", + "53": "INVALID", + "54": "INVALID", + "55": "INVALID", + "56": "INVALID", + "57": "INVALID", + "58": "INVALID", + "59": "INVALID", + "60": "INVALID", + "61": "INVALID", + "62": "INVALID", + "63": "INVALID" } }, { @@ -8837,7 +9485,70 @@ "high": 5 }, "options": { - "0": "$DIGITAL_PIN" + "0": "1", + "1": "2", + "2": "3", + "3": "4", + "4": "5", + "5": "6", + "6": "7", + "7": "8", + "8": "9", + "9": "10", + "10": "11", + "11": "12", + "12": "13", + "13": "14", + "14": "15", + "15": "16", + "16": "17", + "17": "18", + "18": "19", + "19": "20", + "20": "21", + "21": "22", + "22": "23", + "23": "24", + "24": "25", + "25": "26", + "26": "27", + "27": "28", + "28": "29", + "29": "30", + "30": "31", + "31": "32", + "32": "33", + "33": "34", + "34": "35", + "35": "36", + "36": "37", + "37": "38", + "38": "39", + "39": "40", + "40": "41", + "41": "42", + "42": "43", + "43": "44", + "44": "45", + "45": "46", + "46": "47", + "47": "48", + "48": "49", + "49": "50", + "50": "51", + "51": "52", + "52": "53", + "53": "INVALID", + "54": "INVALID", + "55": "INVALID", + "56": "INVALID", + "57": "INVALID", + "58": "INVALID", + "59": "INVALID", + "60": "INVALID", + "61": "INVALID", + "62": "INVALID", + "63": "INVALID" } }, { @@ -8850,7 +9561,70 @@ "high": 5 }, "options": { - "0": "$DIGITAL_PIN" + "0": "1", + "1": "2", + "2": "3", + "3": "4", + "4": "5", + "5": "6", + "6": "7", + "7": "8", + "8": "9", + "9": "10", + "10": "11", + "11": "12", + "12": "13", + "13": "14", + "14": "15", + "15": "16", + "16": "17", + "17": "18", + "18": "19", + "19": "20", + "20": "21", + "21": "22", + "22": "23", + "23": "24", + "24": "25", + "25": "26", + "26": "27", + "27": "28", + "28": "29", + "29": "30", + "30": "31", + "31": "32", + "32": "33", + "33": "34", + "34": "35", + "35": "36", + "36": "37", + "37": "38", + "38": "39", + "39": "40", + "40": "41", + "41": "42", + "42": "43", + "43": "44", + "44": "45", + "45": "46", + "46": "47", + "47": "48", + "48": "49", + "49": "50", + "50": "51", + "51": "52", + "52": "53", + "53": "INVALID", + "54": "INVALID", + "55": "INVALID", + "56": "INVALID", + "57": "INVALID", + "58": "INVALID", + "59": "INVALID", + "60": "INVALID", + "61": "INVALID", + "62": "INVALID", + "63": "INVALID" } }, { @@ -8863,7 +9637,70 @@ "high": 5 }, "options": { - "0": "$DIGITAL_PIN" + "0": "1", + "1": "2", + "2": "3", + "3": "4", + "4": "5", + "5": "6", + "6": "7", + "7": "8", + "8": "9", + "9": "10", + "10": "11", + "11": "12", + "12": "13", + "13": "14", + "14": "15", + "15": "16", + "16": "17", + "17": "18", + "18": "19", + "19": "20", + "20": "21", + "21": "22", + "22": "23", + "23": "24", + "24": "25", + "25": "26", + "26": "27", + "27": "28", + "28": "29", + "29": "30", + "30": "31", + "31": "32", + "32": "33", + "33": "34", + "34": "35", + "35": "36", + "36": "37", + "37": "38", + "38": "39", + "39": "40", + "40": "41", + "41": "42", + "42": "43", + "43": "44", + "44": "45", + "45": "46", + "46": "47", + "47": "48", + "48": "49", + "49": "50", + "50": "51", + "51": "52", + "52": "53", + "53": "INVALID", + "54": "INVALID", + "55": "INVALID", + "56": "INVALID", + "57": "INVALID", + "58": "INVALID", + "59": "INVALID", + "60": "INVALID", + "61": "INVALID", + "62": "INVALID", + "63": "INVALID" } }, { @@ -8876,7 +9713,70 @@ "high": 5 }, "options": { - "0": "$DIGITAL_PIN" + "0": "1", + "1": "2", + "2": "3", + "3": "4", + "4": "5", + "5": "6", + "6": "7", + "7": "8", + "8": "9", + "9": "10", + "10": "11", + "11": "12", + "12": "13", + "13": "14", + "14": "15", + "15": "16", + "16": "17", + "17": "18", + "18": "19", + "19": "20", + "20": "21", + "21": "22", + "22": "23", + "23": "24", + "24": "25", + "25": "26", + "26": "27", + "27": "28", + "28": "29", + "29": "30", + "30": "31", + "31": "32", + "32": "33", + "33": "34", + "34": "35", + "35": "36", + "36": "37", + "37": "38", + "38": "39", + "39": "40", + "40": "41", + "41": "42", + "42": "43", + "43": "44", + "44": "45", + "45": "46", + "46": "47", + "47": "48", + "48": "49", + "49": "50", + "50": "51", + "51": "52", + "52": "53", + "53": "INVALID", + "54": "INVALID", + "55": "INVALID", + "56": "INVALID", + "57": "INVALID", + "58": "INVALID", + "59": "INVALID", + "60": "INVALID", + "61": "INVALID", + "62": "INVALID", + "63": "INVALID" } }, { @@ -8889,7 +9789,70 @@ "high": 5 }, "options": { - "0": "$DIGITAL_PIN" + "0": "1", + "1": "2", + "2": "3", + "3": "4", + "4": "5", + "5": "6", + "6": "7", + "7": "8", + "8": "9", + "9": "10", + "10": "11", + "11": "12", + "12": "13", + "13": "14", + "14": "15", + "15": "16", + "16": "17", + "17": "18", + "18": "19", + "19": "20", + "20": "21", + "21": "22", + "22": "23", + "23": "24", + "24": "25", + "25": "26", + "26": "27", + "27": "28", + "28": "29", + "29": "30", + "30": "31", + "31": "32", + "32": "33", + "33": "34", + "34": "35", + "35": "36", + "36": "37", + "37": "38", + "38": "39", + "39": "40", + "40": "41", + "41": "42", + "42": "43", + "43": "44", + "44": "45", + "45": "46", + "46": "47", + "47": "48", + "48": "49", + "49": "50", + "50": "51", + "51": "52", + "52": "53", + "53": "INVALID", + "54": "INVALID", + "55": "INVALID", + "56": "INVALID", + "57": "INVALID", + "58": "INVALID", + "59": "INVALID", + "60": "INVALID", + "61": "INVALID", + "62": "INVALID", + "63": "INVALID" } }, { @@ -8902,7 +9865,70 @@ "high": 5 }, "options": { - "0": "$DIGITAL_PIN" + "0": "1", + "1": "2", + "2": "3", + "3": "4", + "4": "5", + "5": "6", + "6": "7", + "7": "8", + "8": "9", + "9": "10", + "10": "11", + "11": "12", + "12": "13", + "13": "14", + "14": "15", + "15": "16", + "16": "17", + "17": "18", + "18": "19", + "19": "20", + "20": "21", + "21": "22", + "22": "23", + "23": "24", + "24": "25", + "25": "26", + "26": "27", + "27": "28", + "28": "29", + "29": "30", + "30": "31", + "31": "32", + "32": "33", + "33": "34", + "34": "35", + "35": "36", + "36": "37", + "37": "38", + "38": "39", + "39": "40", + "40": "41", + "41": "42", + "42": "43", + "43": "44", + "44": "45", + "45": "46", + "46": "47", + "47": "48", + "48": "49", + "49": "50", + "50": "51", + "51": "52", + "52": "53", + "53": "INVALID", + "54": "INVALID", + "55": "INVALID", + "56": "INVALID", + "57": "INVALID", + "58": "INVALID", + "59": "INVALID", + "60": "INVALID", + "61": "INVALID", + "62": "INVALID", + "63": "INVALID" } }, { @@ -8915,7 +9941,70 @@ "high": 5 }, "options": { - "0": "$DIGITAL_PIN" + "0": "1", + "1": "2", + "2": "3", + "3": "4", + "4": "5", + "5": "6", + "6": "7", + "7": "8", + "8": "9", + "9": "10", + "10": "11", + "11": "12", + "12": "13", + "13": "14", + "14": "15", + "15": "16", + "16": "17", + "17": "18", + "18": "19", + "19": "20", + "20": "21", + "21": "22", + "22": "23", + "23": "24", + "24": "25", + "25": "26", + "26": "27", + "27": "28", + "28": "29", + "29": "30", + "30": "31", + "31": "32", + "32": "33", + "33": "34", + "34": "35", + "35": "36", + "36": "37", + "37": "38", + "38": "39", + "39": "40", + "40": "41", + "41": "42", + "42": "43", + "43": "44", + "44": "45", + "45": "46", + "46": "47", + "47": "48", + "48": "49", + "49": "50", + "50": "51", + "51": "52", + "52": "53", + "53": "INVALID", + "54": "INVALID", + "55": "INVALID", + "56": "INVALID", + "57": "INVALID", + "58": "INVALID", + "59": "INVALID", + "60": "INVALID", + "61": "INVALID", + "62": "INVALID", + "63": "INVALID" } }, { @@ -8928,7 +10017,70 @@ "high": 5 }, "options": { - "0": "$DIGITAL_PIN" + "0": "1", + "1": "2", + "2": "3", + "3": "4", + "4": "5", + "5": "6", + "6": "7", + "7": "8", + "8": "9", + "9": "10", + "10": "11", + "11": "12", + "12": "13", + "13": "14", + "14": "15", + "15": "16", + "16": "17", + "17": "18", + "18": "19", + "19": "20", + "20": "21", + "21": "22", + "22": "23", + "23": "24", + "24": "25", + "25": "26", + "26": "27", + "27": "28", + "28": "29", + "29": "30", + "30": "31", + "31": "32", + "32": "33", + "33": "34", + "34": "35", + "35": "36", + "36": "37", + "37": "38", + "38": "39", + "39": "40", + "40": "41", + "41": "42", + "42": "43", + "43": "44", + "44": "45", + "45": "46", + "46": "47", + "47": "48", + "48": "49", + "49": "50", + "50": "51", + "51": "52", + "52": "53", + "53": "INVALID", + "54": "INVALID", + "55": "INVALID", + "56": "INVALID", + "57": "INVALID", + "58": "INVALID", + "59": "INVALID", + "60": "INVALID", + "61": "INVALID", + "62": "INVALID", + "63": "INVALID" } }, { @@ -8941,7 +10093,70 @@ "high": 5 }, "options": { - "0": "$DIGITAL_PIN" + "0": "1", + "1": "2", + "2": "3", + "3": "4", + "4": "5", + "5": "6", + "6": "7", + "7": "8", + "8": "9", + "9": "10", + "10": "11", + "11": "12", + "12": "13", + "13": "14", + "14": "15", + "15": "16", + "16": "17", + "17": "18", + "18": "19", + "19": "20", + "20": "21", + "21": "22", + "22": "23", + "23": "24", + "24": "25", + "25": "26", + "26": "27", + "27": "28", + "28": "29", + "29": "30", + "30": "31", + "31": "32", + "32": "33", + "33": "34", + "34": "35", + "35": "36", + "36": "37", + "37": "38", + "38": "39", + "39": "40", + "40": "41", + "41": "42", + "42": "43", + "43": "44", + "44": "45", + "45": "46", + "46": "47", + "47": "48", + "48": "49", + "49": "50", + "50": "51", + "51": "52", + "52": "53", + "53": "INVALID", + "54": "INVALID", + "55": "INVALID", + "56": "INVALID", + "57": "INVALID", + "58": "INVALID", + "59": "INVALID", + "60": "INVALID", + "61": "INVALID", + "62": "INVALID", + "63": "INVALID" } }, { @@ -8954,7 +10169,70 @@ "high": 5 }, "options": { - "0": "$DIGITAL_PIN" + "0": "1", + "1": "2", + "2": "3", + "3": "4", + "4": "5", + "5": "6", + "6": "7", + "7": "8", + "8": "9", + "9": "10", + "10": "11", + "11": "12", + "12": "13", + "13": "14", + "14": "15", + "15": "16", + "16": "17", + "17": "18", + "18": "19", + "19": "20", + "20": "21", + "21": "22", + "22": "23", + "23": "24", + "24": "25", + "25": "26", + "26": "27", + "27": "28", + "28": "29", + "29": "30", + "30": "31", + "31": "32", + "32": "33", + "33": "34", + "34": "35", + "35": "36", + "36": "37", + "37": "38", + "38": "39", + "39": "40", + "40": "41", + "41": "42", + "42": "43", + "43": "44", + "44": "45", + "45": "46", + "46": "47", + "47": "48", + "48": "49", + "49": "50", + "50": "51", + "51": "52", + "52": "53", + "53": "INVALID", + "54": "INVALID", + "55": "INVALID", + "56": "INVALID", + "57": "INVALID", + "58": "INVALID", + "59": "INVALID", + "60": "INVALID", + "61": "INVALID", + "62": "INVALID", + "63": "INVALID" } }, { @@ -8967,7 +10245,70 @@ "high": 5 }, "options": { - "0": "$DIGITAL_PIN" + "0": "1", + "1": "2", + "2": "3", + "3": "4", + "4": "5", + "5": "6", + "6": "7", + "7": "8", + "8": "9", + "9": "10", + "10": "11", + "11": "12", + "12": "13", + "13": "14", + "14": "15", + "15": "16", + "16": "17", + "17": "18", + "18": "19", + "19": "20", + "20": "21", + "21": "22", + "22": "23", + "23": "24", + "24": "25", + "25": "26", + "26": "27", + "27": "28", + "28": "29", + "29": "30", + "30": "31", + "31": "32", + "32": "33", + "33": "34", + "34": "35", + "35": "36", + "36": "37", + "37": "38", + "38": "39", + "39": "40", + "40": "41", + "41": "42", + "42": "43", + "43": "44", + "44": "45", + "45": "46", + "46": "47", + "47": "48", + "48": "49", + "49": "50", + "50": "51", + "51": "52", + "52": "53", + "53": "INVALID", + "54": "INVALID", + "55": "INVALID", + "56": "INVALID", + "57": "INVALID", + "58": "INVALID", + "59": "INVALID", + "60": "INVALID", + "61": "INVALID", + "62": "INVALID", + "63": "INVALID" } }, { @@ -8980,7 +10321,70 @@ "high": 5 }, "options": { - "0": "$DIGITAL_PIN" + "0": "1", + "1": "2", + "2": "3", + "3": "4", + "4": "5", + "5": "6", + "6": "7", + "7": "8", + "8": "9", + "9": "10", + "10": "11", + "11": "12", + "12": "13", + "13": "14", + "14": "15", + "15": "16", + "16": "17", + "17": "18", + "18": "19", + "19": "20", + "20": "21", + "21": "22", + "22": "23", + "23": "24", + "24": "25", + "25": "26", + "26": "27", + "27": "28", + "28": "29", + "29": "30", + "30": "31", + "31": "32", + "32": "33", + "33": "34", + "34": "35", + "35": "36", + "36": "37", + "37": "38", + "38": "39", + "39": "40", + "40": "41", + "41": "42", + "42": "43", + "43": "44", + "44": "45", + "45": "46", + "46": "47", + "47": "48", + "48": "49", + "49": "50", + "50": "51", + "51": "52", + "52": "53", + "53": "INVALID", + "54": "INVALID", + "55": "INVALID", + "56": "INVALID", + "57": "INVALID", + "58": "INVALID", + "59": "INVALID", + "60": "INVALID", + "61": "INVALID", + "62": "INVALID", + "63": "INVALID" } }, { @@ -8993,7 +10397,70 @@ "high": 5 }, "options": { - "0": "$DIGITAL_PIN" + "0": "1", + "1": "2", + "2": "3", + "3": "4", + "4": "5", + "5": "6", + "6": "7", + "7": "8", + "8": "9", + "9": "10", + "10": "11", + "11": "12", + "12": "13", + "13": "14", + "14": "15", + "15": "16", + "16": "17", + "17": "18", + "18": "19", + "19": "20", + "20": "21", + "21": "22", + "22": "23", + "23": "24", + "24": "25", + "25": "26", + "26": "27", + "27": "28", + "28": "29", + "29": "30", + "30": "31", + "31": "32", + "32": "33", + "33": "34", + "34": "35", + "35": "36", + "36": "37", + "37": "38", + "38": "39", + "39": "40", + "40": "41", + "41": "42", + "42": "43", + "43": "44", + "44": "45", + "45": "46", + "46": "47", + "47": "48", + "48": "49", + "49": "50", + "50": "51", + "51": "52", + "52": "53", + "53": "INVALID", + "54": "INVALID", + "55": "INVALID", + "56": "INVALID", + "57": "INVALID", + "58": "INVALID", + "59": "INVALID", + "60": "INVALID", + "61": "INVALID", + "62": "INVALID", + "63": "INVALID" } }, { @@ -9006,7 +10473,70 @@ "high": 5 }, "options": { - "0": "$DIGITAL_PIN" + "0": "1", + "1": "2", + "2": "3", + "3": "4", + "4": "5", + "5": "6", + "6": "7", + "7": "8", + "8": "9", + "9": "10", + "10": "11", + "11": "12", + "12": "13", + "13": "14", + "14": "15", + "15": "16", + "16": "17", + "17": "18", + "18": "19", + "19": "20", + "20": "21", + "21": "22", + "22": "23", + "23": "24", + "24": "25", + "25": "26", + "26": "27", + "27": "28", + "28": "29", + "29": "30", + "30": "31", + "31": "32", + "32": "33", + "33": "34", + "34": "35", + "35": "36", + "36": "37", + "37": "38", + "38": "39", + "39": "40", + "40": "41", + "41": "42", + "42": "43", + "43": "44", + "44": "45", + "45": "46", + "46": "47", + "47": "48", + "48": "49", + "49": "50", + "50": "51", + "51": "52", + "52": "53", + "53": "INVALID", + "54": "INVALID", + "55": "INVALID", + "56": "INVALID", + "57": "INVALID", + "58": "INVALID", + "59": "INVALID", + "60": "INVALID", + "61": "INVALID", + "62": "INVALID", + "63": "INVALID" } }, { @@ -9674,7 +11204,70 @@ "high": 7 }, "options": { - "0": "$IO_Pins_no_def" + "0": "INVALID", + "1": "INVALID", + "2": "INVALID", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7", + "8": "8", + "9": "9", + "10": "10", + "11": "11", + "12": "12", + "13": "13", + "14": "14", + "15": "15", + "16": "16", + "17": "17", + "18": "18", + "19": "19", + "20": "20", + "21": "21", + "22": "22", + "23": "23", + "24": "24", + "25": "25", + "26": "26", + "27": "27", + "28": "28", + "29": "29", + "30": "30", + "31": "31", + "32": "32", + "33": "33", + "34": "34", + "35": "35", + "36": "36", + "37": "37", + "38": "38", + "39": "39", + "40": "40", + "41": "41", + "42": "42", + "43": "43", + "44": "44", + "45": "45", + "46": "46", + "47": "47", + "48": "48", + "49": "49", + "50": "50", + "51": "51", + "52": "52", + "53": "53", + "54": "INVALID", + "55": "A8", + "56": "A9", + "57": "A10", + "58": "A11", + "59": "A12", + "60": "A13", + "61": "A14", + "62": "A15", + "63": "INVALID" } }, { @@ -9735,7 +11328,70 @@ "high": 5 }, "options": { - "0": "$IO_Pins_no_def" + "0": "INVALID", + "1": "INVALID", + "2": "INVALID", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7", + "8": "8", + "9": "9", + "10": "10", + "11": "11", + "12": "12", + "13": "13", + "14": "14", + "15": "15", + "16": "16", + "17": "17", + "18": "18", + "19": "19", + "20": "20", + "21": "21", + "22": "22", + "23": "23", + "24": "24", + "25": "25", + "26": "26", + "27": "27", + "28": "28", + "29": "29", + "30": "30", + "31": "31", + "32": "32", + "33": "33", + "34": "34", + "35": "35", + "36": "36", + "37": "37", + "38": "38", + "39": "39", + "40": "40", + "41": "41", + "42": "42", + "43": "43", + "44": "44", + "45": "45", + "46": "46", + "47": "47", + "48": "48", + "49": "49", + "50": "50", + "51": "51", + "52": "52", + "53": "53", + "54": "INVALID", + "55": "A8", + "56": "A9", + "57": "A10", + "58": "A11", + "59": "A12", + "60": "A13", + "61": "A14", + "62": "A15", + "63": "INVALID" } }, { @@ -9836,7 +11492,70 @@ "high": 5 }, "options": { - "0": "$IO_Pins_no_def" + "0": "INVALID", + "1": "INVALID", + "2": "INVALID", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7", + "8": "8", + "9": "9", + "10": "10", + "11": "11", + "12": "12", + "13": "13", + "14": "14", + "15": "15", + "16": "16", + "17": "17", + "18": "18", + "19": "19", + "20": "20", + "21": "21", + "22": "22", + "23": "23", + "24": "24", + "25": "25", + "26": "26", + "27": "27", + "28": "28", + "29": "29", + "30": "30", + "31": "31", + "32": "32", + "33": "33", + "34": "34", + "35": "35", + "36": "36", + "37": "37", + "38": "38", + "39": "39", + "40": "40", + "41": "41", + "42": "42", + "43": "43", + "44": "44", + "45": "45", + "46": "46", + "47": "47", + "48": "48", + "49": "49", + "50": "50", + "51": "51", + "52": "52", + "53": "53", + "54": "INVALID", + "55": "A8", + "56": "A9", + "57": "A10", + "58": "A11", + "59": "A12", + "60": "A13", + "61": "A14", + "62": "A15", + "63": "INVALID" } }, { @@ -10263,7 +11982,14 @@ "high": 2 }, "options": { - "0": "$loadSourceNames" + "0": "MAP", + "1": "TPS", + "2": "IMAP/EMAP", + "3": "INVALID", + "4": "INVALID", + "5": "INVALID", + "6": "INVALID", + "7": "INVALID" } }, { @@ -10324,7 +12050,70 @@ "high": 5 }, "options": { - "0": "$IO_Pins_no_def" + "0": "INVALID", + "1": "INVALID", + "2": "INVALID", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7", + "8": "8", + "9": "9", + "10": "10", + "11": "11", + "12": "12", + "13": "13", + "14": "14", + "15": "15", + "16": "16", + "17": "17", + "18": "18", + "19": "19", + "20": "20", + "21": "21", + "22": "22", + "23": "23", + "24": "24", + "25": "25", + "26": "26", + "27": "27", + "28": "28", + "29": "29", + "30": "30", + "31": "31", + "32": "32", + "33": "33", + "34": "34", + "35": "35", + "36": "36", + "37": "37", + "38": "38", + "39": "39", + "40": "40", + "41": "41", + "42": "42", + "43": "43", + "44": "44", + "45": "45", + "46": "46", + "47": "47", + "48": "48", + "49": "49", + "50": "50", + "51": "51", + "52": "52", + "53": "53", + "54": "INVALID", + "55": "A8", + "56": "A9", + "57": "A10", + "58": "A11", + "59": "A12", + "60": "A13", + "61": "A14", + "62": "A15", + "63": "INVALID" } }, { @@ -11077,7 +12866,14 @@ "high": 2 }, "options": { - "0": "$loadSourceNames" + "0": "MAP", + "1": "TPS", + "2": "IMAP/EMAP", + "3": "INVALID", + "4": "INVALID", + "5": "INVALID", + "6": "INVALID", + "7": "INVALID" } }, { @@ -11138,7 +12934,70 @@ "high": 5 }, "options": { - "0": "$IO_Pins_no_def" + "0": "INVALID", + "1": "INVALID", + "2": "INVALID", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7", + "8": "8", + "9": "9", + "10": "10", + "11": "11", + "12": "12", + "13": "13", + "14": "14", + "15": "15", + "16": "16", + "17": "17", + "18": "18", + "19": "19", + "20": "20", + "21": "21", + "22": "22", + "23": "23", + "24": "24", + "25": "25", + "26": "26", + "27": "27", + "28": "28", + "29": "29", + "30": "30", + "31": "31", + "32": "32", + "33": "33", + "34": "34", + "35": "35", + "36": "36", + "37": "37", + "38": "38", + "39": "39", + "40": "40", + "41": "41", + "42": "42", + "43": "43", + "44": "44", + "45": "45", + "46": "46", + "47": "47", + "48": "48", + "49": "49", + "50": "50", + "51": "51", + "52": "52", + "53": "53", + "54": "INVALID", + "55": "A8", + "56": "A9", + "57": "A10", + "58": "A11", + "59": "A12", + "60": "A13", + "61": "A14", + "62": "A15", + "63": "INVALID" } }, { @@ -11642,7 +13501,10 @@ "high": 7 }, "options": { - "0": "$comp_IO_Pins" + "0": "$comp_IO_Pins_0", + "1": "$comp_IO_Pins_1", + "2": "$comp_IO_Pins_2", + "3": "$comp_IO_Pins_3" } }, { @@ -11655,7 +13517,10 @@ "high": 7 }, "options": { - "0": "$comp_IO_Pins" + "0": "$comp_IO_Pins_0", + "1": "$comp_IO_Pins_1", + "2": "$comp_IO_Pins_2", + "3": "$comp_IO_Pins_3" } }, { @@ -11668,7 +13533,10 @@ "high": 7 }, "options": { - "0": "$comp_IO_Pins" + "0": "$comp_IO_Pins_0", + "1": "$comp_IO_Pins_1", + "2": "$comp_IO_Pins_2", + "3": "$comp_IO_Pins_3" } }, { @@ -11681,7 +13549,10 @@ "high": 7 }, "options": { - "0": "$comp_IO_Pins" + "0": "$comp_IO_Pins_0", + "1": "$comp_IO_Pins_1", + "2": "$comp_IO_Pins_2", + "3": "$comp_IO_Pins_3" } }, { @@ -11694,7 +13565,10 @@ "high": 7 }, "options": { - "0": "$comp_IO_Pins" + "0": "$comp_IO_Pins_0", + "1": "$comp_IO_Pins_1", + "2": "$comp_IO_Pins_2", + "3": "$comp_IO_Pins_3" } }, { @@ -11707,7 +13581,10 @@ "high": 7 }, "options": { - "0": "$comp_IO_Pins" + "0": "$comp_IO_Pins_0", + "1": "$comp_IO_Pins_1", + "2": "$comp_IO_Pins_2", + "3": "$comp_IO_Pins_3" } }, { @@ -11720,7 +13597,10 @@ "high": 7 }, "options": { - "0": "$comp_IO_Pins" + "0": "$comp_IO_Pins_0", + "1": "$comp_IO_Pins_1", + "2": "$comp_IO_Pins_2", + "3": "$comp_IO_Pins_3" } }, { @@ -11733,7 +13613,10 @@ "high": 7 }, "options": { - "0": "$comp_IO_Pins" + "0": "$comp_IO_Pins_0", + "1": "$comp_IO_Pins_1", + "2": "$comp_IO_Pins_2", + "3": "$comp_IO_Pins_3" } }, { @@ -11778,7 +13661,14 @@ "high": 7 }, "options": { - "0": "$fullStatus_def" + "0": "$fullStatus_def_1", + "1": "$fullStatus_def_2", + "2": "$fullStatus_def_3", + "3": "$fullStatus_def_4", + "4": "$fullStatus_def_5", + "5": "$fullStatus_def_6", + "6": "$fullStatus_def_7", + "7": "$fullStatus_def_8" } }, { @@ -11791,7 +13681,14 @@ "high": 7 }, "options": { - "0": "$fullStatus_def" + "0": "$fullStatus_def_1", + "1": "$fullStatus_def_2", + "2": "$fullStatus_def_3", + "3": "$fullStatus_def_4", + "4": "$fullStatus_def_5", + "5": "$fullStatus_def_6", + "6": "$fullStatus_def_7", + "7": "$fullStatus_def_8" } }, { @@ -11804,7 +13701,14 @@ "high": 7 }, "options": { - "0": "$fullStatus_def" + "0": "$fullStatus_def_1", + "1": "$fullStatus_def_2", + "2": "$fullStatus_def_3", + "3": "$fullStatus_def_4", + "4": "$fullStatus_def_5", + "5": "$fullStatus_def_6", + "6": "$fullStatus_def_7", + "7": "$fullStatus_def_8" } }, { @@ -11817,7 +13721,14 @@ "high": 7 }, "options": { - "0": "$fullStatus_def" + "0": "$fullStatus_def_1", + "1": "$fullStatus_def_2", + "2": "$fullStatus_def_3", + "3": "$fullStatus_def_4", + "4": "$fullStatus_def_5", + "5": "$fullStatus_def_6", + "6": "$fullStatus_def_7", + "7": "$fullStatus_def_8" } }, { @@ -11830,7 +13741,14 @@ "high": 7 }, "options": { - "0": "$fullStatus_def" + "0": "$fullStatus_def_1", + "1": "$fullStatus_def_2", + "2": "$fullStatus_def_3", + "3": "$fullStatus_def_4", + "4": "$fullStatus_def_5", + "5": "$fullStatus_def_6", + "6": "$fullStatus_def_7", + "7": "$fullStatus_def_8" } }, { @@ -11843,7 +13761,14 @@ "high": 7 }, "options": { - "0": "$fullStatus_def" + "0": "$fullStatus_def_1", + "1": "$fullStatus_def_2", + "2": "$fullStatus_def_3", + "3": "$fullStatus_def_4", + "4": "$fullStatus_def_5", + "5": "$fullStatus_def_6", + "6": "$fullStatus_def_7", + "7": "$fullStatus_def_8" } }, { @@ -11856,7 +13781,14 @@ "high": 7 }, "options": { - "0": "$fullStatus_def" + "0": "$fullStatus_def_1", + "1": "$fullStatus_def_2", + "2": "$fullStatus_def_3", + "3": "$fullStatus_def_4", + "4": "$fullStatus_def_5", + "5": "$fullStatus_def_6", + "6": "$fullStatus_def_7", + "7": "$fullStatus_def_8" } }, { @@ -11869,7 +13801,14 @@ "high": 7 }, "options": { - "0": "$fullStatus_def" + "0": "$fullStatus_def_1", + "1": "$fullStatus_def_2", + "2": "$fullStatus_def_3", + "3": "$fullStatus_def_4", + "4": "$fullStatus_def_5", + "5": "$fullStatus_def_6", + "6": "$fullStatus_def_7", + "7": "$fullStatus_def_8" } }, { @@ -11898,7 +13837,14 @@ "high": 7 }, "options": { - "0": "$fullStatus_def" + "0": "$fullStatus_def_1", + "1": "$fullStatus_def_2", + "2": "$fullStatus_def_3", + "3": "$fullStatus_def_4", + "4": "$fullStatus_def_5", + "5": "$fullStatus_def_6", + "6": "$fullStatus_def_7", + "7": "$fullStatus_def_8" } }, { @@ -11911,7 +13857,14 @@ "high": 7 }, "options": { - "0": "$fullStatus_def" + "0": "$fullStatus_def_1", + "1": "$fullStatus_def_2", + "2": "$fullStatus_def_3", + "3": "$fullStatus_def_4", + "4": "$fullStatus_def_5", + "5": "$fullStatus_def_6", + "6": "$fullStatus_def_7", + "7": "$fullStatus_def_8" } }, { @@ -11924,7 +13877,14 @@ "high": 7 }, "options": { - "0": "$fullStatus_def" + "0": "$fullStatus_def_1", + "1": "$fullStatus_def_2", + "2": "$fullStatus_def_3", + "3": "$fullStatus_def_4", + "4": "$fullStatus_def_5", + "5": "$fullStatus_def_6", + "6": "$fullStatus_def_7", + "7": "$fullStatus_def_8" } }, { @@ -11937,7 +13897,14 @@ "high": 7 }, "options": { - "0": "$fullStatus_def" + "0": "$fullStatus_def_1", + "1": "$fullStatus_def_2", + "2": "$fullStatus_def_3", + "3": "$fullStatus_def_4", + "4": "$fullStatus_def_5", + "5": "$fullStatus_def_6", + "6": "$fullStatus_def_7", + "7": "$fullStatus_def_8" } }, { @@ -11950,7 +13917,14 @@ "high": 7 }, "options": { - "0": "$fullStatus_def" + "0": "$fullStatus_def_1", + "1": "$fullStatus_def_2", + "2": "$fullStatus_def_3", + "3": "$fullStatus_def_4", + "4": "$fullStatus_def_5", + "5": "$fullStatus_def_6", + "6": "$fullStatus_def_7", + "7": "$fullStatus_def_8" } }, { @@ -11963,7 +13937,14 @@ "high": 7 }, "options": { - "0": "$fullStatus_def" + "0": "$fullStatus_def_1", + "1": "$fullStatus_def_2", + "2": "$fullStatus_def_3", + "3": "$fullStatus_def_4", + "4": "$fullStatus_def_5", + "5": "$fullStatus_def_6", + "6": "$fullStatus_def_7", + "7": "$fullStatus_def_8" } }, { @@ -11976,7 +13957,14 @@ "high": 7 }, "options": { - "0": "$fullStatus_def" + "0": "$fullStatus_def_1", + "1": "$fullStatus_def_2", + "2": "$fullStatus_def_3", + "3": "$fullStatus_def_4", + "4": "$fullStatus_def_5", + "5": "$fullStatus_def_6", + "6": "$fullStatus_def_7", + "7": "$fullStatus_def_8" } }, { @@ -11989,7 +13977,14 @@ "high": 7 }, "options": { - "0": "$fullStatus_def" + "0": "$fullStatus_def_1", + "1": "$fullStatus_def_2", + "2": "$fullStatus_def_3", + "3": "$fullStatus_def_4", + "4": "$fullStatus_def_5", + "5": "$fullStatus_def_6", + "6": "$fullStatus_def_7", + "7": "$fullStatus_def_8" } }, { @@ -12066,7 +14061,7 @@ "high": 2 }, "options": { - "0": "$comparator_def" + "0": "" } }, { @@ -12079,7 +14074,7 @@ "high": 5 }, "options": { - "0": "$comparator_def" + "0": "" } }, { @@ -12092,7 +14087,10 @@ "high": 7 }, "options": { - "0": "$bitwise_def" + "0": "Disabled", + "1": "AND", + "2": "OR", + "3": "XOR" } }, { @@ -12105,7 +14103,7 @@ "high": 2 }, "options": { - "0": "$comparator_def" + "0": "" } }, { @@ -12118,7 +14116,7 @@ "high": 5 }, "options": { - "0": "$comparator_def" + "0": "" } }, { @@ -12131,7 +14129,10 @@ "high": 7 }, "options": { - "0": "$bitwise_def" + "0": "Disabled", + "1": "AND", + "2": "OR", + "3": "XOR" } }, { @@ -12144,7 +14145,7 @@ "high": 2 }, "options": { - "0": "$comparator_def" + "0": "" } }, { @@ -12157,7 +14158,7 @@ "high": 5 }, "options": { - "0": "$comparator_def" + "0": "" } }, { @@ -12170,7 +14171,10 @@ "high": 7 }, "options": { - "0": "$bitwise_def" + "0": "Disabled", + "1": "AND", + "2": "OR", + "3": "XOR" } }, { @@ -12183,7 +14187,7 @@ "high": 2 }, "options": { - "0": "$comparator_def" + "0": "" } }, { @@ -12196,7 +14200,7 @@ "high": 5 }, "options": { - "0": "$comparator_def" + "0": "" } }, { @@ -12209,7 +14213,10 @@ "high": 7 }, "options": { - "0": "$bitwise_def" + "0": "Disabled", + "1": "AND", + "2": "OR", + "3": "XOR" } }, { @@ -12222,7 +14229,7 @@ "high": 2 }, "options": { - "0": "$comparator_def" + "0": "" } }, { @@ -12235,7 +14242,7 @@ "high": 5 }, "options": { - "0": "$comparator_def" + "0": "" } }, { @@ -12248,7 +14255,10 @@ "high": 7 }, "options": { - "0": "$bitwise_def" + "0": "Disabled", + "1": "AND", + "2": "OR", + "3": "XOR" } }, { @@ -12261,7 +14271,7 @@ "high": 2 }, "options": { - "0": "$comparator_def" + "0": "" } }, { @@ -12274,7 +14284,7 @@ "high": 5 }, "options": { - "0": "$comparator_def" + "0": "" } }, { @@ -12287,7 +14297,10 @@ "high": 7 }, "options": { - "0": "$bitwise_def" + "0": "Disabled", + "1": "AND", + "2": "OR", + "3": "XOR" } }, { @@ -12300,7 +14313,7 @@ "high": 2 }, "options": { - "0": "$comparator_def" + "0": "" } }, { @@ -12313,7 +14326,7 @@ "high": 5 }, "options": { - "0": "$comparator_def" + "0": "" } }, { @@ -12326,7 +14339,10 @@ "high": 7 }, "options": { - "0": "$bitwise_def" + "0": "Disabled", + "1": "AND", + "2": "OR", + "3": "XOR" } }, { @@ -12339,7 +14355,7 @@ "high": 2 }, "options": { - "0": "$comparator_def" + "0": "" } }, { @@ -12352,7 +14368,7 @@ "high": 5 }, "options": { - "0": "$comparator_def" + "0": "" } }, { @@ -12365,7 +14381,10 @@ "high": 7 }, "options": { - "0": "$bitwise_def" + "0": "Disabled", + "1": "AND", + "2": "OR", + "3": "XOR" } }, { @@ -12675,7 +14694,70 @@ "high": 5 }, "options": { - "0": "$IO_Pins_no_def" + "0": "INVALID", + "1": "INVALID", + "2": "INVALID", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7", + "8": "8", + "9": "9", + "10": "10", + "11": "11", + "12": "12", + "13": "13", + "14": "14", + "15": "15", + "16": "16", + "17": "17", + "18": "18", + "19": "19", + "20": "20", + "21": "21", + "22": "22", + "23": "23", + "24": "24", + "25": "25", + "26": "26", + "27": "27", + "28": "28", + "29": "29", + "30": "30", + "31": "31", + "32": "32", + "33": "33", + "34": "34", + "35": "35", + "36": "36", + "37": "37", + "38": "38", + "39": "39", + "40": "40", + "41": "41", + "42": "42", + "43": "43", + "44": "44", + "45": "45", + "46": "46", + "47": "47", + "48": "48", + "49": "49", + "50": "50", + "51": "51", + "52": "52", + "53": "53", + "54": "INVALID", + "55": "A8", + "56": "A9", + "57": "A10", + "58": "A11", + "59": "A12", + "60": "A13", + "61": "A14", + "62": "A15", + "63": "INVALID" } }, { diff --git a/test/unit/pre_processing_test.dart b/test/unit/pre_processing_test.dart index 3fd44ec..32279dc 100644 --- a/test/unit/pre_processing_test.dart +++ b/test/unit/pre_processing_test.dart @@ -76,9 +76,9 @@ void main() { expect(parser.defines).toEqual( { - 'invalid_x16': ['"TEST"', r'$invalid_x8'], + 'invalid_x16': ['TEST', r'$invalid_x8'], 'fullStatus_def': [r'$fullStatus_def_1', r'$fullStatus_def_2'], - 'loadSourceUnits': ['"kPa"', '"% TPS"', '"%"', '"INVALID"'], + 'loadSourceUnits': ['kPa', '% TPS', '%', 'INVALID'], 'trigger_missingTooth': ['0'], }, ); diff --git a/test/unit/sections/constants_test.dart b/test/unit/sections/constants_test.dart index c963efe..619f758 100644 --- a/test/unit/sections/constants_test.dart +++ b/test/unit/sections/constants_test.dart @@ -25,6 +25,10 @@ page = 2 unusedBits4_123 = bits, U08, 123, [3:7] rtc_trim = scalar, S08, 123, "ppm", 1, 0, -127, +127, 0 inj4CylPairing = bits, U08, 123, [1:2], "1+3 & 2+4", "1+4 & 2+3", "INVALID", "INVALID" + +#define loadSourceNames = "MAP", "TPS", "IMAP/EMAP", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" + + ignAlgorithm = bits, U08, 26, [4:6], $loadSourceNames '''; test('config', () async { @@ -244,6 +248,28 @@ page = 2 3: 'INVALID', }); }); + + test('defined bits options', () async { + final result = await INIParser(raw).parse(); + final constant = result.constants.pages[1].constants[5] as ConstantBits; + + expect(constant.name).toEqual('ignAlgorithm'); + expect(constant.type).toEqual(ConstantType.bits); + expect(constant.size).toEqual(ConstantSize.u08); + expect(constant.offset).toEqual(26); + expect(constant.bits.low).toEqual(4); + expect(constant.bits.high).toEqual(6); + expect(constant.options).toEqual({ + 0: 'MAP', + 1: 'TPS', + 2: 'IMAP/EMAP', + 3: 'INVALID', + 4: 'INVALID', + 5: 'INVALID', + 6: 'INVALID', + 7: 'INVALID', + }); + }); }); group('failure', () { diff --git a/test/unit/sections/pc_variables_test.dart b/test/unit/sections/pc_variables_test.dart index 783b4d9..44a1500 100644 --- a/test/unit/sections/pc_variables_test.dart +++ b/test/unit/sections/pc_variables_test.dart @@ -5,7 +5,7 @@ import 'package:spec/spec.dart'; void main() { group('PcVariables', () { group('success', () { - const raw = ''' + const raw = r''' [PcVariables] tuneCrcPcVariable = continuousChannelValue, tuneCrc16 @@ -16,6 +16,10 @@ void main() { wueAFR = array, S16, [10], "AFR", 0.1, 0.0, -4.0, 4.0, 1 AUXin00Alias = string, ASCII, 20 iat_adcChannel = bits, U08, [0:5], 0="NONE", 1="18 - AN temp 1",13="19 - AN volt 4",5="28 - AN volt 10, Aux Reuse" + +#define loadSourceNames = "MAP", "TPS", "IMAP/EMAP", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" + + algorithmNames = bits, U08, [0:2], $loadSourceNames '''; test('scalar long', () async { @@ -155,6 +159,29 @@ void main() { 5: '28 - AN volt 10, Aux Reuse', }); }); + + test('bits - with defined options', () async { + final result = await INIParser(raw).parse(); + final variable = result.pcVariables[7] as PcVariableBits; + + expect(variable.name).toEqual('algorithmNames'); + expect(variable.type).toEqual(ConstantType.bits); + expect(variable.size).toEqual(ConstantSize.u08); + expect(variable.bits.low).toEqual(0); + expect(variable.bits.high).toEqual(2); + expect(variable.options).toEqual( + { + 0: 'MAP', + 1: 'TPS', + 2: 'IMAP/EMAP', + 3: 'INVALID', + 4: 'INVALID', + 5: 'INVALID', + 6: 'INVALID', + 7: 'INVALID' + }, + ); + }); }); group('failure', () {