From f33e08f0d76179e23dae92a451874e9a845edc82 Mon Sep 17 00:00:00 2001 From: bray Date: Mon, 25 May 2020 21:18:47 +0200 Subject: [PATCH] Menu 0 et 1 fonctionnels 2.0 --- app/src/Menu.cpp | 6 ++---- sketch_ino.cpp | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/app/src/Menu.cpp b/app/src/Menu.cpp index 7bd6bbc..4624e64 100644 --- a/app/src/Menu.cpp +++ b/app/src/Menu.cpp @@ -6,8 +6,6 @@ Menu::Menu() : id(0), choice(0), nbreChoices(1) { - listId.push_back(0); - list.push_back(*(new std::pair(1,"\n Liste tortue "))); list.push_back(*(new std::pair 1){ + if(!listId.empty()){ + id = listId.back(); listId.pop_back(); - id = *listId.end(); } } diff --git a/sketch_ino.cpp b/sketch_ino.cpp index f2846ef..55a936b 100644 --- a/sketch_ino.cpp +++ b/sketch_ino.cpp @@ -48,7 +48,7 @@ void Board::loop() { PressureManagement(); - if (i > 2 && menu->getId() == 0 && menu->displayDefault(temperature.getValue(), + if (menu->getId() == 0 && menu->displayDefault(temperature.getValue(), pressure.getValue(), terrarium.getRadState(), terrarium.getTapState(), @@ -58,7 +58,7 @@ void Board::loop() { terrarium.getRadState(), terrarium.getTapState(), 0).c_str()); - } else if (i > 2 && menu->getMessage().c_str() != NULL){ + } else if (menu->getMessage().c_str() != NULL){ strcpy(buf, menu->getMessage().c_str()); }