diff --git a/CMakeLists.txt b/CMakeLists.txt index 2cbb4d8..216a189 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,8 +6,8 @@ enable_language(CXX) enable_language(ASM) # Different linker scripts -set(TARGET_LDSCRIPT_FLASH "${CMAKE_SOURCE_DIR}/SDK/devices/LPC55S69/gcc/LPC55S69_cm33_core0_flash.ld") -set(TARGET_LDSCRIPT_RAM "${CMAKE_SOURCE_DIR}/SDK/devices/LPC55S69/gcc/LPC55S69_cm33_core0_ram.ld") +set(TARGET_LDSCRIPT_FLASH "${CMAKE_SOURCE_DIR}/app_flash.ld") +set(TARGET_LDSCRIPT_RAM "${CMAKE_SOURCE_DIR}/app_ram.ld") set(TARGET_SOURCES "SDK/components/serial_manager/fsl_component_serial_manager.c" diff --git a/app_flash.ld b/app_flash.ld new file mode 100644 index 0000000..75a4bb1 --- /dev/null +++ b/app_flash.ld @@ -0,0 +1,3 @@ +__heap_size__ = 0x8000; + +INCLUDE "LPC55S69_cm33_core0_flash.ld" diff --git a/app_ram.ld b/app_ram.ld new file mode 100644 index 0000000..34b5034 --- /dev/null +++ b/app_ram.ld @@ -0,0 +1,3 @@ +__heap_size__ = 0x4000; + +INCLUDE "LPC55S69_cm33_core0_ram.ld" diff --git a/lib/esp_hosted/nxp/include/common.h b/lib/esp_hosted/nxp/include/common.h index ff69f67..3a1f4fe 100644 --- a/lib/esp_hosted/nxp/include/common.h +++ b/lib/esp_hosted/nxp/include/common.h @@ -3,4 +3,4 @@ int min(int x, int y); -#endif /* ESP_HOSTED_NXP_COMMON_H */ \ No newline at end of file +#endif /* ESP_HOSTED_NXP_COMMON_H */ diff --git a/lib/esp_hosted/nxp/include/platform_wrapper.h b/lib/esp_hosted/nxp/include/platform_wrapper.h index 7a5ae98..8ee7895 100644 --- a/lib/esp_hosted/nxp/include/platform_wrapper.h +++ b/lib/esp_hosted/nxp/include/platform_wrapper.h @@ -1,5 +1,7 @@ -#ifndef PLATFORM_WRAPPER_H -#define PLATFORM_WRAPPER_H +#ifndef ESP_HOSTED_NXP_PLATFORM_WRAPPER_H +#define ESP_HOSTED_NXP_PLATFORM_WRAPPER_H + +#include #define MCU_SYS 1 @@ -7,10 +9,23 @@ #define HOSTED_SEM_BLOCKING (-1) -#define mem_free(x) hosted_free(x) +#define mem_free free +#define hosted_malloc malloc +#define hosted_calloc calloc +#define hosted_free free -void* hosted_malloc(size_t size); -void* hosted_calloc(size_t blk_no, size_t size); -void hosted_free(void* ptr); +int control_path_platform_init(void); +int control_path_platform_deinit(void); -#endif \ No newline at end of file +void *hosted_thread_create(void (*start_routine)(void const *), void *arg); +int hosted_thread_cancel(void *thread_handle); + +void *hosted_create_semaphore(int init_value); +int hosted_get_semaphore(void *semaphore_handle, int timeout); +int hosted_post_semaphore(void *semaphore_handle); +int hosted_destroy_semaphore(void *semaphore_handle); + +void *hosted_timer_start(int duration, int type, void (*timeout_handler)(void const *), void *arg); +int hosted_timer_stop(void *timer_handle); + +#endif /* ESP_HOSTED_NXP_PLATFORM_WRAPPER_H */