From d79766bccd81b8b1ccc7f71b5aad9de3fc436193 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Milants?= Date: Sun, 10 Dec 2023 18:12:40 +0100 Subject: [PATCH] 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. --- src/displayapp/screens/ApplicationList.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 screens; };