Allow zero app to be selected at build time

Fix 'nScreens' calculation in ApplicationList so that we can build the project with zero user app selected.
This commit is contained in:
Jean-François Milants 2023-12-10 18:12:40 +01:00 committed by JF
parent 80607282dd
commit d79766bccd

View file

@ -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;
};