Skip to content

Commit

Permalink
Allow zero app to be selected at build time
Browse files Browse the repository at this point in the history
Fix 'nScreens' calculation in ApplicationList so that we can build the project with zero user app selected.
  • Loading branch information
JF002 committed Dec 10, 2023
1 parent 8060728 commit d79766b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/displayapp/screens/ApplicationList.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ namespace Pinetime {

static constexpr int appsPerScreen = 6;

static constexpr int nScreens = (UserAppTypes::Count - 1) / appsPerScreen + 1;
static constexpr int nScreens = UserAppTypes::Count > 0 ? (UserAppTypes::Count - 1) / appsPerScreen + 1 : 1;

ScreenList<nScreens> screens;
};
Expand Down

0 comments on commit d79766b

Please sign in to comment.