InfiniTime.git

commit d79766bccd81b8b1ccc7f71b5aad9de3fc436193

Author: Jean-François Milants <jf@codingfield.com>

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 +-


diff --git a/src/displayapp/screens/ApplicationList.h b/src/displayapp/screens/ApplicationList.h
index 77e1d39e9d6d429c1211e32f8f68f325cb7a863b..978f0287497679692238c918ba6aca9eec5d0d99 100644
--- a/src/displayapp/screens/ApplicationList.h
+++ b/src/displayapp/screens/ApplicationList.h
@@ -38,7 +38,7 @@         std::array apps;
 
         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;
       };