@@ -956,9 +956,9 @@ def zephyr_dts_to_cp_board(board_id, portdir, builddir, zephyrbuilddir, mpconfig
956956 port_indexes [label ] = int (match .group (1 )) if match else len (port_indexes )
957957 # Package pin map selected through the IOBROKER_PACKAGE choice: map each
958958 # SoC pad to the package pin it is bonded to so that the pin objects can
959- # hand package pins straight to the iobroker module. When no package
960- # applies to the SoC (IOBROKER_PACKAGE_NONE) there is no map, so the pin
961- # objects get IOBROKER_NO_PIN instead.
959+ # hand package pins straight to the iobroker module. The 1:1 choice is an
960+ # identity map (package pin number == global pin number); IOBROKER_PACKAGE_NONE
961+ # has no map, so the pin objects get IOBROKER_NO_PIN instead.
962962 package_pin_of_pad = {}
963963 package_pins = None
964964 package_choice = None
@@ -968,8 +968,16 @@ def zephyr_dts_to_cp_board(board_id, portdir, builddir, zephyrbuilddir, mpconfig
968968 if not stripped .startswith ("CONFIG_IOBROKER_PACKAGE_" ) or not stripped .endswith ("=y" ):
969969 continue
970970 package_choice = stripped [len ("CONFIG_IOBROKER_PACKAGE_" ) : - len ("=y" )].lower ()
971- if package_choice == "none" :
972- continue
971+ break
972+ if package_choice == "one_to_one" :
973+ # Identity map over the enabled GPIO controllers.
974+ package_pins = []
975+ for ioport in sorted (ioports .keys ()):
976+ for num in ioports [ioport ]:
977+ global_number = port_indexes [ioport ] * 32 + num
978+ package_pins .append ({"pin" : global_number , "pad" : global_number })
979+ package_pin_of_pad [global_number ] = global_number
980+ elif package_choice not in (None , "none" ):
973981 package_toml = (
974982 pathlib .Path (__file__ ).resolve ().parent .parent
975983 / "modules"
@@ -983,7 +991,6 @@ def zephyr_dts_to_cp_board(board_id, portdir, builddir, zephyrbuilddir, mpconfig
983991 for package_pin_entry in package_pins :
984992 if "pad" in package_pin_entry :
985993 package_pin_of_pad [package_pin_entry ["pad" ]] = package_pin_entry ["pin" ]
986- break
987994 # Board pin names from circuitpython.toml: ``[pins]`` maps a board module
988995 # name to a package pin number or ball id, resolved to a SoC pad with the
989996 # package pin map above. This is independent of Zephyr's devicetree
0 commit comments