foxBMS - Unit Tests  1.2.1
The foxBMS Unit Tests API Documentation
test_ftask_freertos.c File Reference

Test of the ftask implementation for FreeRTOS. More...

#include "unity.h"
#include "Mockftask_cfg.h"
#include "Mockmpu_prototypes.h"
#include "Mockos.h"
#include "Mocksys_mon.h"
#include "ftask.h"
Include dependency graph for test_ftask_freertos.c:

Go to the source code of this file.

Functions

void helperCreateStatic (const char *pTaskName, TaskHandle_t handleToBeReturned)
 
void setUp (void)
 
void tearDown (void)
 
void testFTSK_CreateTasks (void)
 

Variables

OS_TASK_DEFINITION_s ftsk_taskDefinitionEngine
 Task configuration of the engine task. More...
 
OS_TASK_DEFINITION_s ftsk_taskDefinitionCyclic1ms
 Task configuration of the cyclic 1 ms task. More...
 
OS_TASK_DEFINITION_s ftsk_taskDefinitionCyclic10ms
 Task configuration of the cyclic 10 ms task. More...
 
OS_TASK_DEFINITION_s ftsk_taskDefinitionCyclic100ms
 Task configuration of the cyclic 100 ms task. More...
 
OS_TASK_DEFINITION_s ftsk_taskDefinitionCyclicAlgorithm100ms
 Task configuration of the cyclic 100 ms task for algorithms. More...
 
volatile OS_BOOT_STATE_e os_boot = OS_OFF
 
uint32_t os_schedulerStartTime = 0u
 Scheduler "zero" time for task phase control. More...
 

Detailed Description

Test of the ftask implementation for FreeRTOS.

SPDX-License-Identifier: BSD-3-Clause

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

We kindly request you to use one or more of the following phrases to refer to foxBMS in your hardware, software, documentation or advertising materials:

  • ″This product uses parts of foxBMS®″
  • ″This product includes parts of foxBMS®″
  • ″This product is derived from foxBMS®″
Author
foxBMS Team
Date
2021-11-26 (date of creation)
Updated
2021-12-01 (date of last update)
Prefix
TEST

Definition in file test_ftask_freertos.c.

Function Documentation

◆ helperCreateStatic()

void helperCreateStatic ( const char *  pTaskName,
TaskHandle_t  handleToBeReturned 
)

helper function that sets up everything for the test in testFTSK_CreateTasks()

Definition at line 103 of file test_ftask_freertos.c.

◆ setUp()

void setUp ( void  )

Definition at line 114 of file test_ftask_freertos.c.

◆ tearDown()

void tearDown ( void  )

Definition at line 117 of file test_ftask_freertos.c.

◆ testFTSK_CreateTasks()

void testFTSK_CreateTasks ( void  )

test correct task creation

Definition at line 122 of file test_ftask_freertos.c.

Here is the call graph for this function:

Variable Documentation

◆ ftsk_taskDefinitionCyclic100ms

OS_TASK_DEFINITION_s ftsk_taskDefinitionCyclic100ms
Initial value:
= {
#define FTSK_TASK_CYCLIC_100MS_STACK_SIZE
Stack size of cyclic 100 ms task.
Definition: ftask_cfg.h:109
#define FTSK_TASK_CYCLIC_100MS_PV_PARAMETERS
pvParameters of the 100ms task
Definition: ftask_cfg.h:121
#define FTSK_TASK_CYCLIC_100MS_CYCLE_TIME
Cycle time of 100ms task.
Definition: ftask_cfg.h:115
#define FTSK_TASK_CYCLIC_100MS_PHASE
Phase of cyclic 100 ms task.
Definition: ftask_cfg.h:112
@ OS_PRIORITY_ABOVE_NORMAL
Definition: os.h:90

Task configuration of the cyclic 100 ms task.

Cyclic 100 ms task

Definition at line 84 of file test_ftask_freertos.c.

◆ ftsk_taskDefinitionCyclic10ms

OS_TASK_DEFINITION_s ftsk_taskDefinitionCyclic10ms
Initial value:
= {
#define FTSK_TASK_CYCLIC_10MS_PV_PARAMETERS
pvParameters of the 10ms task
Definition: ftask_cfg.h:106
#define FTSK_TASK_CYCLIC_10MS_CYCLE_TIME
Cycle time of 10 ms task.
Definition: ftask_cfg.h:100
#define FTSK_TASK_CYCLIC_10MS_STACK_SIZE
Stack size of cyclic 10 ms task.
Definition: ftask_cfg.h:94
#define FTSK_TASK_CYCLIC_10MS_PHASE
Phase of cyclic 10 ms task.
Definition: ftask_cfg.h:97
@ OS_PRIORITY_HIGH
Definition: os.h:91

Task configuration of the cyclic 10 ms task.

Cyclic 10 ms task

Definition at line 78 of file test_ftask_freertos.c.

◆ ftsk_taskDefinitionCyclic1ms

OS_TASK_DEFINITION_s ftsk_taskDefinitionCyclic1ms
Initial value:
= {
#define FTSK_TASK_CYCLIC_1MS_CYCLE_TIME
Cycle time of 1ms task.
Definition: ftask_cfg.h:85
#define FTSK_TASK_CYCLIC_1MS_STACK_SIZE
Stack size of cyclic 1 ms task.
Definition: ftask_cfg.h:79
#define FTSK_TASK_CYCLIC_1MS_PV_PARAMETERS
pvParameters of the 1ms task
Definition: ftask_cfg.h:91
#define FTSK_TASK_CYCLIC_1MS_PHASE
Phase of cyclic 1ms task.
Definition: ftask_cfg.h:82
@ OS_PRIORITY_ABOVE_HIGH
Definition: os.h:92

Task configuration of the cyclic 1 ms task.

Cyclic 1 ms task

Definition at line 72 of file test_ftask_freertos.c.

◆ ftsk_taskDefinitionCyclicAlgorithm100ms

OS_TASK_DEFINITION_s ftsk_taskDefinitionCyclicAlgorithm100ms
Initial value:
= {
#define FTSK_TASK_CYCLIC_ALGORITHM_100MS_CYCLE_TIME
Cycle time of 100ms task for algorithms.
Definition: ftask_cfg.h:130
#define FTSK_TASK_CYCLIC_ALGORITHM_100MS_STACKSIZE
Stack size of cyclic 100 ms task for algorithms.
Definition: ftask_cfg.h:124
#define FTSK_TASK_CYCLIC_ALGORITHM_100MS_PV_PARAMETERS
pvParameters of the 100ms task for algorithms
Definition: ftask_cfg.h:136
#define FTSK_TASK_CYCLIC_ALGORITHM_100MS_PHASE
Phase of cyclic 100 ms task for algorithms.
Definition: ftask_cfg.h:127
@ OS_PRIORITY_NORMAL
Definition: os.h:89

Task configuration of the cyclic 100 ms task for algorithms.

Cyclic 100 ms task for algorithms

Definition at line 90 of file test_ftask_freertos.c.

◆ ftsk_taskDefinitionEngine

OS_TASK_DEFINITION_s ftsk_taskDefinitionEngine
Initial value:
= {
#define FTSK_TASK_ENGINE_STACK_SIZE
Stack size of engine task.
Definition: ftask_cfg.h:64
#define FTSK_TASK_ENGINE_CYCLE_TIME
Cycle time of engine task.
Definition: ftask_cfg.h:70
#define FTSK_TASK_ENGINE_PV_PARAMETERS
pvParameters of the engine task
Definition: ftask_cfg.h:76
#define FTSK_TASK_ENGINE_PHASE
Phase of engine task.
Definition: ftask_cfg.h:67
@ OS_PRIORITY_REAL_TIME
Definition: os.h:95

Task configuration of the engine task.

Task for database and system monitoring

Task configuration of the engine task.

Task is not delayed after the scheduler starts. This task must have the highest priority.

Warning
Do not change the configuration of this task. This will very likely break the system.

Definition at line 66 of file test_ftask_freertos.c.

◆ os_boot

volatile OS_BOOT_STATE_e os_boot = OS_OFF

boot state of the OS

Definition at line 98 of file test_ftask_freertos.c.

◆ os_schedulerStartTime

uint32_t os_schedulerStartTime = 0u

Scheduler "zero" time for task phase control.

timestamp of the scheduler start

Definition at line 100 of file test_ftask_freertos.c.