From 1a3947ad0fa76e6802d9eab1c89dc9099099768b Mon Sep 17 00:00:00 2001 From: Kevin Luo Date: Tue, 2 Dec 2025 23:03:24 -0500 Subject: [PATCH] Eradicate vcr_data instance --- include/VCF_Globals.h | 1 - lib/interfaces/include/NeopixelController.h | 2 +- lib/interfaces/src/NeopixelController.cpp | 4 ++-- src/VCF_Globals.cpp | 1 - src/VCF_Tasks.cpp | 3 +-- 5 files changed, 4 insertions(+), 7 deletions(-) diff --git a/include/VCF_Globals.h b/include/VCF_Globals.h index 9b37457..94372d5 100644 --- a/include/VCF_Globals.h +++ b/include/VCF_Globals.h @@ -29,7 +29,6 @@ /* Interface and system data structs */ using VCFData_sInstance = etl::singleton; -using VCRData_sInstance = etl::singleton; /* IOExpander setup */ using IOExpanderInstance = etl::singleton; diff --git a/lib/interfaces/include/NeopixelController.h b/lib/interfaces/include/NeopixelController.h index 050fe95..cb1cba3 100644 --- a/lib/interfaces/include/NeopixelController.h +++ b/lib/interfaces/include/NeopixelController.h @@ -62,7 +62,7 @@ class NeopixelController void init_neopixels(); void dim_neopixels(); void set_neopixel(uint16_t id, uint32_t c); - void refresh_neopixels(VCFData_s &vcf_data, VCRData_s &vcr_data, CANInterfaces &interfaces); + void refresh_neopixels(VCFData_s &vcf_data, CANInterfaces &interfaces); void set_neopixel_color(LED_ID_e led, LED_color_e color); private: diff --git a/lib/interfaces/src/NeopixelController.cpp b/lib/interfaces/src/NeopixelController.cpp index 1217a06..45886b8 100644 --- a/lib/interfaces/src/NeopixelController.cpp +++ b/lib/interfaces/src/NeopixelController.cpp @@ -27,7 +27,7 @@ void NeopixelController::set_neopixel(uint16_t id, uint32_t c) { _neopixels.setPixelColor(id, c); } -void NeopixelController::refresh_neopixels(VCFData_s &vcf_data, VCRData_s &vcr_data, CANInterfaces &interfaces) { +void NeopixelController::refresh_neopixels(VCFData_s &vcf_data, CANInterfaces &interfaces) { // If we are in pedals recalibration state, LIGHT UP DASHBOARD ALL RED. if (interfaces.vcr_interface.is_in_pedals_calibration_state()) { @@ -135,7 +135,7 @@ void NeopixelController::refresh_neopixels(VCFData_s &vcf_data, VCRData_s &vcr_d set_neopixel_color(LED_ID_e::BMS, interfaces.dash_interface.bms_ok ? LED_color_e::GREEN : LED_color_e::RED); set_neopixel_color(LED_ID_e::MC_ERR, interfaces.vcr_interface.get_inverter_error() ? LED_color_e::RED : LED_color_e::GREEN); set_neopixel_color(LED_ID_e::RDY_DRIVE, ready_drive_color); - set_neopixel_color(LED_ID_e::GLV, vcr_data.interface_data.current_sensor_data.twentyfour_volt_sensor > glv_critical_voltage ? LED_color_e::GREEN : LED_color_e::YELLOW); // No sensor there yet + set_neopixel_color(LED_ID_e::GLV, LED_color_e::OFF); // No sensor there yet set_neopixel_color(LED_ID_e::TORQUE_MODE, torque_mode_color); _neopixels.show(); diff --git a/src/VCF_Globals.cpp b/src/VCF_Globals.cpp index 8f92eb5..87f71fa 100644 --- a/src/VCF_Globals.cpp +++ b/src/VCF_Globals.cpp @@ -8,7 +8,6 @@ /* Interface and system data structs */ VCFData_s vcf_data = {}; -VCRData_s vcr_data = {}; qindesign::network::EthernetUDP VCF_socket; qindesign::network::EthernetUDP VCR_socket; \ No newline at end of file diff --git a/src/VCF_Tasks.cpp b/src/VCF_Tasks.cpp index 5387bea..23cd4ab 100644 --- a/src/VCF_Tasks.cpp +++ b/src/VCF_Tasks.cpp @@ -386,7 +386,7 @@ HT_TASK::TaskResponse init_neopixels_task(const unsigned long& sys_micros, const HT_TASK::TaskResponse run_update_neopixels_task(const unsigned long& sys_micros, const HT_TASK::TaskInfo& task_info) { - NeopixelControllerInstance::instance().refresh_neopixels(VCFData_sInstance::instance(), VCRData_sInstance::instance(), VCFCANInterfaceImpl::CANInterfacesInstance::instance()); + NeopixelControllerInstance::instance().refresh_neopixels(VCFData_sInstance::instance(), VCFCANInterfaceImpl::CANInterfacesInstance::instance()); return HT_TASK::TaskResponse::YIELD; } @@ -537,7 +537,6 @@ void setup_all_interfaces() { }); EthernetIPDefsInstance::create(); - VCRData_sInstance::create(); VCFData_sInstance::create(); // Create pedals singleton