mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-03 09:49:32 +02:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
4bb3fbd4d3
commit
b85be72e2b
1 changed files with 18 additions and 18 deletions
|
@ -78,18 +78,18 @@ void setup() {
|
|||
init_stored_settings();
|
||||
|
||||
#ifdef WIFI
|
||||
xTaskCreatePinnedToCore((TaskFunction_t)&connectivity_loop, "connectivity_loop", 4096, NULL,
|
||||
TASK_CONNECTIVITY_PRIO, &connectivity_loop_task, WIFI_CORE);
|
||||
xTaskCreatePinnedToCore((TaskFunction_t)&connectivity_loop, "connectivity_loop", 4096, NULL, TASK_CONNECTIVITY_PRIO,
|
||||
&connectivity_loop_task, WIFI_CORE);
|
||||
#endif
|
||||
|
||||
#if defined(LOG_CAN_TO_SD) || defined(LOG_TO_SD)
|
||||
xTaskCreatePinnedToCore((TaskFunction_t)&logging_loop, "logging_loop", 4096, NULL,
|
||||
TASK_CONNECTIVITY_PRIO, &logging_loop_task, WIFI_CORE);
|
||||
xTaskCreatePinnedToCore((TaskFunction_t)&logging_loop, "logging_loop", 4096, NULL, TASK_CONNECTIVITY_PRIO,
|
||||
&logging_loop_task, WIFI_CORE);
|
||||
#endif
|
||||
|
||||
#ifdef MQTT
|
||||
xTaskCreatePinnedToCore((TaskFunction_t)&mqtt_loop, "mqtt_loop", 4096, NULL, TASK_MQTT_PRIO,
|
||||
&mqtt_loop_task, WIFI_CORE);
|
||||
xTaskCreatePinnedToCore((TaskFunction_t)&mqtt_loop, "mqtt_loop", 4096, NULL, TASK_MQTT_PRIO, &mqtt_loop_task,
|
||||
WIFI_CORE);
|
||||
#endif
|
||||
|
||||
init_CAN();
|
||||
|
@ -125,8 +125,8 @@ void setup() {
|
|||
};
|
||||
|
||||
// Start tasks
|
||||
xTaskCreatePinnedToCore((TaskFunction_t)&core_loop, "core_loop", 4096, NULL, TASK_CORE_PRIO,
|
||||
&main_loop_task, CORE_FUNCTION_CORE);
|
||||
xTaskCreatePinnedToCore((TaskFunction_t)&core_loop, "core_loop", 4096, NULL, TASK_CORE_PRIO, &main_loop_task,
|
||||
CORE_FUNCTION_CORE);
|
||||
#ifdef PERIODIC_BMS_RESET_AT
|
||||
bmsResetTimeOffset = getTimeOffsetfromNowUntil(PERIODIC_BMS_RESET_AT);
|
||||
if (bmsResetTimeOffset == 0) {
|
||||
|
@ -229,24 +229,24 @@ void core_loop(void* task_time_us) {
|
|||
// Process
|
||||
if (millis() - previousMillis10ms >= INTERVAL_10_MS) {
|
||||
previousMillis10ms = millis();
|
||||
#ifdef FUNCTION_TIME_MEASUREMENT
|
||||
#ifdef FUNCTION_TIME_MEASUREMENT
|
||||
START_TIME_MEASUREMENT(time_10ms);
|
||||
#endif
|
||||
#endif
|
||||
led_exe();
|
||||
handle_contactors(); // Take care of startup precharge/contactor closing
|
||||
#ifdef PRECHARGE_CONTROL
|
||||
handle_precharge_control();
|
||||
#endif // PRECHARGE_CONTROL
|
||||
#ifdef FUNCTION_TIME_MEASUREMENT
|
||||
#ifdef FUNCTION_TIME_MEASUREMENT
|
||||
END_TIME_MEASUREMENT_MAX(time_10ms, datalayer.system.status.time_10ms_us);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
if (millis() - previousMillisUpdateVal >= INTERVAL_1_S) {
|
||||
previousMillisUpdateVal = millis(); // Order matters on the update_loop!
|
||||
#ifdef FUNCTION_TIME_MEASUREMENT
|
||||
#ifdef FUNCTION_TIME_MEASUREMENT
|
||||
START_TIME_MEASUREMENT(time_values);
|
||||
#endif
|
||||
#endif
|
||||
update_pause_state(); // Check if we are OK to send CAN or need to pause
|
||||
update_values_battery(); // Fetch battery values
|
||||
#ifdef DOUBLE_BATTERY
|
||||
|
@ -256,13 +256,13 @@ void core_loop(void* task_time_us) {
|
|||
update_calculated_values();
|
||||
update_machineryprotection(); // Check safeties
|
||||
update_values_inverter(); // Update values heading towards inverter
|
||||
#ifdef FUNCTION_TIME_MEASUREMENT
|
||||
#ifdef FUNCTION_TIME_MEASUREMENT
|
||||
END_TIME_MEASUREMENT_MAX(time_values, datalayer.system.status.time_values_us);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
#ifdef FUNCTION_TIME_MEASUREMENT
|
||||
#ifdef FUNCTION_TIME_MEASUREMENT
|
||||
START_TIME_MEASUREMENT(cantx);
|
||||
#endif
|
||||
#endif
|
||||
// Output
|
||||
transmit_can(); // Send CAN messages to all components
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue