~ruther/uni-mam-arm

3789894a7dbda0e114dbfccb85c8ff7a2cb93690 — Rutherther 3 months ago f9fdd1e
fix(arm04): dot position when empty digits
1 files changed, 4 insertions(+), 5 deletions(-)

M arm04/src/main.c
M arm04/src/main.c => arm04/src/main.c +4 -5
@@ 156,14 156,13 @@ void main()
      display_digits_set(&display, "Err\0");
      display_dots(&display, 0);
    } else {
      display_dots(&display, converted.dot);

      uint8_t zero_count = DIGITS - converted.digits_count;
      uint8_t empty_count = DIGITS - converted.digits_count;
      display_dots(&display, converted.dot << empty_count);
      for (uint8_t digit = 0; digit < DIGITS; digit++) {
        char value = '\0';

        if (digit >= zero_count) {
          value = converted.digits[digit - zero_count];
        if (digit >= empty_count) {
          value = converted.digits[digit - empty_count];
        }

        display_digit_set(&display, digit, value);

Do not follow this link