Skip to content

Commit 2b2a0ce

Browse files
committed
Fixed various sketch-specific warnings
1 parent af6e5d3 commit 2b2a0ce

File tree

11 files changed

+16
-16
lines changed

11 files changed

+16
-16
lines changed

libraries/MySensors/examples/DimmableLightWithRotaryEncoderButton/DimmableLightWithRotaryEncoderButton.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ void incomingMessage(const MyMessage &message)
133133
newLevel = loadLevelState(EEPROM_DIM_LEVEL_SAVE);
134134
}
135135
// Send dimmer level back to controller with ack enabled
136-
gw.send(dimmerMsg.set(0), true);
136+
gw.send(dimmerMsg.set(newLevel), true);
137137
// We do not change any levels here until ack comes back from gateway
138138
return;
139139
} else if (message.type == V_DIMMER) {

libraries/MySensors/examples/DistanceSensor/DistanceSensor.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ void setup()
5151

5252
// Register all sensors to gw (they will be created as child devices)
5353
gw.present(CHILD_ID, S_DISTANCE);
54-
boolean metric = gw.getConfig().isMetric;
54+
metric = gw.getConfig().isMetric;
5555
}
5656

5757
void loop()

libraries/MySensors/examples/LightningSensor/LightningSensor.ino

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ void setup()
4242
// Register all sensors to gw (they will be created as child devices)
4343
gw.present(CHILD_ID_DISTANCE, S_DISTANCE);
4444
gw.present(CHILD_ID_INTENSITY, S_CUSTOM);
45-
boolean metric = gw.getConfig().isMetric;
4645

4746
Serial.begin(115200);
4847
Serial.println("Playing With Fusion: AS3935 Lightning Sensor, SEN-39001");
@@ -118,4 +117,4 @@ void loop()
118117
void AS3935_ISR()
119118
{
120119
AS3935_ISR_Trig = 1;
121-
}
120+
}

libraries/MySensors/examples/MQTTGateway/MQTTGateway.ino

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ void processMQTTMessage(char *inputString, uint8_t inputPos) {
279279
uint8_t i = 0;
280280
buffer[0]= 0;
281281
buffsize = 0;
282+
(void)inputPos;
282283

283284
if ((uint8_t)inputString[0] >> 4 == MQTTCONNECT) {
284285
buffer[buffsize++] = MQTTCONNACK << 4;
@@ -336,7 +337,7 @@ void processMQTTMessage(char *inputString, uint8_t inputPos) {
336337
} else if (i==2) {
337338
msg.sensor = atoi(str); //SensorID
338339
} else if (i==3) {
339-
char match=255; //SensorType
340+
unsigned char match=255; //SensorType
340341
#ifdef MQTT_TRANSLATE_TYPES
341342

342343
for (uint8_t j=0; strcpy_P(convBuf, (char*)pgm_read_word(&(vType[j]))) ; j++) {
@@ -348,7 +349,7 @@ void processMQTTMessage(char *inputString, uint8_t inputPos) {
348349
}
349350

350351
#endif
351-
if ( atoi(str)!=0 || str=="0" ) {
352+
if ( atoi(str)!=0 || (str[0]=='0' && str[1] =='\0') ) {
352353
match=atoi(str);
353354
}
354355

libraries/MySensors/examples/RainGauge/RainGauge.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ volatile int wasTippedBuffer = 0;
123123
int rainSensorThreshold = 50; //default rain sensor sensitivity in hundredths. Will be overwritten with msgTrippedVar2.
124124
byte state = 0;
125125
byte oldState = -1;
126-
int lastRainRate = 0;
126+
unsigned int lastRainRate = 0;
127127
int lastMeasure = 0;
128128
boolean gotTime = false;
129129
byte lastHour;

libraries/MySensors/examples/RealTimeClockDisplaySensor/RealTimeClockDisplaySensor.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ void loop()
8888

8989
// If no time has been received yet, request it every 10 second from controller
9090
// When time has been received, request update every hour
91-
if ((!timeReceived && now-lastRequest > (unsigned long)(10*1000))
92-
|| (timeReceived && now-lastRequest > (unsigned long)(60*1000*60))) {
91+
if ((!timeReceived && (now-lastRequest) > (10UL*1000UL))
92+
|| (timeReceived && (now-lastRequest) > (60UL*1000UL*60UL))) {
9393
// Request time from controller.
9494
Serial.println("requesting time");
9595
gw.requestTime(receiveTime);

libraries/MySensors/examples/SecretKnockSensor/SecretKnockSensor.ino

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,6 @@ boolean validateKnock(){
298298
// reads the secret knock from EEPROM. (if any.)
299299
void readSecretKnock(){
300300
byte reading;
301-
int i;
302301
reading = gw.loadState(1);
303302
if (reading == eepromValid){ // only read EEPROM if the signature byte is correct.
304303
for (int i=0; i < maximumKnocks ;i++){

libraries/MySensors/examples/SecureActuator/SecureActuator.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ MySigningAtsha204 signer;
7171
#endif
7272
MySensor gw(radio, hw, signer);
7373
#else
74-
#warning SecureActuator cannot possibly be secure without signing enabled
74+
// WARNING! SecureActuator cannot possibly be secure without signing enabled
7575
MySensor gw(radio, hw);
7676
#endif
7777

libraries/MySensors/examples/Sha204Personalizer/Sha204Personalizer.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,6 @@ void write_key(uint8_t* key)
237237

238238
void dump_configuration()
239239
{
240-
uint8_t config_word[4];
241240
uint8_t tx_buffer[SHA204_CMD_SIZE_MAX];
242241
uint8_t rx_buffer[SHA204_RSP_SIZE_MAX];
243242
uint8_t ret_code;
@@ -682,6 +681,8 @@ void setup()
682681
uint8_t lockConfig = 0;
683682
uint8_t lockValue = 0;
684683
uint16_t crc;
684+
(void)crc;
685+
685686
Serial.begin(115200);
686687

687688
Serial.println(F("ATSHA204 personalization sketch for MySensors usage."));

libraries/MySensors/examples/TimeAwareSensor/TimeAwareSensor.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ void loop()
5959

6060
// If no time has been received yet, request it every 10 second from controller
6161
// When time has been received, request update every hour
62-
if ((!timeReceived && now-lastRequest > 10*1000)
63-
|| (timeReceived && now-lastRequest > 60*1000*60)) {
62+
if ((!timeReceived && (now-lastRequest) > (10UL*1000UL))
63+
|| (timeReceived && (now-lastRequest) > (60UL*1000UL*60UL))) {
6464
// Request time from controller.
6565
Serial.println("requesting time");
6666
gw.requestTime(receiveTime);

0 commit comments

Comments
 (0)