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();
|
init_stored_settings();
|
||||||
|
|
||||||
#ifdef WIFI
|
#ifdef WIFI
|
||||||
xTaskCreatePinnedToCore((TaskFunction_t)&connectivity_loop, "connectivity_loop", 4096, NULL,
|
xTaskCreatePinnedToCore((TaskFunction_t)&connectivity_loop, "connectivity_loop", 4096, NULL, TASK_CONNECTIVITY_PRIO,
|
||||||
TASK_CONNECTIVITY_PRIO, &connectivity_loop_task, WIFI_CORE);
|
&connectivity_loop_task, WIFI_CORE);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(LOG_CAN_TO_SD) || defined(LOG_TO_SD)
|
#if defined(LOG_CAN_TO_SD) || defined(LOG_TO_SD)
|
||||||
xTaskCreatePinnedToCore((TaskFunction_t)&logging_loop, "logging_loop", 4096, NULL,
|
xTaskCreatePinnedToCore((TaskFunction_t)&logging_loop, "logging_loop", 4096, NULL, TASK_CONNECTIVITY_PRIO,
|
||||||
TASK_CONNECTIVITY_PRIO, &logging_loop_task, WIFI_CORE);
|
&logging_loop_task, WIFI_CORE);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MQTT
|
#ifdef MQTT
|
||||||
xTaskCreatePinnedToCore((TaskFunction_t)&mqtt_loop, "mqtt_loop", 4096, NULL, TASK_MQTT_PRIO,
|
xTaskCreatePinnedToCore((TaskFunction_t)&mqtt_loop, "mqtt_loop", 4096, NULL, TASK_MQTT_PRIO, &mqtt_loop_task,
|
||||||
&mqtt_loop_task, WIFI_CORE);
|
WIFI_CORE);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
init_CAN();
|
init_CAN();
|
||||||
|
@ -125,8 +125,8 @@ void setup() {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Start tasks
|
// Start tasks
|
||||||
xTaskCreatePinnedToCore((TaskFunction_t)&core_loop, "core_loop", 4096, NULL, TASK_CORE_PRIO,
|
xTaskCreatePinnedToCore((TaskFunction_t)&core_loop, "core_loop", 4096, NULL, TASK_CORE_PRIO, &main_loop_task,
|
||||||
&main_loop_task, CORE_FUNCTION_CORE);
|
CORE_FUNCTION_CORE);
|
||||||
#ifdef PERIODIC_BMS_RESET_AT
|
#ifdef PERIODIC_BMS_RESET_AT
|
||||||
bmsResetTimeOffset = getTimeOffsetfromNowUntil(PERIODIC_BMS_RESET_AT);
|
bmsResetTimeOffset = getTimeOffsetfromNowUntil(PERIODIC_BMS_RESET_AT);
|
||||||
if (bmsResetTimeOffset == 0) {
|
if (bmsResetTimeOffset == 0) {
|
||||||
|
@ -229,24 +229,24 @@ void core_loop(void* task_time_us) {
|
||||||
// Process
|
// Process
|
||||||
if (millis() - previousMillis10ms >= INTERVAL_10_MS) {
|
if (millis() - previousMillis10ms >= INTERVAL_10_MS) {
|
||||||
previousMillis10ms = millis();
|
previousMillis10ms = millis();
|
||||||
#ifdef FUNCTION_TIME_MEASUREMENT
|
#ifdef FUNCTION_TIME_MEASUREMENT
|
||||||
START_TIME_MEASUREMENT(time_10ms);
|
START_TIME_MEASUREMENT(time_10ms);
|
||||||
#endif
|
#endif
|
||||||
led_exe();
|
led_exe();
|
||||||
handle_contactors(); // Take care of startup precharge/contactor closing
|
handle_contactors(); // Take care of startup precharge/contactor closing
|
||||||
#ifdef PRECHARGE_CONTROL
|
#ifdef PRECHARGE_CONTROL
|
||||||
handle_precharge_control();
|
handle_precharge_control();
|
||||||
#endif // 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);
|
END_TIME_MEASUREMENT_MAX(time_10ms, datalayer.system.status.time_10ms_us);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (millis() - previousMillisUpdateVal >= INTERVAL_1_S) {
|
if (millis() - previousMillisUpdateVal >= INTERVAL_1_S) {
|
||||||
previousMillisUpdateVal = millis(); // Order matters on the update_loop!
|
previousMillisUpdateVal = millis(); // Order matters on the update_loop!
|
||||||
#ifdef FUNCTION_TIME_MEASUREMENT
|
#ifdef FUNCTION_TIME_MEASUREMENT
|
||||||
START_TIME_MEASUREMENT(time_values);
|
START_TIME_MEASUREMENT(time_values);
|
||||||
#endif
|
#endif
|
||||||
update_pause_state(); // Check if we are OK to send CAN or need to pause
|
update_pause_state(); // Check if we are OK to send CAN or need to pause
|
||||||
update_values_battery(); // Fetch battery values
|
update_values_battery(); // Fetch battery values
|
||||||
#ifdef DOUBLE_BATTERY
|
#ifdef DOUBLE_BATTERY
|
||||||
|
@ -256,13 +256,13 @@ void core_loop(void* task_time_us) {
|
||||||
update_calculated_values();
|
update_calculated_values();
|
||||||
update_machineryprotection(); // Check safeties
|
update_machineryprotection(); // Check safeties
|
||||||
update_values_inverter(); // Update values heading towards inverter
|
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);
|
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);
|
START_TIME_MEASUREMENT(cantx);
|
||||||
#endif
|
#endif
|
||||||
// Output
|
// Output
|
||||||
transmit_can(); // Send CAN messages to all components
|
transmit_can(); // Send CAN messages to all components
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue