Browse Source

Correct few warning

sonoff
Mathieu Maret 5 years ago
parent
commit
678eafe1a5
  1. 4
      WifiControlSensor/BMP180.h
  2. 2
      WifiControlSensor/MQTT.h
  3. 2
      WifiControlSensor/WebServer.ino
  4. 2
      WifiControlSensor/WifiControlSensor.ino
  5. 2
      WifiControlSensor/dry_sensor.h
  6. 4
      WifiControlSensor/sensor_DHT.h
  7. 6
      WifiControlSensor/utils.h

4
WifiControlSensor/BMP180.h

@ -11,8 +11,8 @@ int BMP180Setup(int sda, int scl);
bool BMP180IsConnected();
#else //CONFIG_ENABLE_BMP80
int BMP180GetTemperature(double &t){return -1;};
int BMP180GetTempAndPressure(double &t, double &p){return -1;};
int BMP180GetTemperature(double &){return -1;};
int BMP180GetTempAndPressure(double &, double &){return -1;};
int BMP180Setup(int , int ){SKETCH_DEBUG_PRINTLN("BMP180 is disabled at build time"); return -1;};
bool BMP180IsConnected(){return false;};
#endif

2
WifiControlSensor/MQTT.h

@ -15,7 +15,6 @@ void MqttCheckSubscription();
void MqttCheckIRQ();
void MqttChangeGpioValue(int gpio, int value);
void MqttChangePWMValue(int gpio, int value);
bool MqttIsConfigured();
void MqttNofityIRQ(uint8_t gpio, int value);
void MqttNofity(int gpio, int value);
#else
@ -31,7 +30,6 @@ void MqttCheckSubscription(){}
void MqttCheckIRQ(){}
void MqttChangeGpioValue(int gpio, int value){}
void MqttChangePWMValue(int gpio, int value){}
bool MqttIsConfigured(){}
void MqttNofityIRQ(uint8_t gpio, int value){}
void MqttNofity(int gpio, int value){}
#endif

2
WifiControlSensor/WebServer.ino

@ -237,7 +237,7 @@ void WebHandleWifiStatus() {
message += statusToString(WiFi.status());
message += "<br/>";
if(mode == BOOTMODE_SETUP && WiFi.status() == WL_CONNECTED){
message += "Wifi correctly setup!, you can reboot now<br/>";
message += "Wifi correctly setup! You can reboot now<br/>";
message += "<a href=\"/reboot\">Reboot</a><br/>";
}
if(WiFi.status() == WL_CONNECT_FAILED || WiFi.status() == WL_NO_SSID_AVAIL){

2
WifiControlSensor/WifiControlSensor.ino

@ -99,7 +99,7 @@ void onLongButtonPressed(uint8_t pin){
void WifiSetup(productConfig conf) {
IPAddress myIP;
if (conf.bootMode == BOOTMODE_SETUP) {
SKETCH_DEBUG_PRINTLN("Configuring access point: "CONFIG_SSID_NAME);
SKETCH_DEBUG_PRINTLN("Configuring access point: " CONFIG_SSID_NAME);
/* You can set a password to the AP here */
WiFi.softAP(CONFIG_SSID_NAME);
myIP = WiFi.softAPIP();

2
WifiControlSensor/dry_sensor.h

@ -3,9 +3,7 @@
#ifdef CONFIG_ENABLE_DRY_SENSOR
int DrySetup(int powerGPIO);
int DryGetMeasure(int &dry);
bool DryIsConnected(){return true;}
#else
int DrySetup(int){return -1;}
int DryGetMeasure(int){return -1;}
bool DryIsConnected(){return false;}
#endif

4
WifiControlSensor/sensor_DHT.h

@ -8,7 +8,7 @@ int DHTGetTempAndHumidity(float &t, float &h);
bool DHTIsConnected();
#else //CONFIG_ENABLE_DHT
int DHTSetup(int pin){SKETCH_DEBUG_PRINTLN("DHT is disabled at build time"); return -1;};
int DHTGetTempAndHumidity(float &t, float &h){return -1;};
int DHTSetup(int){SKETCH_DEBUG_PRINTLN("DHT is disabled at build time"); return -1;};
int DHTGetTempAndHumidity(float &, float &){return -1;};
bool DHTIsConnected(){return false;};
#endif

6
WifiControlSensor/utils.h

@ -5,8 +5,10 @@
#define STRINGIFY(x) #x
#define TOSTRING(x) STRINGIFY(x)
int findIndex(int el, const int array[]){
for ( uint i = 0; i < NB_ELEMENTS(array); i++) {
#define findIndex(x,y) findIdx(x, y, NB_ELEMENTS((y)))
int findIdx(int el, const int array[], uint size){
for (uint i = 0; i < size; i++) {
if (el == array[i])
return i;
}

Loading…
Cancel
Save