Fixed various sketch-specific warnings

This commit is contained in:
Patrick Fallberg
2015-08-09 10:06:10 +02:00
parent af6e5d3019
commit 2b2a0ce294
11 changed files with 16 additions and 16 deletions
@@ -133,7 +133,7 @@ void incomingMessage(const MyMessage &message)
newLevel = loadLevelState(EEPROM_DIM_LEVEL_SAVE);
}
// Send dimmer level back to controller with ack enabled
gw.send(dimmerMsg.set(0), true);
gw.send(dimmerMsg.set(newLevel), true);
// We do not change any levels here until ack comes back from gateway
return;
} else if (message.type == V_DIMMER) {
@@ -51,7 +51,7 @@ void setup()
// Register all sensors to gw (they will be created as child devices)
gw.present(CHILD_ID, S_DISTANCE);
boolean metric = gw.getConfig().isMetric;
metric = gw.getConfig().isMetric;
}
void loop()
@@ -42,7 +42,6 @@ void setup()
// Register all sensors to gw (they will be created as child devices)
gw.present(CHILD_ID_DISTANCE, S_DISTANCE);
gw.present(CHILD_ID_INTENSITY, S_CUSTOM);
boolean metric = gw.getConfig().isMetric;
Serial.begin(115200);
Serial.println("Playing With Fusion: AS3935 Lightning Sensor, SEN-39001");
@@ -118,4 +117,4 @@ void loop()
void AS3935_ISR()
{
AS3935_ISR_Trig = 1;
}␍
}
@@ -279,6 +279,7 @@ void processMQTTMessage(char *inputString, uint8_t inputPos) {
uint8_t i = 0;
buffer[0]= 0;
buffsize = 0;
(void)inputPos;
if ((uint8_t)inputString[0] >> 4 == MQTTCONNECT) {
buffer[buffsize++] = MQTTCONNACK << 4;
@@ -336,7 +337,7 @@ void processMQTTMessage(char *inputString, uint8_t inputPos) {
} else if (i==2) {
msg.sensor = atoi(str); //SensorID
} else if (i==3) {
char match=255; //SensorType
unsigned char match=255; //SensorType
#ifdef MQTT_TRANSLATE_TYPES
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) {
}
#endif
if ( atoi(str)!=0 || str=="0" ) {
if ( atoi(str)!=0 || (str[0]=='0' && str[1] =='\0') ) {
match=atoi(str);
}
@@ -123,7 +123,7 @@ volatile int wasTippedBuffer = 0;
int rainSensorThreshold = 50; //default rain sensor sensitivity in hundredths. Will be overwritten with msgTrippedVar2.
byte state = 0;
byte oldState = -1;
int lastRainRate = 0;
unsigned int lastRainRate = 0;
int lastMeasure = 0;
boolean gotTime = false;
byte lastHour;
@@ -88,8 +88,8 @@ void loop()
// If no time has been received yet, request it every 10 second from controller
// When time has been received, request update every hour
if ((!timeReceived && now-lastRequest > (unsigned long)(10*1000))
|| (timeReceived && now-lastRequest > (unsigned long)(60*1000*60))) {
if ((!timeReceived && (now-lastRequest) > (10UL*1000UL))
|| (timeReceived && (now-lastRequest) > (60UL*1000UL*60UL))) {
// Request time from controller.
Serial.println("requesting time");
gw.requestTime(receiveTime);
@@ -298,7 +298,6 @@ boolean validateKnock(){
// reads the secret knock from EEPROM. (if any.)
void readSecretKnock(){
byte reading;
int i;
reading = gw.loadState(1);
if (reading == eepromValid){ // only read EEPROM if the signature byte is correct.
for (int i=0; i < maximumKnocks ;i++){
@@ -71,7 +71,7 @@ MySigningAtsha204 signer;
#endif
MySensor gw(radio, hw, signer);
#else
#warning SecureActuator cannot possibly be secure without signing enabled
// WARNING! SecureActuator cannot possibly be secure without signing enabled
MySensor gw(radio, hw);
#endif
@@ -237,7 +237,6 @@ void write_key(uint8_t* key)
void dump_configuration()
{
uint8_t config_word[4];
uint8_t tx_buffer[SHA204_CMD_SIZE_MAX];
uint8_t rx_buffer[SHA204_RSP_SIZE_MAX];
uint8_t ret_code;
@@ -682,6 +681,8 @@ void setup()
uint8_t lockConfig = 0;
uint8_t lockValue = 0;
uint16_t crc;
(void)crc;
Serial.begin(115200);
Serial.println(F("ATSHA204 personalization sketch for MySensors usage."));
@@ -59,8 +59,8 @@ void loop()
// If no time has been received yet, request it every 10 second from controller
// When time has been received, request update every hour
if ((!timeReceived && now-lastRequest > 10*1000)
|| (timeReceived && now-lastRequest > 60*1000*60)) {
if ((!timeReceived && (now-lastRequest) > (10UL*1000UL))
|| (timeReceived && (now-lastRequest) > (60UL*1000UL*60UL))) {
// Request time from controller.
Serial.println("requesting time");
gw.requestTime(receiveTime);
@@ -53,7 +53,7 @@ MyMessage uvMsg(CHILD_ID_UV, V_UV);
unsigned long lastSend =0;
float uvIndex;
float lastUV = -1;
int uvIndexValue [12] = { 50, 227, 318, 408, 503, 606, 696, 795, 881, 976, 1079, 1170};
uint16_t uvIndexValue [12] = { 50, 227, 318, 408, 503, 606, 696, 795, 881, 976, 1079, 1170};
void setup()
{
@@ -98,7 +98,7 @@ void loop()
//Serial.println(uvIndex,2);
//Send value to gateway if changed, or at least every 5 minutes
if ((uvIndex != lastUV)||(currentTime-lastSend >= 5*60*1000)) {
if ((uvIndex != lastUV)||(currentTime-lastSend >= 5UL*60UL*1000UL)) {
lastSend=currentTime;
gw.send(uvMsg.set(uvIndex,2));
lastUV = uvIndex;