mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-03 17:59:27 +02:00
Fix unit tests after removal of USER_SETTINGS
This commit is contained in:
parent
53d40cbe51
commit
081d96e055
2 changed files with 26 additions and 1 deletions
|
@ -1,5 +1,16 @@
|
|||
#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 delayMicroseconds(unsigned long us) {}
|
||||
int digitalRead(uint8_t pin) {
|
||||
|
|
|
@ -38,7 +38,6 @@ inline long random(long min, long max) {
|
|||
return min; // Return the minimum value for predictability
|
||||
}
|
||||
|
||||
// Also add randomSeed for completeness
|
||||
inline void randomSeed(unsigned long seed) {
|
||||
(void)seed;
|
||||
}
|
||||
|
@ -98,6 +97,21 @@ inline int analogRead(uint8_t pin) {
|
|||
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();
|
||||
// Can be previously declared as a macro in stupid eModbus
|
||||
#undef millis
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue