Browse Source

Add files via upload

Krulknul 3 years ago
parent
commit
1c82bec6f3
1 changed files with 3 additions and 2 deletions
  1. 3 2
      counter.c

+ 3 - 2
counter.c

@@ -4,6 +4,7 @@
 #include <stdlib.h>
 #include <counter_icons.h>
 
+#define MAX_COUNT 99
 #define BOXTIME 2
 #define BOXWIDTH 30
 #define MIDDLE_X 64 - BOXWIDTH / 2
@@ -89,10 +90,10 @@ int32_t counterapp(void) {
                 furi_mutex_release(c->mutex);
                 state_free(c);
                 return 0;
-            } else if(input.key == InputKeyUp) {
+            } else if(input.key == InputKeyUp && c->count < MAX_COUNT) {
                 c->pressed = true;
                 c->boxtimer = BOXTIME;
-                if(c->count <= INT_MAX) c->count++;
+                c->count++;
             } else if(input.key == InputKeyDown && c->count != 0) {
                 c->pressed = true;
                 c->boxtimer = BOXTIME;