From 108ce72e4df31fa770554f3f18cb540454243b40 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Mon, 23 Sep 2019 14:44:03 +0200 Subject: [PATCH] test/embedded: fix compile --- test/embedded/.gitignore | 1 + test/embedded/FreeRTOS.h | 9 +++++++++ test/embedded/event_groups.h | 22 ++++++++++++++++++++++ test/embedded/queue.h | 35 +++++++++++++++++++++++++++++++++++ test/embedded/task.h | 2 ++ 5 files changed, 69 insertions(+) create mode 100644 test/embedded/.gitignore create mode 100644 test/embedded/FreeRTOS.h create mode 100644 test/embedded/event_groups.h create mode 100644 test/embedded/queue.h create mode 100644 test/embedded/task.h diff --git a/test/embedded/.gitignore b/test/embedded/.gitignore new file mode 100644 index 000000000..814490404 --- /dev/null +++ b/test/embedded/.gitignore @@ -0,0 +1 @@ +*_test diff --git a/test/embedded/FreeRTOS.h b/test/embedded/FreeRTOS.h new file mode 100644 index 000000000..756a957e8 --- /dev/null +++ b/test/embedded/FreeRTOS.h @@ -0,0 +1,9 @@ + +#define configSUPPORT_STATIC_ALLOCATION 1 +#define INCLUDE_xEventGroupSetBitFromISR 1 + +// dummy typedefs to make it compile +#define pdTRUE 1 +#define pdFALSE 0 +#define portMAX_DELAY 0xffffffff + diff --git a/test/embedded/event_groups.h b/test/embedded/event_groups.h new file mode 100644 index 000000000..8ee7412b5 --- /dev/null +++ b/test/embedded/event_groups.h @@ -0,0 +1,22 @@ + +typedef int EventGroupHandle_t; +typedef int EventBits_t; +typedef int BaseType_t; +typedef int TickType_t; + +EventGroupHandle_t xEventGroupCreate( void ); + +EventBits_t xEventGroupSetBits( EventGroupHandle_t xEventGroup, + const EventBits_t uxBitsToSet ); + +BaseType_t xEventGroupSetBitsFromISR( + EventGroupHandle_t xEventGroup, + const EventBits_t uxBitsToSet, + BaseType_t *pxHigherPriorityTaskWoken ); + +EventBits_t xEventGroupWaitBits( + const EventGroupHandle_t xEventGroup, + const EventBits_t uxBitsToWaitFor, + const BaseType_t xClearOnExit, + const BaseType_t xWaitForAllBits, + TickType_t xTicksToWait ); diff --git a/test/embedded/queue.h b/test/embedded/queue.h new file mode 100644 index 000000000..52c159856 --- /dev/null +++ b/test/embedded/queue.h @@ -0,0 +1,35 @@ +#include + +typedef int StaticQueue_t; +typedef int QueueHandle_t; +typedef int BaseType_t; +typedef unsigned int UBaseType_t; +typedef int TickType_t; + +#define pdMS_TO_TICKS(ms) ms + +BaseType_t xQueueSendToBack( + QueueHandle_t xQueue, + const void * pvItemToQueue, + TickType_t xTicksToWait + ); + + BaseType_t xQueueSendToBackFromISR + ( + QueueHandle_t xQueue, + const void *pvItemToQueue, + BaseType_t *pxHigherPriorityTaskWoken + ); + +BaseType_t xQueueReceive( + QueueHandle_t xQueue, + void *pvBuffer, + TickType_t xTicksToWait + ); + +QueueHandle_t xQueueCreateStatic( + UBaseType_t uxQueueLength, + UBaseType_t uxItemSize, + uint8_t *pucQueueStorageBuffer, + StaticQueue_t *pxQueueBuffer ); + diff --git a/test/embedded/task.h b/test/embedded/task.h new file mode 100644 index 000000000..66196170e --- /dev/null +++ b/test/embedded/task.h @@ -0,0 +1,2 @@ +typedef int TaskHandle_t; +TaskHandle_t xTaskGetCurrentTaskHandle( void );