 #include <FS.h>
 
 /////////////////////////////////////////////////////////////
-// Settings
+// Defines
+
+enum // EBus addresses
+{
+  EBUS_ADDR_HOST   = 0,
+  EBUS_ADDR_BOILER = 8,  // Slave address for boiler (master address is 3)
+};
+
+/////////////////////////////////////////////////////////////
+// Settings (read from settings.json)
 
 struct Settings
 {

  return true;
}

void ICACHE_RAM_ATTR SendChar(uint8 ch)
{
  WRITE_PERI_REG(UART_FIFO(UART_EBUS), ch);

// 4K serial traffic buffer
#define SERIAL_BUFFER_SIZE 0x1000

// EBus data is stored in ring buffer (for diagnostics)
uint8 g_serialBuffer[SERIAL_BUFFER_SIZE];
// Total byte count (if overflows, reset to 0x80000000)
uint32 g_serialByteCount = 0;

#define GET_SERIAL_BYTE_NO(NO) (g_serialBuffer[(NO) % SERIAL_BUFFER_SIZE])
#define PUT_SERIAL_BYTE(B) do { \
