aboutsummaryrefslogtreecommitdiff
path: root/robot/modes.h
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2022-05-26 15:20:55 +0200
committerlonkaars <loek@pipeframe.xyz>2022-05-26 15:20:55 +0200
commit1913a240aab3a2ad72d477aa6fff840afdcad7a3 (patch)
treefb5e1493726ce6dddc3c812aa9730e4a856dabd3 /robot/modes.h
parent9c1f3dcc98b639e3bbcb6a8e199d8f1aa4bcc42a (diff)
implement mode history
Diffstat (limited to 'robot/modes.h')
-rw-r--r--robot/modes.h11
1 files changed, 6 insertions, 5 deletions
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);