From a27a35bd778d9afe9f04e7aed69d950bc4d980e8 Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Mon, 29 Jan 2024 23:58:04 +0100 Subject: WIP ESP32 port --- src/system/CMakeLists.txt | 4 ++++ src/system/esp32/inc/system/port.h | 13 +++++++++++++ src/system/esp32/privinc/system_private.h | 15 +++++++++++++++ src/system/esp32/src/stubs.c | 6 ++++++ src/system/esp32/src/system.c | 25 +++++++++++++++++++++++++ 5 files changed, 63 insertions(+) create mode 100644 src/system/esp32/inc/system/port.h create mode 100644 src/system/esp32/privinc/system_private.h create mode 100644 src/system/esp32/src/stubs.c create mode 100644 src/system/esp32/src/system.c (limited to 'src/system') diff --git a/src/system/CMakeLists.txt b/src/system/CMakeLists.txt index 26a8803..7ddd98c 100644 --- a/src/system/CMakeLists.txt +++ b/src/system/CMakeLists.txt @@ -17,6 +17,10 @@ elseif(SDL1_2_BUILD) else() set(src ${src} "sdl-1.2/src/stubs.c") endif() +elseif(ESP32_BUILD) + set(src "esp32/src/system.c") + set(inc ${inc} "esp32/inc") + set(privinc ${privinc} "esp32/privinc") endif() add_library(system ${src}) diff --git a/src/system/esp32/inc/system/port.h b/src/system/esp32/inc/system/port.h new file mode 100644 index 0000000..6566c31 --- /dev/null +++ b/src/system/esp32/inc/system/port.h @@ -0,0 +1,13 @@ +#ifndef INIT_ESP32_H +#define INIT_ESP32_H + +#ifdef __cplusplus +extern "C" +{ +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* INIT_SDL_H */ diff --git a/src/system/esp32/privinc/system_private.h b/src/system/esp32/privinc/system_private.h new file mode 100644 index 0000000..70ed8c8 --- /dev/null +++ b/src/system/esp32/privinc/system_private.h @@ -0,0 +1,15 @@ +#ifndef SYSTEM_PRIVATE_H +#define SYSTEM_PRIVATE_H + +#ifdef __cplusplus +extern "C" +{ +#endif + +int system_init_os(void); + +#ifdef __cplusplus +} +#endif + +#endif /* SYSTEM_PRIVATE_H */ diff --git a/src/system/esp32/src/stubs.c b/src/system/esp32/src/stubs.c new file mode 100644 index 0000000..c07a790 --- /dev/null +++ b/src/system/esp32/src/stubs.c @@ -0,0 +1,6 @@ +#include + +int system_init_os(void) +{ + return 0; +} diff --git a/src/system/esp32/src/system.c b/src/system/esp32/src/system.c new file mode 100644 index 0000000..6221e2e --- /dev/null +++ b/src/system/esp32/src/system.c @@ -0,0 +1,25 @@ +#include +#include +#include +#include +#include +#include +#include + +bool system_can_exit(void) +{ + return false; +} + +void system_loop(void) +{ +} + +void system_deinit(void) +{ +} + +int system_init(void) +{ + return -1; +} -- cgit v1.2.3