aboutsummaryrefslogtreecommitdiffstats
path: root/src/displayapp/screens
diff options
context:
space:
mode:
authorJean-François Milants <jf@codingfield.com>2023-12-10 18:12:40 +0100
committerJF <JF002@users.noreply.github.com>2023-12-10 18:16:41 +0100
commitd79766bccd81b8b1ccc7f71b5aad9de3fc436193 (patch)
treebff1a1cb4865e73101eb1d5edf0ec0bc778d1527 /src/displayapp/screens
parent80607282dd78a0bc3a9cc234d992edec712637c1 (diff)
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.
Diffstat (limited to 'src/displayapp/screens')
-rw-r--r--src/displayapp/screens/ApplicationList.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/displayapp/screens/ApplicationList.h b/src/displayapp/screens/ApplicationList.h
index 77e1d39e..978f0287 100644
--- a/src/displayapp/screens/ApplicationList.h
+++ b/src/displayapp/screens/ApplicationList.h
@@ -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;
};