From e24186fc1917c5e8b91924af0c3c7c55816ff5d6 Mon Sep 17 00:00:00 2001 From: Bad Diode Date: Mon, 25 Jan 2021 22:01:00 +0100 Subject: Introducing MIC --- src/app.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 src/app.c (limited to 'src/app.c') diff --git a/src/app.c b/src/app.c new file mode 100644 index 0000000..a39bff0 --- /dev/null +++ b/src/app.c @@ -0,0 +1,44 @@ +#include "app.h" +#include "platform.h" + +static inline bool +app_init(AppState *state, PlatformAPI platform) { + platform.log("INIT"); + state->lt_memory = platform.calloc(LT_MEMORY_SIZE, sizeof(u8)); + state->st_memory = platform.calloc(ST_MEMORY_SIZE, sizeof(u8)); + return true; +} + +static inline void +app_destroy(AppState *state, PlatformAPI platform) { + (void)state; // Unused parameter. + platform.log("DESTROY"); +} + +static inline void +app_reload(AppState *state, PlatformAPI platform) { + (void)state; // Unused parameter. + platform.log("RELOAD"); +} + +static inline void +app_unload(AppState *state, PlatformAPI platform) { + (void)state; // Unused parameter. + platform.log("UNLOAD"); +} + +static inline bool +app_step(AppState *state, PlatformAPI platform) { + (void)state; // Unused parameter. + platform.log("STEP"); + platform.sleep(100000); + return true; +} + +const AppAPI APP_API = { + .init = app_init, + .destroy = app_destroy, + .reload = app_reload, + .step = app_step, + .unload = app_unload, +}; -- cgit v1.2.1