Programmable Clock with RTOS 0.0.1
Implementaiton of a programmable clock using RTOS with STM32GO microcontroller.
|
Enabling of queues and tasks with static memory. Develop the heart beat task. More...
Macros | |
#define | TASK_STACK_SIZE 128u |
Save the buffer dimentions. | |
#define | QUEUE_LENGTH_SERIAL 9 |
#define | ITEM_SIZE_SERIAL sizeof( NEW_MsgTypeDef ) |
#define | QUEUE_LENGTH_CLOCK 45 |
#define | ITEM_SIZE_CLOCK sizeof( APP_MsgTypeDef ) |
#define | QUEUE_LENGTH_DISPLAY 90 |
#define | ITEM_SIZE_DISPLAY sizeof( APP_MsgTypeDef ) |
#define | HEARTBEAT_PERIODICITY 300u |
#define | TIMER_HEART_ID (void *)(uint32_t)2 |
#define | SERIAL_PERIODICITY (void *)(uint32_t)10 |
#define | CLOCK_PERIODICITY (void *)(uint32_t)50 |
#define | DISPLAY_PERIODICITY (void *)(uint32_t)100 |
#define | SERIAL_PRIORITY 3u |
#define | CLOCK_PRIORITY 2u |
#define | DISPLAY_PRIORITY 1u |
Functions | |
static void | Task_10ms (void *parameters) |
Task 10ms Developing serial event machine tasks every 10 ms. | |
static void | Task_50ms (void *parameters) |
Task 50ms Developing clock event machine tasks every 50 ms. | |
static void | Task_100ms (void *parameters) |
Task 100ms Developing display event machine tasks every 100 ms. | |
static void | heart_Init (void) |
Init the port C(LEDS). Inicialization of leds, Led0. | |
static void | heart_beat (void) |
Heart beat GPIO_PIN_0 ON, when the time is equal or greater that 300ms. | |
static void | vTimerCallback (TimerHandle_t pxTimer) |
Call back timer. | |
int | main (void) |
The initial function, code development. Initializing the task of each event machine (serial, clock and display) and initializing the queues with static memory. | |
void | vApplicationGetIdleTaskMemory (StaticTask_t **ppxIdleTaskTCBBuffer, StackType_t **ppxIdleTaskStackBuffer, uint32_t *pulIdleTaskStackSize) |
configSUPPORT_STATIC_ALLOCATION Function to add necessary quantity of static memory for each task. | |
void | vApplicationGetTimerTaskMemory (StaticTask_t **ppxTimerTaskTCBBuffer, StackType_t **ppxTimerTaskStackBuffer, uint32_t *pulTimerTaskStackSize) |
vApplicationGetTimerTaskMemory Provide the memory that is used by the Timer service task. | |
Enabling of queues and tasks with static memory. Develop the heart beat task.
int main | ( | void | ) |
The initial function, code development. Initializing the task of each event machine (serial, clock and display) and initializing the queues with static memory.
Returns | an integer |
< Maximum number of items
< The size, in bytes, required to hold each item in the queue.
< Maximum number of items
< The size, in bytes, required to hold each item in the queue.
< Maximum number of items
< The size, in bytes, required to hold each item in the queue.
< Maximum number of items
< The size, in bytes, required to hold each item in the queue.
< Maximum number of items
< The size, in bytes, required to hold each item in the queue.
< Maximum number of items
< The size, in bytes, required to hold each item in the queue.
< Serial's task periodicity
< Serial's task priority
< Clock's task periodicity
< Clock's task priority
< Display's task periodicity
< Display's task priority
< Periodicity of heart beat task
< ID for timer used to HEART BEAT
|
static |
Task 100ms Developing display event machine tasks every 100 ms.
[in] | parameters | Periodicity value. |
|
static |
Task 10ms Developing serial event machine tasks every 10 ms.
[in] | parameters | Periodicity value. |
|
static |
Task 50ms Developing clock event machine tasks every 50 ms.
[in] | parameters | Periodicity value. |
void vApplicationGetIdleTaskMemory | ( | StaticTask_t ** | ppxIdleTaskTCBBuffer, |
StackType_t ** | ppxIdleTaskStackBuffer, | ||
uint32_t * | pulIdleTaskStackSize ) |
configSUPPORT_STATIC_ALLOCATION Function to add necessary quantity of static memory for each task.
[in] | ppxIdleTaskTCBBuffer | Pass out a pointer to the StaticTask_t structure. |
[in] | ppxIdleTaskStackBuffer | Pass out the array that will be used. |
[in] | pulIdleTaskStackSize | Pass out the size of the array. |
void vApplicationGetTimerTaskMemory | ( | StaticTask_t ** | ppxTimerTaskTCBBuffer, |
StackType_t ** | ppxTimerTaskStackBuffer, | ||
uint32_t * | pulTimerTaskStackSize ) |
vApplicationGetTimerTaskMemory Provide the memory that is used by the Timer service task.
[in] | ppxTimerTaskTCBBuffer | Pass out a pointer to the StaticTask_t structure. |
[in] | ppxTimerTaskStackBuffer | Pass out the array that will be used. |
[in] | pulTimerTaskStackSize | Pass out the size of the array. |
|
static |
Call back timer.
[in] | pxTimer |