Routine infrastructure

This commit is contained in:
Aaron Cook 2025-08-31 22:03:41 -05:00
commit 9f005b547b
11 changed files with 527 additions and 30 deletions

36
core/routine.h Normal file
View file

@ -0,0 +1,36 @@
#ifndef _ROUTINE_H_
#define _ROUTINE_H_
#include <stdbool.h>
#include <stdint.h>
#include "includes/routine.h"
#define ROUTINE_INDEX_NONE (-1)
/**
* @brief Initialize the routine state
*/
void routine_init(void);
/**
* @brief Execute the routine, intended to be called from main. Does not return.
*/
void routine_exec(void);
/**
* @brief Select a new routine to be active
*/
int routine_select(uint8_t index);
/**
* @brief Fill out a buffer with a human readable list of routines
*/
void routine_get_listing(char *buf, uint16_t buf_len);
/**
* @brief Get the index of the current running routine
*/
int8_t routine_get_current(void);
#endif /* _ROUTINE_H_ */