foxBMS  1.4.0
The foxBMS Battery Management System API Documentation
ftask_cfg.h File Reference

Task configuration header. More...

#include "general.h"
#include "os.h"
Include dependency graph for ftask_cfg.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define FTSK_TASK_ENGINE_STACK_SIZE_IN_BYTES   (1024u)
 Stack size of engine task. More...
 
#define FTSK_TASK_ENGINE_PRIORITY   (OS_PRIORITY_REAL_TIME)
 Phase of engine task. More...
 
#define FTSK_TASK_ENGINE_PHASE   (0u)
 Phase of engine task. More...
 
#define FTSK_TASK_ENGINE_CYCLE_TIME   (1u)
 Cycle time of engine task. More...
 
#define FTSK_TASK_ENGINE_MAXIMUM_JITTER   (1u)
 Maximum allowed jitter of engine task. More...
 
#define FTSK_TASK_ENGINE_PV_PARAMETERS   (NULL_PTR)
 pvParameters of the engine task More...
 
#define FTSK_TASK_CYCLIC_1MS_STACK_SIZE_IN_BYTES   (1024u)
 Stack size of cyclic 1 ms task. More...
 
#define FTSK_TASK_CYCLIC_1MS_PRIORITY   (OS_PRIORITY_ABOVE_HIGH)
 Priority of cyclic 1ms task. More...
 
#define FTSK_TASK_CYCLIC_1MS_PHASE   (0u)
 Phase of cyclic 1ms task. More...
 
#define FTSK_TASK_CYCLIC_1MS_CYCLE_TIME   (1u)
 Cycle time of 1ms task. More...
 
#define FTSK_TASK_CYCLIC_1MS_MAXIMUM_JITTER   (1u)
 Maximum allowed jitter of 1ms task. More...
 
#define FTSK_TASK_CYCLIC_1MS_PV_PARAMETERS   (NULL_PTR)
 pvParameters of the 1ms task More...
 
#define FTSK_TASK_CYCLIC_10MS_STACK_SIZE_IN_BYTES   (5120u)
 Stack size of cyclic 10 ms task. More...
 
#define FTSK_TASK_CYCLIC_10MS_PRIORITY   (OS_PRIORITY_HIGH)
 Priority of cyclic 10 ms task. More...
 
#define FTSK_TASK_CYCLIC_10MS_PHASE   (2u)
 Phase of cyclic 10 ms task. More...
 
#define FTSK_TASK_CYCLIC_10MS_CYCLE_TIME   (10u)
 Cycle time of 10 ms task. More...
 
#define FTSK_TASK_CYCLIC_10MS_MAXIMUM_JITTER   (2u)
 Maximum allowed jitter of 10ms task. More...
 
#define FTSK_TASK_CYCLIC_10MS_PV_PARAMETERS   (NULL_PTR)
 pvParameters of the 10ms task More...
 
#define FTSK_TASK_CYCLIC_100MS_STACK_SIZE_IN_BYTES   (1024u)
 Stack size of cyclic 100 ms task. More...
 
#define FTSK_TASK_CYCLIC_100MS_PRIORITY   (OS_PRIORITY_ABOVE_NORMAL)
 Priority of cyclic 100 ms task. More...
 
#define FTSK_TASK_CYCLIC_100MS_PHASE   (56u)
 Phase of cyclic 100 ms task. More...
 
#define FTSK_TASK_CYCLIC_100MS_CYCLE_TIME   (100u)
 Cycle time of 100ms task. More...
 
#define FTSK_TASK_CYCLIC_100MS_MAXIMUM_JITTER   (5u)
 Maximum allowed jitter of 100ms task. More...
 
#define FTSK_TASK_CYCLIC_100MS_PV_PARAMETERS   (NULL_PTR)
 pvParameters of the 100ms task More...
 
#define FTSK_TASK_CYCLIC_ALGORITHM_100MS_STACK_SIZE_IN_BYTES   (1024u)
 Stack size of cyclic 100 ms task for algorithms. More...
 
#define FTSK_TASK_CYCLIC_ALGORITHM_100MS_PRIORITY   (OS_PRIORITY_NORMAL)
 Priority of cyclic 100 ms task for algorithms. More...
 
#define FTSK_TASK_CYCLIC_ALGORITHM_100MS_PHASE   (64u)
 Phase of cyclic 100 ms task for algorithms. More...
 
#define FTSK_TASK_CYCLIC_ALGORITHM_100MS_CYCLE_TIME   (100u)
 Cycle time of 100ms task for algorithms. More...
 
#define FTSK_TASK_CYCLIC_ALGORITHM_100MS_MAXIMUM_JITTER   (5u)
 Maximum allowed jitter of 100ms task for algorithms. More...
 
#define FTSK_TASK_CYCLIC_ALGORITHM_100MS_PV_PARAMETERS   (NULL_PTR)
 pvParameters of the 100ms task for algorithms
More...
 
#define FTSK_TASK_AFE_STACK_SIZE_IN_BYTES   (2048u / 4u)
 Stack size of continuously running task for AFEs. More...
 
#define FTSK_TASK_AFE_PRIORITY   (OS_PRIORITY_ABOVE_HIGH)
 Priority of continuously running task for AFEs. More...
 
#define FTSK_TASK_AFE_PHASE   (0u)
 Phase of continuously running task for AFEs. More...
 
#define FTSK_TASK_AFE_CYCLE_TIME   (0u)
 Cycle time of continuously running task for AFEs. More...
 
#define FTSK_TASK_AFE_MAXIMUM_JITTER   (5u)
 Maximum allowed jitter of continuously running task for AFEs. More...
 
#define FTSK_TASK_AFE_PV_PARAMETERS   (NULL_PTR)
 pvParameters of the continuously running task for AFEs
More...
 

Functions

void FTSK_InitializeUserCodeEngine (void)
 Initializes the database. More...
 
void FTSK_RunUserCodeEngine (void)
 Engine task for the database and the system monitoring module. More...
 
void FTSK_InitializeUserCodePreCyclicTasks (void)
 Initialization function before all tasks started. More...
 
void FTSK_RunUserCodeCyclic1ms (void)
 Cyclic 1 ms task. More...
 
void FTSK_RunUserCodeCyclic10ms (void)
 Cyclic 10 ms task. More...
 
void FTSK_RunUserCodeCyclic100ms (void)
 Cyclic 100 ms task. More...
 
void FTSK_RunUserCodeCyclicAlgorithm100ms (void)
 Cyclic 100 ms task for algorithms. More...
 
void FTSK_RunUserCodeAfe (void)
 Continuously running task for AFEs. More...
 
void FTSK_RunUserCodeIdle (void)
 Idle task. More...
 

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...
 
OS_TASK_DEFINITION_s ftsk_taskDefinitionAfe
 Task configuration of the continuously running task for AFEs. More...
 
TaskHandle_t ftsk_taskHandleAfe
 Definition of task handles. More...
 

Detailed Description

Task configuration header.

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
2019-08-26 (date of creation)
Updated
2022-07-28 (date of last update)
Version
v1.4.0
Prefix
FTSK

TODO

Definition in file ftask_cfg.h.

Macro Definition Documentation

◆ FTSK_TASK_AFE_CYCLE_TIME

#define FTSK_TASK_AFE_CYCLE_TIME   (0u)

Cycle time of continuously running task for AFEs.

Definition at line 164 of file ftask_cfg.h.

◆ FTSK_TASK_AFE_MAXIMUM_JITTER

#define FTSK_TASK_AFE_MAXIMUM_JITTER   (5u)

Maximum allowed jitter of continuously running task for AFEs.

Definition at line 167 of file ftask_cfg.h.

◆ FTSK_TASK_AFE_PHASE

#define FTSK_TASK_AFE_PHASE   (0u)

Phase of continuously running task for AFEs.

Definition at line 161 of file ftask_cfg.h.

◆ FTSK_TASK_AFE_PRIORITY

#define FTSK_TASK_AFE_PRIORITY   (OS_PRIORITY_ABOVE_HIGH)

Priority of continuously running task for AFEs.

Definition at line 158 of file ftask_cfg.h.

◆ FTSK_TASK_AFE_PV_PARAMETERS

#define FTSK_TASK_AFE_PV_PARAMETERS   (NULL_PTR)

pvParameters of the continuously running task for AFEs

Definition at line 170 of file ftask_cfg.h.

◆ FTSK_TASK_AFE_STACK_SIZE_IN_BYTES

#define FTSK_TASK_AFE_STACK_SIZE_IN_BYTES   (2048u / 4u)

Stack size of continuously running task for AFEs.

Definition at line 155 of file ftask_cfg.h.

◆ FTSK_TASK_CYCLIC_100MS_CYCLE_TIME

#define FTSK_TASK_CYCLIC_100MS_CYCLE_TIME   (100u)

Cycle time of 100ms task.

Definition at line 128 of file ftask_cfg.h.

◆ FTSK_TASK_CYCLIC_100MS_MAXIMUM_JITTER

#define FTSK_TASK_CYCLIC_100MS_MAXIMUM_JITTER   (5u)

Maximum allowed jitter of 100ms task.

Definition at line 131 of file ftask_cfg.h.

◆ FTSK_TASK_CYCLIC_100MS_PHASE

#define FTSK_TASK_CYCLIC_100MS_PHASE   (56u)

Phase of cyclic 100 ms task.

Definition at line 125 of file ftask_cfg.h.

◆ FTSK_TASK_CYCLIC_100MS_PRIORITY

#define FTSK_TASK_CYCLIC_100MS_PRIORITY   (OS_PRIORITY_ABOVE_NORMAL)

Priority of cyclic 100 ms task.

Definition at line 122 of file ftask_cfg.h.

◆ FTSK_TASK_CYCLIC_100MS_PV_PARAMETERS

#define FTSK_TASK_CYCLIC_100MS_PV_PARAMETERS   (NULL_PTR)

pvParameters of the 100ms task

Definition at line 134 of file ftask_cfg.h.

◆ FTSK_TASK_CYCLIC_100MS_STACK_SIZE_IN_BYTES

#define FTSK_TASK_CYCLIC_100MS_STACK_SIZE_IN_BYTES   (1024u)

Stack size of cyclic 100 ms task.

Definition at line 119 of file ftask_cfg.h.

◆ FTSK_TASK_CYCLIC_10MS_CYCLE_TIME

#define FTSK_TASK_CYCLIC_10MS_CYCLE_TIME   (10u)

Cycle time of 10 ms task.

Definition at line 110 of file ftask_cfg.h.

◆ FTSK_TASK_CYCLIC_10MS_MAXIMUM_JITTER

#define FTSK_TASK_CYCLIC_10MS_MAXIMUM_JITTER   (2u)

Maximum allowed jitter of 10ms task.

Definition at line 113 of file ftask_cfg.h.

◆ FTSK_TASK_CYCLIC_10MS_PHASE

#define FTSK_TASK_CYCLIC_10MS_PHASE   (2u)

Phase of cyclic 10 ms task.

Definition at line 107 of file ftask_cfg.h.

◆ FTSK_TASK_CYCLIC_10MS_PRIORITY

#define FTSK_TASK_CYCLIC_10MS_PRIORITY   (OS_PRIORITY_HIGH)

Priority of cyclic 10 ms task.

Definition at line 104 of file ftask_cfg.h.

◆ FTSK_TASK_CYCLIC_10MS_PV_PARAMETERS

#define FTSK_TASK_CYCLIC_10MS_PV_PARAMETERS   (NULL_PTR)

pvParameters of the 10ms task

Definition at line 116 of file ftask_cfg.h.

◆ FTSK_TASK_CYCLIC_10MS_STACK_SIZE_IN_BYTES

#define FTSK_TASK_CYCLIC_10MS_STACK_SIZE_IN_BYTES   (5120u)

Stack size of cyclic 10 ms task.

Definition at line 101 of file ftask_cfg.h.

◆ FTSK_TASK_CYCLIC_1MS_CYCLE_TIME

#define FTSK_TASK_CYCLIC_1MS_CYCLE_TIME   (1u)

Cycle time of 1ms task.

Definition at line 92 of file ftask_cfg.h.

◆ FTSK_TASK_CYCLIC_1MS_MAXIMUM_JITTER

#define FTSK_TASK_CYCLIC_1MS_MAXIMUM_JITTER   (1u)

Maximum allowed jitter of 1ms task.

Definition at line 95 of file ftask_cfg.h.

◆ FTSK_TASK_CYCLIC_1MS_PHASE

#define FTSK_TASK_CYCLIC_1MS_PHASE   (0u)

Phase of cyclic 1ms task.

Definition at line 89 of file ftask_cfg.h.

◆ FTSK_TASK_CYCLIC_1MS_PRIORITY

#define FTSK_TASK_CYCLIC_1MS_PRIORITY   (OS_PRIORITY_ABOVE_HIGH)

Priority of cyclic 1ms task.

Definition at line 86 of file ftask_cfg.h.

◆ FTSK_TASK_CYCLIC_1MS_PV_PARAMETERS

#define FTSK_TASK_CYCLIC_1MS_PV_PARAMETERS   (NULL_PTR)

pvParameters of the 1ms task

Definition at line 98 of file ftask_cfg.h.

◆ FTSK_TASK_CYCLIC_1MS_STACK_SIZE_IN_BYTES

#define FTSK_TASK_CYCLIC_1MS_STACK_SIZE_IN_BYTES   (1024u)

Stack size of cyclic 1 ms task.

Definition at line 83 of file ftask_cfg.h.

◆ FTSK_TASK_CYCLIC_ALGORITHM_100MS_CYCLE_TIME

#define FTSK_TASK_CYCLIC_ALGORITHM_100MS_CYCLE_TIME   (100u)

Cycle time of 100ms task for algorithms.

Definition at line 146 of file ftask_cfg.h.

◆ FTSK_TASK_CYCLIC_ALGORITHM_100MS_MAXIMUM_JITTER

#define FTSK_TASK_CYCLIC_ALGORITHM_100MS_MAXIMUM_JITTER   (5u)

Maximum allowed jitter of 100ms task for algorithms.

Definition at line 149 of file ftask_cfg.h.

◆ FTSK_TASK_CYCLIC_ALGORITHM_100MS_PHASE

#define FTSK_TASK_CYCLIC_ALGORITHM_100MS_PHASE   (64u)

Phase of cyclic 100 ms task for algorithms.

Definition at line 143 of file ftask_cfg.h.

◆ FTSK_TASK_CYCLIC_ALGORITHM_100MS_PRIORITY

#define FTSK_TASK_CYCLIC_ALGORITHM_100MS_PRIORITY   (OS_PRIORITY_NORMAL)

Priority of cyclic 100 ms task for algorithms.

Definition at line 140 of file ftask_cfg.h.

◆ FTSK_TASK_CYCLIC_ALGORITHM_100MS_PV_PARAMETERS

#define FTSK_TASK_CYCLIC_ALGORITHM_100MS_PV_PARAMETERS   (NULL_PTR)

pvParameters of the 100ms task for algorithms

Definition at line 152 of file ftask_cfg.h.

◆ FTSK_TASK_CYCLIC_ALGORITHM_100MS_STACK_SIZE_IN_BYTES

#define FTSK_TASK_CYCLIC_ALGORITHM_100MS_STACK_SIZE_IN_BYTES   (1024u)

Stack size of cyclic 100 ms task for algorithms.

Definition at line 137 of file ftask_cfg.h.

◆ FTSK_TASK_ENGINE_CYCLE_TIME

#define FTSK_TASK_ENGINE_CYCLE_TIME   (1u)

Cycle time of engine task.

Definition at line 74 of file ftask_cfg.h.

◆ FTSK_TASK_ENGINE_MAXIMUM_JITTER

#define FTSK_TASK_ENGINE_MAXIMUM_JITTER   (1u)

Maximum allowed jitter of engine task.

Definition at line 77 of file ftask_cfg.h.

◆ FTSK_TASK_ENGINE_PHASE

#define FTSK_TASK_ENGINE_PHASE   (0u)

Phase of engine task.

Definition at line 71 of file ftask_cfg.h.

◆ FTSK_TASK_ENGINE_PRIORITY

#define FTSK_TASK_ENGINE_PRIORITY   (OS_PRIORITY_REAL_TIME)

Phase of engine task.

Definition at line 68 of file ftask_cfg.h.

◆ FTSK_TASK_ENGINE_PV_PARAMETERS

#define FTSK_TASK_ENGINE_PV_PARAMETERS   (NULL_PTR)

pvParameters of the engine task

Definition at line 80 of file ftask_cfg.h.

◆ FTSK_TASK_ENGINE_STACK_SIZE_IN_BYTES

#define FTSK_TASK_ENGINE_STACK_SIZE_IN_BYTES   (1024u)

Stack size of engine task.

Definition at line 65 of file ftask_cfg.h.

Function Documentation

◆ FTSK_InitializeUserCodeEngine()

void FTSK_InitializeUserCodeEngine ( void  )

Initializes the database.

Start up after scheduler starts

Warning
Do not change the content of this function. This will very likely break the system. This function is kept in the configuration file to have a uniform task configuration.

Definition at line 148 of file ftask_cfg.c.

Here is the call graph for this function:

◆ FTSK_InitializeUserCodePreCyclicTasks()

void FTSK_InitializeUserCodePreCyclicTasks ( void  )

Initialization function before all tasks started.

This function is called after the scheduler started but before any cyclic task runs. Here modules get initialized that are not used during the startup process.

Definition at line 186 of file ftask_cfg.c.

Here is the call graph for this function:

◆ FTSK_RunUserCodeAfe()

void FTSK_RunUserCodeAfe ( void  )

Continuously running task for AFEs.

Implements the communications with AFEs, without statemachine.

Definition at line 282 of file ftask_cfg.c.

Here is the call graph for this function:

◆ FTSK_RunUserCodeCyclic100ms()

void FTSK_RunUserCodeCyclic100ms ( void  )

Cyclic 100 ms task.

TODO

Perform SOC and SOE calculations only every 1s. Not suited if analog integration of current sensor is NOT used. Manual integration of current requires a higher frequency.

Definition at line 253 of file ftask_cfg.c.

Here is the call graph for this function:

◆ FTSK_RunUserCodeCyclic10ms()

void FTSK_RunUserCodeCyclic10ms ( void  )

Cyclic 10 ms task.

TODO

Definition at line 230 of file ftask_cfg.c.

Here is the call graph for this function:

◆ FTSK_RunUserCodeCyclic1ms()

void FTSK_RunUserCodeCyclic1ms ( void  )

Cyclic 1 ms task.

TODO

Definition at line 218 of file ftask_cfg.c.

Here is the call graph for this function:

◆ FTSK_RunUserCodeCyclicAlgorithm100ms()

void FTSK_RunUserCodeCyclicAlgorithm100ms ( void  )

Cyclic 100 ms task for algorithms.

TODO

Definition at line 273 of file ftask_cfg.c.

Here is the call graph for this function:

◆ FTSK_RunUserCodeEngine()

void FTSK_RunUserCodeEngine ( void  )

Engine task for the database and the system monitoring module.

Start up after scheduler start. First task to be run, all other tasks only starts when this task has started

Warning
Do not change the content of this function. This will very likely break the system. This function is kept in the configuration file to have a uniform task configuration.

Definition at line 177 of file ftask_cfg.c.

Here is the call graph for this function:

◆ FTSK_RunUserCodeIdle()

void FTSK_RunUserCodeIdle ( void  )

Idle task.

Called by vApplicationIdleHook() if configUSE_IDLE_HOOK in FreeRTOSConfig.h is enabled. If you do not need this hook, you can disable it in the FreeRTOS configuration.

Definition at line 289 of file ftask_cfg.c.

Variable Documentation

◆ ftsk_taskDefinitionAfe

OS_TASK_DEFINITION_s ftsk_taskDefinitionAfe
extern

Task configuration of the continuously running task for AFEs.

Continuously running task for AFEs

Definition at line 136 of file ftask_cfg.c.

◆ ftsk_taskDefinitionCyclic100ms

OS_TASK_DEFINITION_s ftsk_taskDefinitionCyclic100ms
extern

Task configuration of the cyclic 100 ms task.

Cyclic 100 ms task

Definition at line 124 of file ftask_cfg.c.

◆ ftsk_taskDefinitionCyclic10ms

OS_TASK_DEFINITION_s ftsk_taskDefinitionCyclic10ms
extern

Task configuration of the cyclic 10 ms task.

Cyclic 10 ms task

Definition at line 118 of file ftask_cfg.c.

◆ ftsk_taskDefinitionCyclic1ms

OS_TASK_DEFINITION_s ftsk_taskDefinitionCyclic1ms
extern

Task configuration of the cyclic 1 ms task.

Cyclic 1 ms task

Definition at line 112 of file ftask_cfg.c.

◆ ftsk_taskDefinitionCyclicAlgorithm100ms

OS_TASK_DEFINITION_s ftsk_taskDefinitionCyclicAlgorithm100ms
extern

Task configuration of the cyclic 100 ms task for algorithms.

Cyclic 100 ms task for algorithms

Definition at line 130 of file ftask_cfg.c.

◆ ftsk_taskDefinitionEngine

OS_TASK_DEFINITION_s ftsk_taskDefinitionEngine
extern

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 106 of file ftask_cfg.c.

◆ ftsk_taskHandleAfe

TaskHandle_t ftsk_taskHandleAfe
extern

Definition of task handles.

Definition of task handles.

Definition at line 94 of file ftask_freertos.c.