Updated nano_hosted library.

Signed-off-by: Yilin Sun <imi415@imi.moe>
This commit is contained in:
Yilin Sun 2023-01-02 03:19:20 +08:00
parent c6fd76fe64
commit 38f946d99d
Signed by: imi415
GPG Key ID: 17F01E106F9F5E0A
7 changed files with 7 additions and 84 deletions

View File

@ -2,7 +2,7 @@ BasedOnStyle: Google
IndentWidth: 4
AlignConsecutiveMacros: AcrossEmptyLines
AlignConsecutiveDeclarations: Consecutive
AlignConsecutiveAssignments: AcrossEmptyLinesAndComments
AlignConsecutiveAssignments: Consecutive
AllowShortFunctionsOnASingleLine: None
BreakBeforeBraces: Custom
BraceWrapping:

3
.gitmodules vendored
View File

@ -4,3 +4,6 @@
[submodule "lib/freertos"]
path = lib/freertos
url = https://github.com/FreeRTOS/FreeRTOS-Kernel.git
[submodule "lib/esp_nano_hosted"]
path = lib/esp_nano_hosted
url = https://git.minori.work/Embedded_Drivers/esp_nano_hosted.git

View File

@ -87,7 +87,7 @@ set(TARGET_C_INCLUDES
# Shared libraries linked with application
set(TARGET_LIBS
"c"
"esp_hosted"
"esp_nano_hosted"
"freertos_kernel"
"fro_calib_hardabi"
"m"
@ -118,8 +118,7 @@ set(CMAKE_ASM_FLAGS "${CMAKE_C_FLAGS} -x assembler-with-cpp")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gc-sections")
# Submodules
set(ESP_HOSTED_PORT_INCLUDES "${CMAKE_SOURCE_DIR}/lib/esp_hosted/nxp/include" CACHE STRING "")
add_subdirectory(lib/esp_hosted)
add_subdirectory(lib/esp_nano_hosted)
add_library(freertos_config INTERFACE)
target_include_directories(freertos_config SYSTEM INTERFACE include)

View File

@ -1,35 +0,0 @@
cmake_minimum_required(VERSION 3.10)
project(esp_hosted)
if(NOT DEFINED ESP_HOSTED_PORT_INCLUDES)
message(FATAL_ERROR "Variable ESP_HOSTED_PORT_INCLUDES is not defined.")
endif()
set(ESP_HOSTED_SOURCES
"hosted/esp_hosted_fg/common/protobuf-c/protobuf-c/protobuf-c.c"
"hosted/esp_hosted_fg/common/esp_hosted_config.pb-c.c"
"hosted/esp_hosted_fg/host/components/src/esp_queue.c"
"hosted/esp_hosted_fg/host/control_lib/src/ctrl_api.c"
"hosted/esp_hosted_fg/host/control_lib/src/ctrl_core.c"
"hosted/esp_hosted_fg/host/virtual_serial_if/src/serial_if.c"
)
set(ESP_HOSTED_INCLUDES
"hosted/esp_hosted_fg/common/include"
"hosted/esp_hosted_fg/common/protobuf-c"
"hosted/esp_hosted_fg/host/control_lib/include"
"hosted/esp_hosted_fg/host/components/include"
"hosted/esp_hosted_fg/host/control_lib/src/include"
"hosted/esp_hosted_fg/host/virtual_serial_if/include"
${ESP_HOSTED_PORT_INCLUDES}
)
set(ESP_HOSTED_INCLUDES_PRIVATE
)
add_library(${PROJECT_NAME} ${ESP_HOSTED_SOURCES})
target_include_directories(${PROJECT_NAME}
PUBLIC ${ESP_HOSTED_INCLUDES}
PRIVATE ${ESP_HOSTED_INCLUDES_PRIVATE}
)

View File

@ -1,6 +0,0 @@
#ifndef ESP_HOSTED_NXP_COMMON_H
#define ESP_HOSTED_NXP_COMMON_H
int min(int x, int y);
#endif /* ESP_HOSTED_NXP_COMMON_H */

View File

@ -1,39 +0,0 @@
#ifndef ESP_HOSTED_NXP_PLATFORM_WRAPPER_H
#define ESP_HOSTED_NXP_PLATFORM_WRAPPER_H
#include <stdlib.h>
#define MCU_SYS 1
#define CTRL__TIMER_ONESHOT (0)
#define HOSTED_SEM_BLOCKING (-1)
#define mem_free free
#define hosted_malloc malloc
#define hosted_calloc calloc
#define hosted_free free
int control_path_platform_init(void);
int control_path_platform_deinit(void);
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);
unsigned int msleep(unsigned int mseconds);
unsigned int sleep(unsigned int seconds);
void *serial_drv_open(const char *transport);
int serial_drv_write(void *handle, uint8_t *buf, int in_count, int *out_count);
uint8_t *serial_drv_read(void *handle, uint32_t *out_nbyte);
int serial_drv_close(void *handle);
#endif /* ESP_HOSTED_NXP_PLATFORM_WRAPPER_H */

1
lib/esp_nano_hosted Submodule

@ -0,0 +1 @@
Subproject commit 53509e30ba91f2befe7fae439f2f830dd2da3aad