Small Warning fix & print simplification

This commit is contained in:
Mathieu Maret 2016-09-28 00:29:54 +02:00
parent 3a6987af44
commit 640db6c27d
3 changed files with 4 additions and 7 deletions

View File

@ -182,12 +182,10 @@ void MqttCheckSubscription() {
Adafruit_MQTT_Subscribe *subscription; Adafruit_MQTT_Subscribe *subscription;
while ((subscription = mqtt->readSubscription(0))) { while ((subscription = mqtt->readSubscription(0))) {
int gpio = getGpioFromSubscription(subscription); int gpio = getGpioFromSubscription(subscription);
SKETCH_DEBUG_PRINT("Got Subscription for gpio "); SKETCH_DEBUG_PRINTF("Got Subscription for gpio %d\n", gpio);
SKETCH_DEBUG_PRINTLN(gpio);
if (gpio > 0 && getGpioWatchedIndex(gpio) >= 0) { if (gpio > 0 && getGpioWatchedIndex(gpio) >= 0) {
char *value = (char *) subscription->lastread; char *value = (char *) subscription->lastread;
SKETCH_DEBUG_PRINT("Receive data: "); SKETCH_DEBUG_PRINTF("Receive data: %s\n", value);
SKETCH_DEBUG_PRINTLN(value);
MqttChangeGpioValue(gpio, atoi(value)); MqttChangeGpioValue(gpio, atoi(value));
} }
} }

View File

@ -164,8 +164,7 @@ void OTASetup() {
SKETCH_DEBUG_PRINTLN("Ready"); SKETCH_DEBUG_PRINTLN("Ready");
SKETCH_DEBUG_PRINT("IP address: "); SKETCH_DEBUG_PRINT("IP address: ");
SKETCH_DEBUG_PRINTLN(WiFi.localIP()); SKETCH_DEBUG_PRINTLN(WiFi.localIP());
SKETCH_DEBUG_PRINT("Free Space: "); SKETCH_DEBUG_PRINTF("Free Space: %d\n", ESP.getFreeSketchSpace());
SKETCH_DEBUG_PRINTLN(ESP.getFreeSketchSpace());
} }
void setup() { void setup() {

View File

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