Fix unit tests after removal of USER_SETTINGS

This commit is contained in:
Daniel Öster 2025-09-02 21:56:30 +03:00
parent 53d40cbe51
commit 081d96e055
2 changed files with 26 additions and 1 deletions

View file

@ -1,5 +1,16 @@
#include "Arduino.h" #include "Arduino.h"
#include "../../Software/src/communication/can/comm_can.h"
// Provide the definition that was previously in USER_SETTINGS.cpp
volatile CAN_Configuration can_config = {
.battery = CAN_Interface::CAN_NATIVE,
.inverter = CAN_Interface::CAN_NATIVE,
.battery_double = CAN_Interface::CAN_NATIVE,
.charger = CAN_Interface::CAN_NATIVE,
.shunt = CAN_Interface::CAN_NATIVE
};
void delay(unsigned long ms) {} void delay(unsigned long ms) {}
void delayMicroseconds(unsigned long us) {} void delayMicroseconds(unsigned long us) {}
int digitalRead(uint8_t pin) { int digitalRead(uint8_t pin) {

View file

@ -38,7 +38,6 @@ inline long random(long min, long max) {
return min; // Return the minimum value for predictability return min; // Return the minimum value for predictability
} }
// Also add randomSeed for completeness
inline void randomSeed(unsigned long seed) { inline void randomSeed(unsigned long seed) {
(void)seed; (void)seed;
} }
@ -98,6 +97,21 @@ inline int analogRead(uint8_t pin) {
return 0; // Return 0 for predictable tests return 0; // Return 0 for predictable tests
} }
// Mock WiFi types
typedef int WiFiEvent_t;
typedef int WiFiEventInfo_t;
// Mock WiFi functions
inline void onWifiConnect(WiFiEvent_t event, WiFiEventInfo_t info) {
(void)event;
(void)info;
}
inline void onWifiDisconnect(WiFiEvent_t event, WiFiEventInfo_t info) {
(void)event;
(void)info;
}
unsigned long micros(); unsigned long micros();
// Can be previously declared as a macro in stupid eModbus // Can be previously declared as a macro in stupid eModbus
#undef millis #undef millis