A simple operating system for the ESP32-based M5StickC
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

37 lines
847 B

struct Task
{
int pid = 0;
bool running = false;
int exit_code = 0;
int (*callback)(unsigned int);
unsigned long run_interval = 0;
unsigned long run_accumulator = 0;
unsigned int signal = 0;
unsigned int signal_mask = 0xFFFF;
};
void Kernel_setup();
void Kernel_tick();
// Panic and stop everything
void Kernel_panic(char* message);
// Start a new process
void Kernel_start(int (*callback)(unsigned int), unsigned long interval);
// Continue execution of a process
void Kernel_enable(int pid);
// Pause execution of a process
void Kernel_disable(int pid);
// Clean up exited process
void Kernel_reap(int pid);
// Check if process has exited
bool Kernel_is_exited(int pid);
// Get exit code of process
int Kernel_get_exit_code(int pid);
#define SIGNAL_NONE 0
#define SIGNAL_TICK 1
#define SIGNAL_START 2
#define SIGNAL_STOP 4