@@ -111,26 +111,30 @@ void find_ports(std::list<PortType> &matched_ports, std::list<PortType> ¬_mat
111
111
const char *pin_type = PortType::PinMap::pin_type_names[i];
112
112
113
113
// Loop through each pin of a given type
114
- for (; map-> pin != NC; map ++) {
114
+ for (uint32_t j = 0 ; j < FormFactorType::pins ()-> count ; j ++) {
115
115
PortType port;
116
- // Set pin being tested
117
- port.pins [i] = map->pin ;
118
- port.peripheral = map->peripheral ;
119
- // Only form factor pins can be tested
120
- if (!pinmap_list_has_pin (FormFactorType::pins (), port.pins [i])) {
116
+
117
+ if (FormFactorType::pins ()->pins [j] == NC) {
118
+ utest_printf (" Skipping (NC pin) %s pin %s (%i)\r\n " , pin_type,
119
+ FormFactorType::pin_to_string (port.pins [i]), port.pins [i]);
121
120
continue ;
122
121
}
122
+
123
+ // Set pin being tested
124
+ port.pins [i] = FormFactorType::pins ()->pins [j];
125
+ port.peripheral = pinmap_find_peripheral (port.pins [i], map);
126
+
123
127
// Don't test restricted pins
124
128
if (pinmap_list_has_pin (FormFactorType::restricted_pins (), port.pins [i])) {
125
- utest_printf (" Skipping %s pin %s (%i)\r\n " , pin_type,
129
+ utest_printf (" Skipping (restricted pin) %s pin %s (%i)\r\n " , pin_type,
126
130
FormFactorType::pin_to_string (port.pins [i]), port.pins [i]);
127
131
continue ;
128
132
}
129
133
130
134
if (!strcmp (PortType::PinMap::name, GPIO_IRQ_NAME) || !strcmp (PortType::PinMap::name, GPIO_NAME)) {
131
135
// Don't test restricted gpio pins
132
136
if (pinmap_list_has_pin (pinmap_gpio_restricted_pins (), port.pins [i])) {
133
- utest_printf (" Skipping %s pin %s (%i)\r\n " , pin_type,
137
+ utest_printf (" Skipping (restricted gpio pin) %s pin %s (%i)\r\n " , pin_type,
134
138
FormFactorType::pin_to_string (port.pins [i]), port.pins [i]);
135
139
continue ;
136
140
}
@@ -139,7 +143,7 @@ void find_ports(std::list<PortType> &matched_ports, std::list<PortType> ¬_mat
139
143
#if DEVICE_SERIAL
140
144
if (!strcmp (PortType::PinMap::name, UART_NAME) || !strcmp (PortType::PinMap::name, UARTNOFC_NAME)) {
141
145
if (pinmap_list_has_peripheral (pinmap_uart_restricted_peripherals (), port.peripheral )) {
142
- utest_printf (" Skipping %s peripheral %i with pin %s (%i)\r\n " , pin_type,
146
+ utest_printf (" Skipping (restricted uart peripheral) %s peripheral %i with pin %s (%i)\r\n " , pin_type,
143
147
port.peripheral , FormFactorType::pin_to_string (port.pins [i]), port.pins [i]);
144
148
continue ;
145
149
}
0 commit comments