BV HiZ: improved pins test error messages

This commit is contained in:
King Kévin 2018-02-14 14:06:06 +01:00
parent 6babde53ee
commit a06d8f1647
1 changed files with 7 additions and 7 deletions

View File

@ -484,7 +484,7 @@ static bool busvoodoo_hiz_test_pins(void)
busvoodoo_safe_state(); // start from safe state with all outputs switched off
const char* lv_to = "connect I/O pin 4 to "; // most outputs will be tested using LV ADC
const char* lv_high = "pin 4 is high while it should be low, other pin might be defective\n"; // error message if expect low output is high
//const char* lv_high = "pin 4 is high while it should be low, other pin might be defective\n"; // error message if expect low output is high
// test GND on pin 1 by shorting LV_CTL to ground (through 40k resistor) and measure short
gpio_set(GPIO(BUSVOODOO_LVCTL_PORT), GPIO(BUSVOODOO_LVCTL_PIN)); // set pin high
@ -502,7 +502,7 @@ static bool busvoodoo_hiz_test_pins(void)
gpio_set_mode(GPIO(BUSVOODOO_LVCTL_PORT), GPIO_MODE_OUTPUT_2_MHZ, GPIO_CNF_OUTPUT_PUSHPULL, GPIO(BUSVOODOO_LVCTL_PIN)); // set LV control pin as output
sleep_ms(100); // wait for voltage to settle an debounce
if (busvoodoo_vreg_get(BUSVOODOO_LV_CHANNEL)>0.2) {
printf(lv_high);
printf("I/O pin 4 is high while it should be low and shorted to ground\n");
#if DEBUG
while (true);
#else
@ -525,7 +525,7 @@ static bool busvoodoo_hiz_test_pins(void)
gpio_set(GPIO(BUSVOODOO_VOUTEN_PORT), GPIO(BUSVOODOO_VOUTEN_PIN)); // disable Vout
sleep_ms(100); // wait for voltage to settle and debounce
if (busvoodoo_vreg_get(BUSVOODOO_LV_CHANNEL)>0.2) {
printf(lv_high);
printf("5V output is high while the power output should be switched off\n");
#if DEBUG
while (true);
#else
@ -547,7 +547,7 @@ static bool busvoodoo_hiz_test_pins(void)
gpio_set(GPIO(BUSVOODOO_VOUTEN_PORT), GPIO(BUSVOODOO_VOUTEN_PIN)); // disable Vout
sleep_ms(100); // wait for voltage to settle and debounce
if (busvoodoo_vreg_get(BUSVOODOO_LV_CHANNEL)>0.2) {
printf(lv_high);
printf("3V3 output is high while the power output should be switched off\n");
#if DEBUG
while (true);
#else
@ -573,7 +573,7 @@ static bool busvoodoo_hiz_test_pins(void)
gpio_clear(busvoodoo_io_ports[pin], busvoodoo_io_pins[pin]); // set pin low
sleep_ms(100); // wait for voltage to settle and debounce
if (busvoodoo_vreg_get(BUSVOODOO_LV_CHANNEL)>0.2) {
printf(lv_high);
printf("I/O pin %u is high while it should be low\n", io+4);
#if DEBUG
while (true);
#else
@ -695,7 +695,7 @@ static bool busvoodoo_hiz_test_pins(void)
gpio_clear(GPIO(BUSVOODOO_RS232_RX_PORT), GPIO(BUSVOODOO_RS232_RX_PIN)); // pull low to avoid false negative
sleep_ms(100); // wait for voltage to settle and debounce
if (!gpio_get(GPIO(BUSVOODOO_RS232_RX_PORT), GPIO(BUSVOODOO_RS232_RX_PIN))) { // check if RX is set low by TX
printf("CAN/RS pin 2 is high while it should be set low by pin 3\n");
printf("RS-232 RX is high while it should be set low by RS-232 TX\n");
#if DEBUG
while (true);
#else
@ -725,7 +725,7 @@ static bool busvoodoo_hiz_test_pins(void)
gpio_clear(GPIO(BUSVOODOO_RS232_CTS_PORT), GPIO(BUSVOODOO_RS232_CTS_PIN)); // pull low to avoid false negative
sleep_ms(100); // wait for voltage to settle an debounce
if (!gpio_get(GPIO(BUSVOODOO_RS232_CTS_PORT), GPIO(BUSVOODOO_RS232_CTS_PIN))) { // check if CTS is set high by RTS
printf("CAN/RS pin 5 is high while it should be set low by pin 4\n");
printf("RS-232 CTS is high while it should be set low by RS-232 RTS\n");
#if DEBUG
while (true);
#else