Correct few warning

This commit is contained in:
Mathieu Maret 2017-01-01 23:35:19 +01:00
parent f4541a6fd6
commit 678eafe1a5
7 changed files with 10 additions and 12 deletions

View File

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

View File

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

View File

@ -237,7 +237,7 @@ void WebHandleWifiStatus() {
message += statusToString(WiFi.status()); message += statusToString(WiFi.status());
message += "<br/>"; message += "<br/>";
if(mode == BOOTMODE_SETUP && WiFi.status() == WL_CONNECTED){ 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/>"; message += "<a href=\"/reboot\">Reboot</a><br/>";
} }
if(WiFi.status() == WL_CONNECT_FAILED || WiFi.status() == WL_NO_SSID_AVAIL){ if(WiFi.status() == WL_CONNECT_FAILED || WiFi.status() == WL_NO_SSID_AVAIL){

View File

@ -99,7 +99,7 @@ void onLongButtonPressed(uint8_t pin){
void WifiSetup(productConfig conf) { void WifiSetup(productConfig conf) {
IPAddress myIP; IPAddress myIP;
if (conf.bootMode == BOOTMODE_SETUP) { 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 */ /* You can set a password to the AP here */
WiFi.softAP(CONFIG_SSID_NAME); WiFi.softAP(CONFIG_SSID_NAME);
myIP = WiFi.softAPIP(); myIP = WiFi.softAPIP();

View File

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

View File

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

View File

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