Public Access
- New native environment: pio test -e native - test/mocks: fake Arduino core, EEPROM and recording BROSE9323 driver - test/test_nano: 25 tests covering every command, bitmaps, bad input, flip time storage and the periodic full redraw - Board environments ignore tests so they are never uploaded Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
31 lines
509 B
C++
31 lines
509 B
C++
// In-memory EEPROM for the native tests (starts erased, all 0xFF like a new chip)
|
|
#pragma once
|
|
|
|
#include <cstdint>
|
|
#include <cstring>
|
|
|
|
class FakeEEPROM
|
|
{
|
|
public:
|
|
uint8_t mem[1024];
|
|
|
|
FakeEEPROM() { erase(); }
|
|
void erase() { memset(mem, 0xFF, sizeof(mem)); }
|
|
|
|
template <typename T>
|
|
T &get(int addr, T &t)
|
|
{
|
|
memcpy(&t, mem + addr, sizeof(T));
|
|
return t;
|
|
}
|
|
|
|
template <typename T>
|
|
const T &put(int addr, const T &t)
|
|
{
|
|
memcpy(mem + addr, &t, sizeof(T));
|
|
return t;
|
|
}
|
|
};
|
|
|
|
inline FakeEEPROM EEPROM;
|