Skip to content

Commit

Permalink
Merge pull request #1117 from mlyle/mpl-brainresetreason
Browse files Browse the repository at this point in the history
flight: osd: properly display reset reason
  • Loading branch information
tracernz authored Jul 15, 2016
2 parents 9630278 + 951a7dc commit e817068
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions flight/Modules/OnScreenDisplay/onscreendisplay.c
Original file line number Diff line number Diff line change
Expand Up @@ -731,14 +731,18 @@ void draw_alarms(int x, int y, int xs, int ys, int va, int ha, int flags, int fo
buf[strlen(boot_reason)] = '\0';
pos = strlen(boot_reason);
buf[pos++] = ' ';
return;
}

uint8_t state;
int32_t len = AlarmString(&alarm, buf, sizeof(buf) - 1, blink, &state);
int32_t len = AlarmString(&alarm, buf + pos, sizeof(buf) - 1 - pos,
blink, &state);

if (len > 0) {
buf[len] = '\0';
pos += len;
}

if (pos > 0) {
buf[pos] = '\0';
write_string(buf, x, y, xs, ys, va, ha, flags, font);
}
}
Expand Down

0 comments on commit e817068

Please sign in to comment.