Skip to content

Commit

Permalink
Fixed ui version bug. (#125)
Browse files Browse the repository at this point in the history
* Added correct firmware release version to ui.

* Fixed rendering bug, where version would pop in and out.
  • Loading branch information
carlhampuswall authored May 10, 2024
1 parent cace367 commit c3d0476
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 7 additions & 5 deletions firmware/src/onboarding_flow/onboarding_flow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ OnboardingFlow::OnboardingFlow(TFT_eSprite *spr_, TFT_eSprite qrcode_spr_) : spr
0,
90,
};

#ifdef RELEASE_VERSION
sprintf(firmware_version, "%s", RELEASE_VERSION);
#else
sprintf(firmware_version, "%s", "DEV");
#endif
}

void OnboardingFlow::triggerMotorConfigUpdate()
Expand Down Expand Up @@ -563,11 +569,7 @@ TFT_eSprite *OnboardingFlow::renderAboutPage()
spr_->setTextDatum(CC_DATUM);
uint8_t left_padding = 30;

#ifdef RELEASE_VERSION
sprintf(buf_, "FIRMWARE %s" RELEASE_VERSION);
#else
sprintf(buf_, "FIRMWARE %s", "DEV");
#endif
sprintf(buf_, "FIRMWARE: %s", firmware_version);
spr_->setFreeFont(&NDS1210pt7b);
spr_->setTextColor(default_text_color);
spr_->drawString(buf_, center_h, 85, 1);
Expand Down
2 changes: 2 additions & 0 deletions firmware/src/onboarding_flow/onboarding_flow.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ class OnboardingFlow
TFT_eSprite *renderDemo1StepPage();
TFT_eSprite *renderAboutPage();

char firmware_version[16];

int32_t current_position = 0;
uint8_t current_page = 0;

Expand Down

0 comments on commit c3d0476

Please sign in to comment.