Files
wadamesh/web/compat/Wire.h
T
Kaj SchittecatandClaude Opus 5.5 963c75df5d web: host build of the real touch UI (SDL2, demo backend)
The touch UI (src/ui-touch, unmodified apart from WADA_WEB board guards)
builds for macOS with CMake and runs in an SDL2 window: a compat layer
for the Arduino/ESP-IDF/FreeRTOS surface, a MyMesh stand-in with a
MeshBackend interface (DemoBackend now), and the web board's SDL
display/touch/keyboard drivers. WEB_BUILD.md follows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 12:06:04 +02:00

26 lines
1000 B
C++

#pragma once
// I2C: no bus on a host. Every transaction NACKs, so probes find nothing.
#include "Arduino.h"
class TwoWire : public Stream {
public:
explicit TwoWire(uint8_t bus = 0) : _bus(bus) {}
bool begin(int sda = -1, int scl = -1, uint32_t freq = 0) { (void)sda; (void)scl; (void)freq; return true; }
bool end() { return true; }
bool setClock(uint32_t) { return true; }
void setTimeOut(uint16_t) {}
void beginTransmission(uint8_t) {}
uint8_t endTransmission(bool stop = true) { (void)stop; return 2; } // 2 = address NACK
uint8_t requestFrom(uint8_t addr, uint8_t n, bool stop = true) { (void)addr; (void)n; (void)stop; return 0; }
size_t write(uint8_t) override { return 0; }
size_t write(const uint8_t*, size_t) override { return 0; }
int available() override { return 0; }
int read() override { return -1; }
int peek() override { return -1; }
void flush() override {}
using Print::write;
private:
uint8_t _bus;
};
extern TwoWire Wire;
extern TwoWire Wire1;