diff --git a/drivers/digit7seg/digit7seg.c b/drivers/digit7seg/digit7seg.c index c03dd67c1704..07e6957bfb49 100644 --- a/drivers/digit7seg/digit7seg.c +++ b/drivers/digit7seg/digit7seg.c @@ -49,11 +49,9 @@ static void _set_pin_value(digit7seg_t *dev) for (int i = 0; i < BYTE_BITS; i++) { if (current_value & (1 << i)) { gpio_set(pins[i]); - DEBUG("PIN SET\n"); } else { gpio_clear(pins[i]); - DEBUG("PIN CLEAR\n"); } } } @@ -73,8 +71,6 @@ static void _shift_display(void *arg, int chan) dev->current_digit = dev->current_digit % dev->params.digits; gpio_set(digit_pins[dev->current_digit]); - DEBUG("[INFO] On display %d\n", dev->current_digit); - _set_pin_value(dev); } @@ -95,9 +91,17 @@ int digit7seg_init(digit7seg_t *dev, const digit7seg_params_t *params) PIN_DIG1, PIN_DIG2, PIN_DIG3, PIN_DIG4 }; + const char* pins_debug[] = + { + "A", "B", "C", "D", "E", "F", "G", "DP", + "DIG1", "DIG2", "DIG3", "DIG4" + }; + for (int i = 0; i < NB_PIN; i++) { - assert(gpio_init(pins[i], GPIO_OUT)); + DEBUG("[DIGIT7SEG] Trying the pin %s:...", pins_debug[i]); + assert(gpio_init(pins[i], GPIO_OUT) == 0); gpio_clear(pins[i]); + DEBUG("Worked\n"); } return DIGIT7SEG_OK; diff --git a/drivers/include/digit7seg.h b/drivers/include/digit7seg.h index c063372cff30..49314aa97565 100644 --- a/drivers/include/digit7seg.h +++ b/drivers/include/digit7seg.h @@ -44,7 +44,7 @@ extern "C" { * @brief Return codes for @ref digit7seg_init */ typedef enum { - DIGIT7SEG_OK = 0, + DIGIT7SEG_OK = 0, /**< All ok */ DIGIT7SEG_ERR_DIGITS, /**< Something went wrong with digits value */ } digit7seg_error_codes; diff --git a/tests/drivers/digit7seg/main.c b/tests/drivers/digit7seg/main.c index 19fb34abc0c2..422ae5b647d8 100644 --- a/tests/drivers/digit7seg/main.c +++ b/tests/drivers/digit7seg/main.c @@ -74,16 +74,5 @@ int main(void) digit7seg_poweroff(&dev); - ztimer_sleep(ZTIMER_USEC, TEST_DELAY_US * 3); - - if (digit7seg_poweron(&dev) == 0) { - puts("Launched."); - } - else { - puts("Error"); - } - - while (1) {} - return 0; }