浏览代码

fixed possible feedmultiply change cause by entering main menu with negative encoder position

PavelSindler 6 年之前
父节点
当前提交
f3209e1aec
共有 2 个文件被更改,包括 3 次插入3 次删除
  1. 1 1
      Firmware/MenuStack.cpp
  2. 2 2
      Firmware/MenuStack.h

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

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