@@ -115,8 +115,6 @@ void find_ports(std::list<PortType> &matched_ports, std::list<PortType> ¬_mat
115
115
PortType port;
116
116
117
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]);
120
118
continue ;
121
119
}
122
120
@@ -143,7 +141,7 @@ void find_ports(std::list<PortType> &matched_ports, std::list<PortType> ¬_mat
143
141
#if DEVICE_SERIAL
144
142
if (!strcmp (PortType::PinMap::name, UART_NAME) || !strcmp (PortType::PinMap::name, UARTNOFC_NAME)) {
145
143
if (pinmap_list_has_peripheral (pinmap_uart_restricted_peripherals (), port.peripheral )) {
146
- utest_printf (" Skipping (restricted uart peripheral) %s peripheral %i with pin %s (%i )\r\n " , pin_type,
144
+ utest_printf (" Skipping (restricted uart peripheral) %s peripheral 0x%x with pin %s (%x )\r\n " , pin_type,
147
145
port.peripheral , FormFactorType::pin_to_string (port.pins [i]), port.pins [i]);
148
146
continue ;
149
147
}
@@ -178,31 +176,35 @@ void test_all_ports(std::list<PortType> &matched_ports, std::list<PortType> ¬
178
176
}
179
177
180
178
for (uint32_t i = 0 ; i < ff_pins->count ; i++) {
181
- for (Iter it = matched_ports.begin (); it != matched_ports.end (); ++it) {
182
- PortType &port = *it;
183
- for (uint32_t j = 0 ; j < PortType::pin_count; j++) {
184
- if (ff_pins->pins [i] == port.pins [j]) {
185
- utest_printf (" %3s - %s pin tested on port: %s..." , FormFactorType::pin_to_string (ff_pins->pins [i]),
186
- PortType::PinMap::pin_type_names[j], port.str ());
187
- if (port.status == PortType::StatusNotTested) {
188
- call (port);
189
- port.status = PortType::StatusPass;
179
+ if (ff_pins->pins [i] != NC) {
180
+ for (Iter it = matched_ports.begin (); it != matched_ports.end (); ++it) {
181
+ PortType &port = *it;
182
+ for (uint32_t j = 0 ; j < PortType::pin_count; j++) {
183
+ if (ff_pins->pins [i] == port.pins [j]) {
184
+ utest_printf (" %3s - %s pin tested on port: %s..." , FormFactorType::pin_to_string (ff_pins->pins [i]),
185
+ PortType::PinMap::pin_type_names[j], port.str ());
186
+ if (port.status == PortType::StatusNotTested) {
187
+ call (port);
188
+ port.status = PortType::StatusPass;
189
+ } else {
190
+ utest_printf (" test already done..." );
191
+ }
192
+ utest_printf (" %s\n " , port.status == PortType::StatusPass ? " succeeded" : " failed" );
193
+ goto end_port_iteration;
190
194
}
191
- utest_printf (" %s\n " , port.status == PortType::StatusPass ? " succeeded" : " failed" );
192
- goto end_port_iteration;
193
195
}
194
196
}
195
- }
196
- for (Iter it = not_matched_ports. begin (); it != not_matched_ports. end (); ++it) {
197
- PortType &port = *it;
198
- for ( uint32_t j = 0 ; j < PortType::pin_count; j++ ) {
199
- if (ff_pins-> pins [i] == port. pins [j]) {
200
- utest_printf ( " %3s - Could not find pins to test %s pin %s (%d) \n " ,
201
- FormFactorType::pin_to_string (ff_pins-> pins [i]) ,
202
- PortType::PinMap::pin_type_names[j] ,
203
- FormFactorType::pin_to_string ( ff_pins->pins [i]),
204
- ff_pins-> pins [i]) ;
205
- goto end_port_iteration;
197
+ for (Iter it = not_matched_ports. begin (); it != not_matched_ports. end (); ++it) {
198
+ PortType &port = *it;
199
+ for ( uint32_t j = 0 ; j < PortType::pin_count; j++) {
200
+ if (ff_pins-> pins [i] == port. pins [j] ) {
201
+ utest_printf ( " %3s - Could not find pins to test %s pin %s (%d) \n " ,
202
+ FormFactorType::pin_to_string (ff_pins-> pins [i]) ,
203
+ PortType::PinMap::pin_type_names[j] ,
204
+ FormFactorType::pin_to_string (ff_pins-> pins [i]) ,
205
+ ff_pins->pins [i]);
206
+ goto end_port_iteration ;
207
+ }
206
208
}
207
209
}
208
210
}
@@ -215,9 +217,11 @@ template<typename PortType, typename FunctionType, FunctionType f>
215
217
void test_peripheral (PortType &port)
216
218
{
217
219
if (port.empty ()) {
218
- utest_printf (" %d - Could not find pins to test peripheral\n " , port.peripheral );
220
+ if (port.peripheral != NC) {
221
+ utest_printf (" 0x%x - Could not find pins to test peripheral\n " , port.peripheral );
222
+ }
219
223
} else {
220
- utest_printf (" %d - peripheral tested on port: %s..." , port.peripheral , port.str ());
224
+ utest_printf (" 0x%x - peripheral tested on port: %s..." , port.peripheral , port.str ());
221
225
if (port.status == PortType::StatusNotTested) {
222
226
FunctionCaller<PortType, FunctionType, f> call;
223
227
call (port); // run test
@@ -403,7 +407,7 @@ class Port {
403
407
{
404
408
static char port_str[128 ];
405
409
char pin_str[32 ];
406
- sprintf (port_str, " peripheral=(%d ) " , peripheral);
410
+ sprintf (port_str, " peripheral=(0x%x ) " , peripheral);
407
411
for (uint32_t i = 0 ; i < N; i++) {
408
412
sprintf (pin_str, " %s=(%s) " , PinMap::pin_type_names[i], FormFactorType::pin_to_string (pins[i]));
409
413
strcat (port_str, pin_str);
@@ -582,7 +586,7 @@ struct UARTMaps {
582
586
static const char *const name;
583
587
};
584
588
const PinMap *UARTMaps::maps[] = { serial_tx_pinmap (), serial_rx_pinmap (), serial_cts_pinmap (), serial_rts_pinmap () };
585
- const char *const UARTMaps::pin_type_names[] = { " TX" , " RX" , " CLS " , " RTS" };
589
+ const char *const UARTMaps::pin_type_names[] = { " TX" , " RX" , " CTS " , " RTS" };
586
590
const char *const UARTMaps::name = UART_NAME;
587
591
typedef Port<4 , UARTMaps, DefaultFormFactor, TF4> UARTPort;
588
592
#endif
0 commit comments