From a0a0c7eb78bf1bbae90526118c29823ba2e256c4 Mon Sep 17 00:00:00 2001 From: PaulStoffregen Date: Mon, 4 Sep 2017 20:48:37 -0700 Subject: [PATCH] Fix minor compiler warnings in examples --- examples/IRrecord/IRrecord.ino | 2 +- examples/IRtest2/IRtest2.ino | 6 +++--- examples/LGACSendDemo/LGACSendDemo.ino | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/IRrecord/IRrecord.ino b/examples/IRrecord/IRrecord.ino index 7fc5cfd..a121e59 100644 --- a/examples/IRrecord/IRrecord.ino +++ b/examples/IRrecord/IRrecord.ino @@ -45,7 +45,7 @@ int toggle = 0; // The RC5/6 toggle state // Most of this code is just logging void storeCode(decode_results *results) { codeType = results->decode_type; - int count = results->rawlen; + //int count = results->rawlen; if (codeType == UNKNOWN) { Serial.println("Received unknown code, saving as raw"); codeLen = results->rawlen - 1; diff --git a/examples/IRtest2/IRtest2.ino b/examples/IRtest2/IRtest2.ino index 56b8a4d..22a8fa2 100644 --- a/examples/IRtest2/IRtest2.ino +++ b/examples/IRtest2/IRtest2.ino @@ -61,7 +61,7 @@ void setup() // Wait for the gap between tests, to synchronize with // the sender. // Specifically, wait for a signal followed by a gap of at last gap ms. -void waitForGap(int gap) { +void waitForGap(unsigned long gap) { Serial.println("Waiting for gap"); while (1) { while (digitalRead(RECV_PIN) == LOW) { @@ -125,7 +125,7 @@ void dump(decode_results *results) { // The motivation behind this method is that the sender and the receiver // can do the same test calls, and the mode variable indicates whether // to send or receive. -void test(char *label, int type, unsigned long value, int bits) { +void test(const char *label, int type, unsigned long value, int bits) { if (mode == SENDER) { Serial.println(label); if (type == NEC) { @@ -175,7 +175,7 @@ void test(char *label, int type, unsigned long value, int bits) { // Test raw send or receive. This is similar to the test method, // except it send/receives raw data. -void testRaw(char *label, unsigned int *rawbuf, int rawlen) { +void testRaw(const char *label, unsigned int *rawbuf, int rawlen) { if (mode == SENDER) { Serial.println(label); irsend.sendRaw(rawbuf, rawlen, 38 /* kHz */); diff --git a/examples/LGACSendDemo/LGACSendDemo.ino b/examples/LGACSendDemo/LGACSendDemo.ino index da5db37..e3c7dfa 100644 --- a/examples/LGACSendDemo/LGACSendDemo.ino +++ b/examples/LGACSendDemo/LGACSendDemo.ino @@ -192,12 +192,12 @@ void loop() ac_activate(AC_TEMPERATURE, AC_FLOW); break; case 2: - if ( b == 0 | b == 1 ) { + if ( b == 0 || b == 1 ) { ac_change_air_swing(b); } break; case 3: // 1 : clean on, power on - if ( b == 0 | b == 1 ) { + if ( b == 0 || b == 1 ) { ac_air_clean(b); } break;