Added track detect on fix and conditional loading

This commit is contained in:
2026-03-25 20:02:33 +01:00
parent a5b53afb2c
commit c6bcd3a9d7
2 changed files with 6 additions and 1 deletions

View File

@@ -28,6 +28,7 @@ private:
system_logger *_logger;
bool _valid_config;
track_data _loaded_track;
bool _is_track_loaded = false;
ring_buffer<Task, 16> _queue;
Task _active_task = {};
uint8_t _task_memory[64];
@@ -114,7 +115,9 @@ int config::handle_active_task(unsigned long timeout_ms) {
switch (_active_task.type)
{
case TASK_CONFIG_TRACK_DETECT:
return task_config_detect_track(timeout_ms);
if (!_is_track_loaded) {
return task_config_detect_track(timeout_ms);
}
break;
default:
@@ -188,5 +191,6 @@ int config::load_track(unsigned int idx) {
}
_loaded_track = temp;
track_global_write(_loaded_track);
_is_track_loaded = true;
return 0;
}