Skip to content

Commit 0b96608

Browse files
committed
1 parent 650f11a commit 0b96608

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

libraries/Oregon/src/Oregon.h

+10-4
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,9 @@ byte channel(const byte* data)
253253
case 0x40:
254254
channel = 3;
255255
break;
256+
default:
257+
channel = 0;
258+
break;
256259
}
257260
#ifdef MY_DEBUG
258261
Serial.println("Oregon channel: " + String(channel));
@@ -302,8 +305,8 @@ const byte* DataToDecoder (class DecodeOOK& decoder)
302305

303306
int FindSensor (const int id, int maxsensor)
304307
{
305-
int i;
306-
for (i=0; i<maxsensor; i++){
308+
int EepromId;
309+
for (int i=0; i<maxsensor; i++){
307310
#ifdef MySensor_h
308311
int SensorID = loadState(i);
309312
#else
@@ -323,7 +326,8 @@ int FindSensor (const int id, int maxsensor)
323326
Serial.print(" has been saved in position EEPROM: ");
324327
Serial.println(i);
325328
#endif
326-
return i;
329+
EepromId = i;
330+
break;
327331
}
328332

329333
if(id == SensorID){
@@ -333,9 +337,11 @@ int FindSensor (const int id, int maxsensor)
333337
Serial.print(" has been find in position EEPROM: ");
334338
Serial.println(i);
335339
#endif
336-
return i;
340+
EepromId = i;
341+
break;
337342
}
338343
}
344+
return EepromId;
339345
}
340346

341347
#endif

0 commit comments

Comments
 (0)