Skip to content

Commit a8650b9

Browse files
Update example cmake project path (#851)
* fix build on 64 bit platform * moving sample cmake project to a separate root level dir * moving sample cmake project to a separate root level dir * updating paths for the sample cmake project * rename example folder * use configKERNEL_PROVIDED_STATIC_MEMORY * update comments * update comments * rename folder to examples * fix formatting
1 parent fc7aca7 commit a8650b9

File tree

6 files changed

+30
-35
lines changed

6 files changed

+30
-35
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ See the readme file in the ```./portable``` directory for more information.
125125
- The ```./include``` directory contains the real time kernel header files.
126126

127127
- The ```./sample_configuration``` directory contains a sample `FreeRTOSConfig.h` to help jumpstart a new project.
128-
See the [FreeRTOSConfig.h](sample_configuration/FreeRTOSConfig.h) file for instructions.
128+
See the [FreeRTOSConfig.h](examples/sample_configuration/FreeRTOSConfig.h) file for instructions.
129129

130130
### Code Formatting
131131

cmake_example/CMakeLists.txt renamed to examples/cmake_example/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.15)
22

33
project(example)
44

5-
set(FREERTOS_KERNEL_PATH "../")
5+
set(FREERTOS_KERNEL_PATH "../../")
66

77
# Add the freertos_config for FreeRTOS-Kernel
88
add_library(freertos_config INTERFACE)
@@ -13,7 +13,7 @@ target_include_directories(freertos_config
1313
)
1414

1515
# Select the heap port. values between 1-4 will pick a heap.
16-
# set(FREERTOS_HEAP "4" CACHE STRING "" FORCE)
16+
set(FREERTOS_HEAP "4" CACHE STRING "" FORCE)
1717

1818
# Select the native compile PORT
1919
set(FREERTOS_PORT "TEMPLATE" CACHE STRING "" FORCE)

cmake_example/main.c renamed to examples/cmake_example/main.c

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,6 @@
4444
static StaticTask_t exampleTaskTCB;
4545
static StackType_t exampleTaskStack[ configMINIMAL_STACK_SIZE ];
4646

47-
static StaticTask_t xTimerTaskTCB;
48-
static StackType_t uxTimerTaskStack[ configTIMER_TASK_STACK_DEPTH ];
49-
50-
static StaticTask_t xIdleTaskTCB;
51-
static StackType_t uxIdleTaskStack[ configMINIMAL_STACK_SIZE ];
52-
5347
void exampleTask( void * parameters )
5448
{
5549
/* Unused parameters. */
@@ -91,21 +85,3 @@ void vApplicationStackOverflowHook( TaskHandle_t xTask,
9185
( void ) xTask;
9286
( void ) pcTaskName;
9387
}
94-
95-
void vApplicationGetTimerTaskMemory( StaticTask_t ** ppxTimerTaskTCBBuffer,
96-
StackType_t ** ppxTimerTaskStackBuffer,
97-
uint32_t * pulTimerTaskStackSize )
98-
{
99-
*ppxTimerTaskTCBBuffer = &xTimerTaskTCB;
100-
*ppxTimerTaskStackBuffer = uxTimerTaskStack;
101-
*pulTimerTaskStackSize = configTIMER_TASK_STACK_DEPTH;
102-
}
103-
104-
void vApplicationGetIdleTaskMemory( StaticTask_t ** ppxIdleTaskTCBBuffer,
105-
StackType_t ** ppxIdleTaskStackBuffer,
106-
uint32_t * pulIdleTaskStackSize )
107-
{
108-
*ppxIdleTaskTCBBuffer = &xIdleTaskTCB;
109-
*ppxIdleTaskStackBuffer = uxIdleTaskStack;
110-
*pulIdleTaskStackSize = configMINIMAL_STACK_SIZE;
111-
}

sample_configuration/FreeRTOSConfig.h renamed to examples/sample_configuration/FreeRTOSConfig.h

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,21 @@
118118
* human readable name. Includes the NULL terminator. */
119119
#define configMAX_TASK_NAME_LEN 16
120120

121-
/* The tick count is held in a variable of type TickType_t. Set
122-
* configUSE_16_BIT_TICKS to 1 to make TickType_t a 16-bit type. Set
123-
* configUSE_16_BIT_TICKS to 0 to make TickType_t either a 32 or 64-bit type
124-
* depending on the architecture. Using a 16-bit type can greatly improve
125-
* efficiency on 8-bit and 16-bit microcontrollers, but at the cost of limiting the
126-
* maximum specifiable block time to 0xffff. */
127-
#define configUSE_16_BIT_TICKS 0
121+
/* Time is measured in 'ticks' - which is the number of times the tick interrupt
122+
* has executed since the RTOS kernel was started.
123+
* The tick count is held in a variable of type TickType_t.
124+
*
125+
* configTICK_TYPE_WIDTH_IN_BITS controls the type (and therefore bit-width) of TickType_t:
126+
*
127+
* Defining configTICK_TYPE_WIDTH_IN_BITS as TICK_TYPE_WIDTH_16_BITS causes
128+
* TickType_t to be defined (typedef'ed) as an unsigned 16-bit type.
129+
*
130+
* Defining configTICK_TYPE_WIDTH_IN_BITS as TICK_TYPE_WIDTH_32_BITS causes
131+
* TickType_t to be defined (typedef'ed) as an unsigned 32-bit type.
132+
*
133+
* Defining configTICK_TYPE_WIDTH_IN_BITS as TICK_TYPE_WIDTH_64_BITS causes
134+
* TickType_t to be defined (typedef'ed) as an unsigned 64-bit type. */
135+
#define configTICK_TYPE_WIDTH_IN_BITS TICK_TYPE_WIDTH_64_BITS
128136

129137
/* Set configIDLE_SHOULD_YIELD to 1 to have the Idle task yield to an
130138
* application task if there is an Idle priority (priority 0) application task that
@@ -388,7 +396,15 @@
388396

389397
/* secureconfigMAX_SECURE_CONTEXTS define the maximum number of tasks that can
390398
* call into the secure side of an ARMv8-M chip. Not used by any other ports. */
391-
#define secureconfigMAX_SECURE_CONTEXTS 5
399+
#define secureconfigMAX_SECURE_CONTEXTS 5
400+
401+
/* Defines the kernel provided implementation of
402+
* vApplicationGetIdleTaskMemory() and vApplicationGetTimerTaskMemory()
403+
* to provide the memory that is used by the Idle task and Timer task respectively.
404+
* The application can provide it's own implementation of
405+
* vApplicationGetIdleTaskMemory() and vApplicationGetTimerTaskMemory() by
406+
* setting configKERNEL_PROVIDED_STATIC_MEMORY to 0 or leaving it undefined. */
407+
#define configKERNEL_PROVIDED_STATIC_MEMORY 1
392408

393409
/******************************************************************************/
394410
/* Definitions that include or exclude functionality. *************************/
File renamed without changes.

portable/template/portmacro.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ typedef unsigned char UBaseType_t;
3838
#elif ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_32_BITS )
3939
typedef uint32_t TickType_t;
4040
#define portMAX_DELAY ( TickType_t ) 0xffffffffUL
41+
#elif ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_64_BITS )
42+
typedef uint64_t TickType_t;
43+
#define portMAX_DELAY ( TickType_t ) 0xffffffffffffffffULL
4144
#else
4245
#error configTICK_TYPE_WIDTH_IN_BITS set to unsupported tick type width.
4346
#endif

0 commit comments

Comments
 (0)