From 1913a240aab3a2ad72d477aa6fff840afdcad7a3 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Thu, 26 May 2022 15:20:55 +0200 Subject: implement mode history --- robot/modes.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'robot/modes.h') diff --git a/robot/modes.h b/robot/modes.h index a9d96d8..3423a0f 100644 --- a/robot/modes.h +++ b/robot/modes.h @@ -1,5 +1,7 @@ #pragma once +#include "../shared/consts.h" + #include "mode_chrg.h" #include "mode_dirc.h" #include "mode_grid.h" @@ -9,9 +11,6 @@ #include "mode_scal.h" #include "mode_spin.h" -/** function pointer to current mode */ -extern void (*g_w2_current_mode)(); - /** * mode logic * @@ -38,5 +37,7 @@ static const void(*const W2_MODES[]) = { &w2_mode_chrg, &w2_mode_dirc, &w2_mode_spin, &w2_mode_scal, }; -/** switch the current mode */ -void w2_modes_switch(w2_e_mode new_mode); +/** switch current mode (allow switching back to previous mode) */ +void w2_modes_call(w2_e_mode mode); +/** switch current mode (replace current mode keeping history index) */ +void w2_modes_swap(w2_e_mode mode); -- cgit v1.2.3