Skip to content

Commit

Permalink
fix flash util err when no APPS dir (#2155)
Browse files Browse the repository at this point in the history
* add path class usage

* fix when don't have apps dir

* clean up
  • Loading branch information
zxkmm committed May 20, 2024
1 parent 2a78c54 commit db3ae29
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion firmware/application/apps/ui_flash_utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ FlashUtilityView::FlashUtilityView(NavigationView& nav)

menu_view.set_parent_rect({0, 3 * 8, 240, 33 * 8});

ensure_directory(apps_dir);
ensure_directory(firmware_dir);

auto add_firmware_items = [&](
Expand Down Expand Up @@ -154,7 +155,7 @@ bool FlashUtilityView::flash_firmware(std::filesystem::path::string_type path) {

if (path.empty() || !valid_firmware_file(path.c_str())) {
painter.fill_rectangle({0, 50, portapack::display.width(), 90}, ui::Color::black());
painter.draw_string({0, 60}, Styles::red, "BAD FIRMWARE FILE");
painter.draw_string({0, 60}, Styles::red, "BAD FIRMWARE FILE OR W/R ERR");
chThdSleepMilliseconds(5000);
return false;
}
Expand Down

0 comments on commit db3ae29

Please sign in to comment.