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()); }