Browse Source

sys: some more header cleanup

mcspr-patch-1
Maxim Prokhorov 3 years ago
parent
commit
1960df21fb
8 changed files with 21 additions and 41 deletions
  1. +5
    -3
      code/espurna/homeassistant.cpp
  2. +0
    -8
      code/espurna/homeassistant.h
  3. +2
    -0
      code/espurna/i2c.cpp
  4. +0
    -10
      code/espurna/i2c.h
  5. +0
    -5
      code/espurna/influxdb.h
  6. +8
    -6
      code/espurna/mdns.h
  7. +6
    -3
      code/espurna/uartmqtt.cpp
  8. +0
    -6
      code/espurna/uartmqtt.h

+ 5
- 3
code/espurna/homeassistant.cpp View File

@ -10,9 +10,6 @@ Copyright (C) 2017-2019 by Xose Pérez <xose dot perez at gmail dot com>
#if HOMEASSISTANT_SUPPORT #if HOMEASSISTANT_SUPPORT
#include <Ticker.h>
#include <Schedule.h>
#include "light.h" #include "light.h"
#include "mqtt.h" #include "mqtt.h"
#include "relay.h" #include "relay.h"
@ -21,6 +18,11 @@ Copyright (C) 2017-2019 by Xose Pérez <xose dot perez at gmail dot com>
#include "utils.h" #include "utils.h"
#include "ws.h" #include "ws.h"
#include <Ticker.h>
#include <Schedule.h>
#include <ArduinoJson.h>
bool _ha_enabled = false; bool _ha_enabled = false;
bool _ha_send_flag = false; bool _ha_send_flag = false;


+ 0
- 8
code/espurna/homeassistant.h View File

@ -10,12 +10,4 @@ Copyright (C) 2017-2019 by Xose Pérez <xose dot perez at gmail dot com>
#include "espurna.h" #include "espurna.h"
#if HOMEASSISTANT_SUPPORT
#include <ArduinoJson.h>
struct ha_config_t;
void haSetup(); void haSetup();
#endif // HOMEASSISTANT_SUPPORT == 1

+ 2
- 0
code/espurna/i2c.cpp View File

@ -10,9 +10,11 @@ Copyright (C) 2017-2019 by Xose Pérez <xose dot perez at gmail dot com>
#if I2C_SUPPORT #if I2C_SUPPORT
#include <Wire.h>
unsigned int _i2c_locked[16] = {0}; unsigned int _i2c_locked[16] = {0};
#if I2C_USE_BRZO #if I2C_USE_BRZO
#include <brzo_i2c.h>
unsigned long _i2c_scl_frequency = 0; unsigned long _i2c_scl_frequency = 0;
#endif #endif


+ 0
- 10
code/espurna/i2c.h View File

@ -10,14 +10,6 @@ Copyright (C) 2017-2019 by Xose Pérez <xose dot perez at gmail dot com>
#include "espurna.h" #include "espurna.h"
#if I2C_SUPPORT
#if I2C_USE_BRZO
#include <brzo_i2c.h>
#else
#include <Wire.h>
#endif
void i2c_wakeup(uint8_t address); void i2c_wakeup(uint8_t address);
uint8_t i2c_write_buffer(uint8_t address, uint8_t * buffer, size_t len); uint8_t i2c_write_buffer(uint8_t address, uint8_t * buffer, size_t len);
uint8_t i2c_write_uint8(uint8_t address, uint8_t value); uint8_t i2c_write_uint8(uint8_t address, uint8_t value);
@ -44,5 +36,3 @@ unsigned char i2cFind(size_t size, unsigned char * addresses, unsigned char &sta
unsigned char i2cFind(size_t size, unsigned char * addresses); unsigned char i2cFind(size_t size, unsigned char * addresses);
void i2cSetup(); void i2cSetup();
#endif // I2C_SUPPORT == 1

+ 0
- 5
code/espurna/influxdb.h View File

@ -8,12 +8,7 @@ Copyright (C) 2017-2019 by Xose Pérez <xose dot perez at gmail dot com>
#include "espurna.h" #include "espurna.h"
#if INFLUXDB_SUPPORT
bool idbSend(const char * topic, unsigned char id, const char * payload); bool idbSend(const char * topic, unsigned char id, const char * payload);
bool idbSend(const char * topic, const char * payload); bool idbSend(const char * topic, const char * payload);
bool idbEnabled(); bool idbEnabled();
void idbSetup(); void idbSetup();
#endif // INFLUXDB_SUPPORT

+ 8
- 6
code/espurna/mdns.h View File

@ -1,11 +1,13 @@
/*
MDNS MODULE
Copyright (C) 2017-2019 by Xose Pérez <xose dot perez at gmail dot com>
*/
#pragma once #pragma once
#include "espurna.h" #include "espurna.h"
#include <Arduino.h>
#if MDNS_SERVER_SUPPORT
#include <ESP8266mDNS.h>
void mdnsServerSetup(); void mdnsServerSetup();
#endif

+ 6
- 3
code/espurna/uartmqtt.cpp View File

@ -17,10 +17,13 @@ char _uartmqttBuffer[UART_MQTT_BUFFER_SIZE];
bool _uartmqttNewData = false; bool _uartmqttNewData = false;
#if UART_MQTT_USE_SOFT #if UART_MQTT_USE_SOFT
SoftwareSerial _uart_mqtt_serial(UART_MQTT_RX_PIN, UART_MQTT_TX_PIN, false, UART_MQTT_BUFFER_SIZE);
#define UART_MQTT_PORT _uart_mqtt_serial
#include <SoftwareSerial.h>
SoftwareSerial _uart_mqtt_serial(UART_MQTT_RX_PIN, UART_MQTT_TX_PIN, false, UART_MQTT_BUFFER_SIZE);
#define UART_MQTT_PORT _uart_mqtt_serial
#else #else
#define UART_MQTT_PORT UART_MQTT_HW_PORT
#define UART_MQTT_PORT UART_MQTT_HW_PORT
#endif #endif
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------


+ 0
- 6
code/espurna/uartmqtt.h View File

@ -11,10 +11,4 @@ Adapted by Xose Pérez <xose dot perez at gmail dot com>
#include "espurna.h" #include "espurna.h"
#if UART_MQTT_SUPPORT
#include <SoftwareSerial.h>
void uartmqttSetup(); void uartmqttSetup();
#endif // UART_MQTT_SUPPORT == 1

Loading…
Cancel
Save