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;
6161int lastHumidity = -100 ;
6262long lastBattery = -100 ;
6363
64+ bool highfreq = true ;
6465
6566void setup () {
6667
@@ -110,7 +111,7 @@ void loop() {
110111
111112 // When we wake up the 5th time after power on, switch to 1Mhz clock
112113 // 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.
114115
115116 if (measureCount > FORCE_TRANSMIT_INTERVAL) { // force a transmission
116117 forceTransmit = true ;
@@ -208,6 +209,7 @@ void switchClock(unsigned char clk)
208209 CLKPR = 1 <<CLKPCE; // Set CLKPCE to enable clk switching
209210 CLKPR = clk;
210211 sei ();
212+ highfreq = false ;
211213}
212214
213215
You can’t perform that action at this time.
0 commit comments