fixed possible feedmultiply change cause by entering main menu with negative encoder position
This commit is contained in:
parent
b1bb6841c9
commit
f3209e1aec
|
|
@ -9,7 +9,7 @@
|
||||||
* @param menu
|
* @param menu
|
||||||
* @param position selected position in menu being pushed
|
* @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;
|
if (m_index >= max_depth) return;
|
||||||
m_stack[m_index].menu = menu;
|
m_stack[m_index].menu = menu;
|
||||||
|
|
|
||||||
|
|
@ -19,10 +19,10 @@ public:
|
||||||
struct Record
|
struct Record
|
||||||
{
|
{
|
||||||
menuFunc_t menu;
|
menuFunc_t menu;
|
||||||
uint8_t position;
|
int8_t position;
|
||||||
};
|
};
|
||||||
MenuStack():m_stack(),m_index(0) {}
|
MenuStack():m_stack(),m_index(0) {}
|
||||||
void push(menuFunc_t menu, uint8_t position);
|
void push(menuFunc_t menu, int8_t position);
|
||||||
Record pop();
|
Record pop();
|
||||||
void reset(){m_index = 0;}
|
void reset(){m_index = 0;}
|
||||||
private:
|
private:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue