From f3209e1aec35191f709db9e4148673ac44985aa7 Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Fri, 13 Apr 2018 10:27:55 +0200 Subject: [PATCH] fixed possible feedmultiply change cause by entering main menu with negative encoder position --- Firmware/MenuStack.cpp | 2 +- Firmware/MenuStack.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Firmware/MenuStack.cpp b/Firmware/MenuStack.cpp index 5e17a7d9..94d74543 100644 --- a/Firmware/MenuStack.cpp +++ b/Firmware/MenuStack.cpp @@ -9,7 +9,7 @@ * @param menu * @param position selected position in menu being pushed */ -void MenuStack::push(menuFunc_t menu, uint8_t position) +void MenuStack::push(menuFunc_t menu, int8_t position) { if (m_index >= max_depth) return; m_stack[m_index].menu = menu; diff --git a/Firmware/MenuStack.h b/Firmware/MenuStack.h index 04754449..ef320543 100644 --- a/Firmware/MenuStack.h +++ b/Firmware/MenuStack.h @@ -19,10 +19,10 @@ public: struct Record { menuFunc_t menu; - uint8_t position; + int8_t position; }; MenuStack():m_stack(),m_index(0) {} - void push(menuFunc_t menu, uint8_t position); + void push(menuFunc_t menu, int8_t position); Record pop(); void reset(){m_index = 0;} private: