@@ -118,7 +118,6 @@ def writeto_mem(self, addr, memaddr, buf, *, addrsize=8):
118
118
zip_px .fill (BLACK )
119
119
zip_px .show ()
120
120
121
-
122
121
display_image = [0 ] * (5 * 5 )
123
122
124
123
microbit_bri_conv = 9.0 / 255.0
@@ -134,12 +133,10 @@ def show_display_image():
134
133
show_display_image ()
135
134
gc .collect ()
136
135
137
- ### Remove the current_time setting
138
136
clock = ComboClock (mcp ,
139
137
rtc_clock_drift_ppm = THIS_ZHH_RTC_PPM ,
140
138
rtc_trim_conv = PPM_TO_TRIM_CONV ,
141
- mp_clock_drift_ppm = THIS_MICROBIT_CLOCK_PPM ,
142
- current_time = (2025 , 2 , 26 , 9 , 30 , 0 , 2 , 57 ))
139
+ mp_clock_drift_ppm = THIS_MICROBIT_CLOCK_PPM )
143
140
144
141
stopwatch_hmsms = [0 , 0 , 0 , 0.0 ]
145
142
@@ -204,7 +201,7 @@ def show_display_image():
204
201
if not (bg_displayed & (1 << SECOND )):
205
202
s_idx = rtc_time [SECOND ] * ZIPCOUNT // 60
206
203
elif mode_idx == MODE_TIME_SET :
207
- flash_on = ss_ms > 500 .0
204
+ flash_on = ( utime . ticks_ms () % 1000 ) > 300 .0
208
205
if time_set_change != HOUR or flash_on :
209
206
h_idx = rtc_time [HOUR ] * ZIPCOUNT // 12 % ZIPCOUNT
210
207
display_char = ("p" if rtc_time [HOUR ] >= 12 else "a" )
@@ -291,6 +288,8 @@ def show_display_image():
291
288
threshold = threshold * 0.9 + 0.1 * int (pin_logo .is_touched ())
292
289
293
290
if mode_idx == MODE_TIME_SET :
291
+ ### Exit time set mode
292
+ clock .resync_enabled = True
294
293
clock .sync_clocks ()
295
294
mode_idx = MODE_CLOCK
296
295
elif utime .ticks_diff (t2_ms , t1_ms ) < LONG_PRESS_DURATION_MS :
@@ -306,3 +305,4 @@ def show_display_image():
306
305
else :
307
306
mode_idx = MODE_TIME_SET
308
307
time_set_change = HOUR
308
+ clock .resync_enabled = False
0 commit comments