Skip to content

Commit

Permalink
Merge pull request 32blit#571 from pimoroni/patch-flash-progress
Browse files Browse the repository at this point in the history
Support flash progress at 160x120 res
  • Loading branch information
Gadgetoid authored Jan 28, 2021
2 parents 4715724 + 7e2c7fe commit cdc246b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions firmware/firmware.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ struct {
void draw() {
if(!this->message.empty()) {
screen.pen = Pen(0, 0, 0, 150);
screen.rectangle(Rect(0, 215, 320, 25));
screen.rectangle(Rect(0, screen.bounds.h - 25, screen.bounds.w, 25));
screen.pen = Pen(255, 255, 255);
screen.text(this->message, minimal_font, Point(5, 220));
uint32_t progress_width = ((this->value * 310) / this->total);
screen.rectangle(Rect(5, 230, progress_width, 5));
screen.text(this->message, minimal_font, Point(5, screen.bounds.h - 20));
uint32_t progress_width = ((this->value * (screen.bounds.w - 10)) / this->total);
screen.rectangle(Rect(5, screen.bounds.h - 10, progress_width, 5));
}
}
} progress;
Expand Down

0 comments on commit cdc246b

Please sign in to comment.