summaryrefslogtreecommitdiff
path: root/robot/modes.h
diff options
context:
space:
mode:
Diffstat (limited to 'robot/modes.h')
-rw-r--r--robot/modes.h35
1 files changed, 8 insertions, 27 deletions
diff --git a/robot/modes.h b/robot/modes.h
index 122be4a..8a53560 100644
--- a/robot/modes.h
+++ b/robot/modes.h
@@ -2,16 +2,16 @@
/** @file modes.h */
+#include <stdint.h>
+
#include "../shared/consts.h"
+#include "../shared/modes.h"
+
+extern w2_e_mode g_w2_mode_history[W2_MODE_HISTORY_BUFFER_SIZE];
+extern uint8_t g_w2_mode_history_index;
-#include "mode_chrg.h"
-#include "mode_dirc.h"
-#include "mode_grid.h"
-#include "mode_halt.h"
-#include "mode_lcal.h"
-#include "mode_maze.h"
-#include "mode_scal.h"
-#include "mode_spin.h"
+/** setup g_w2_modes array */
+void w2_modes_init();
/**
* mode logic
@@ -20,25 +20,6 @@
*/
void w2_modes_main();
-/** mode constants */
-typedef enum {
- W2_M_PREV = -1,
- W2_M_MAZE = 0,
- W2_M_GRID = 1,
- W2_M_HALT = 2,
- W2_M_LCAL = 3,
- W2_M_CHRG = 4,
- W2_M_DIRC = 5,
- W2_M_SPIN = 6,
- W2_M_SCAL = 7,
-} w2_e_mode;
-
-/** array that maps w2_e_mode to mode function pointers */
-static const void(*const W2_MODES[]) = {
- &w2_mode_maze, &w2_mode_grid, &w2_mode_grid, &w2_mode_halt,
- &w2_mode_chrg, &w2_mode_dirc, &w2_mode_spin, &w2_mode_scal,
-};
-
/** 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) */