3.1.8.2.20. waf_tools.bms_config_generate.CreateFoxbmsConfig

class waf_tools.bms_config_generate.CreateFoxbmsConfig(*k, **kw)

Bases: Task

Waf task that generates a foxBMS configuration header file.

For each configured content domain (e.g. "rtos", "current_sensor"), this task invokes the corresponding function from CONFIG_FUNCTIONS to collect #define entries, then renders them into a C header file with an include guard.

system

The validated waf_tools.bms_config_model.System instance providing all configuration values.

Type:

bms_config_model.System

content

List of configuration domain keys to include in this header (e.g., ["rtos"], ["current_sensor"]).

Type:

list[str]

generate_header(defines: list[dict]) → str

Render a list of define dictionaries into a complete C header string.

Produces a header with an include guard derived from the output file name and one #define directive per entry.

Parameters:

defines – List of dictionaries, each containing "name" and "value" keys representing a single preprocessor define.

Returns:

The full header file content as a string.

run() → None

Generate the configuration header from the defined content.

Iterates over content, calls the matching function from CONFIG_FUNCTIONS for each entry, collects all resulting define dictionaries, and writes the rendered header to the output node.

Raises WafError if an unknown content key is encountered.