usb_cables: minor, function rename
This commit is contained in:
parent
fad74acd9e
commit
c19cbe07d1
|
@ -539,7 +539,7 @@ static void command_cables(void* argument)
|
|||
for (uint8_t cable = 0; cable < LENGTH(usb_cables); cable++) { // test every cable
|
||||
if (0xff == cable_i || cable == cable_i) {
|
||||
uint8_t pair_defined, pair_undefined;
|
||||
bool result = usb_cables_check_cable(&usb_cables[cable], &pair_defined, &pair_undefined, false);
|
||||
bool result = usb_cables_test_cable(&usb_cables[cable], &pair_defined, &pair_undefined, false);
|
||||
printf("%02u %s: %s (defined=%u/%u, undefined=%u)\n", cable, result ? "OK" : "KO", usb_cables[cable].name, pair_defined, usb_cables[cable].pin_pairs_nb, pair_undefined);
|
||||
}
|
||||
}
|
||||
|
@ -890,7 +890,7 @@ static void command_test(void* argument)
|
|||
bool cable_ok = false; // if the cable is connected
|
||||
while (!cable_ok) { // wait until all pin pairs of cable are connected
|
||||
uint8_t defined, undefined; // pair counting variables
|
||||
cable_ok = usb_cables_check_cable(&test_cables[cable], &defined, &undefined, true); // test cable
|
||||
cable_ok = usb_cables_test_cable(&test_cables[cable], &defined, &undefined, true); // test cable
|
||||
if (!cable_ok && defined > 0) { // not all pairs are connected
|
||||
printf("connection issues: defined=%u/%u, undefined=%u\n", defined, test_cables[cable].pin_pairs_nb, undefined); // show issue summary
|
||||
}
|
||||
|
|
|
@ -4756,7 +4756,7 @@ bool usb_cables_test_load(const struct usb_connector_t* connector)
|
|||
return loaded;
|
||||
}
|
||||
|
||||
bool usb_cables_check_cable(const struct usb_cable_t* cable, uint8_t* defined, uint8_t* undefined, bool print)
|
||||
bool usb_cables_test_cable(const struct usb_cable_t* cable, uint8_t* defined, uint8_t* undefined, bool print)
|
||||
{
|
||||
if (NULL == cable) {
|
||||
return false;
|
||||
|
|
10
usb_cables.h
10
usb_cables.h
|
@ -99,7 +99,7 @@ uint8_t usb_cables_check_pins(const struct usb_pin_t* pin1, const struct usb_pin
|
|||
* @param[in] connectors_nb numbers of connectors
|
||||
* @param[out] connected which of the connectors are connected (NULL to just print the connections)
|
||||
* @note connection between pin on the same connector are not checked
|
||||
* @note this is faster than usb_cables_check_inter but only checks the ground pins
|
||||
* @note this is faster than usb_cables_check_inter but only checks the ground pin
|
||||
* @note it assumes all grounds are connected (e.g. only one cable is connected)
|
||||
*/
|
||||
void usb_cables_check_ground(const struct usb_connector_t** connectors, uint8_t connectors_nb, bool* connected);
|
||||
|
@ -108,15 +108,15 @@ void usb_cables_check_ground(const struct usb_connector_t** connectors, uint8_t
|
|||
* @return if there is a load on the connector
|
||||
*/
|
||||
bool usb_cables_test_load(const struct usb_connector_t* connector);
|
||||
/** check USB cable connections
|
||||
* @param[in] usb_cable USB cable to check
|
||||
/** test USB cable connections
|
||||
* @param[in] usb_cable USB cable to test
|
||||
* @param[out] defined number of pin pairs that are connected according to definition
|
||||
* @param[out] undefined number of pin pairs that are connected but not according to definition
|
||||
* @param[in] print print connection errors
|
||||
* @return if the connections of the cable correspond to the definition
|
||||
* @note each pair is checked in both directions
|
||||
* @note each pair is tested in both directions
|
||||
*/
|
||||
bool usb_cables_check_cable(const struct usb_cable_t* cable, uint8_t* defined, uint8_t* undefined, bool print);
|
||||
bool usb_cables_test_cable(const struct usb_cable_t* cable, uint8_t* defined, uint8_t* undefined, bool print);
|
||||
/** test connections between connectors
|
||||
* @param[in] connectors connectors to check
|
||||
* @param[in] connectors_nb numbers of connectors
|
||||
|
|
Loading…
Reference in New Issue