File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
libraries/MySensors/examples/MysensorMicro Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ float lastTemperature = -100;
61
61
int lastHumidity = -100 ;
62
62
long lastBattery = -100 ;
63
63
64
+ bool highfreq = true ;
64
65
65
66
void setup () {
66
67
@@ -110,7 +111,7 @@ void loop() {
110
111
111
112
// When we wake up the 5th time after power on, switch to 1Mhz clock
112
113
// This allows us to print debug messages on startup (as serial port is dependend on oscilator settings).
113
- if (measureCount == 5 ) switchClock (1 <<CLKPS2); // Switch to 1Mhz for the reminder of the sketch, save power.
114
+ if (( measureCount == 5 ) && highfreq ) switchClock (1 <<CLKPS2); // Switch to 1Mhz for the reminder of the sketch, save power.
114
115
115
116
if (measureCount > FORCE_TRANSMIT_INTERVAL) { // force a transmission
116
117
forceTransmit = true ;
@@ -208,6 +209,7 @@ void switchClock(unsigned char clk)
208
209
CLKPR = 1 <<CLKPCE; // Set CLKPCE to enable clk switching
209
210
CLKPR = clk;
210
211
sei ();
212
+ highfreq = false ;
211
213
}
212
214
213
215
You can’t perform that action at this time.
0 commit comments