Skip to content

Commit 1511bd8

Browse files
committed
going for v0.3.0
1 parent 94420de commit 1511bd8

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

dumbdisplay/_ddimpl.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ def setReconnectRCId(self, rc_id: str):
5858
self.reconnect_keep_alive_ms = 0
5959
def validateConnection(self) -> bool:
6060
#print("validateConnection")
61+
diff_ms = -1
6162
need_reconnect = False
6263
if self.last_keep_alive_ms > 0:
6364
now = time.ticks_ms()
@@ -67,7 +68,7 @@ def validateConnection(self) -> bool:
6768
if True:
6869
if need_reconnect:
6970
if self.reconnect_enabled:
70-
print("disconnected ... reconnecting ... ", self.reconnect_RC_id)
71+
print("disconnected ... reconnecting ... ", self.reconnect_RC_id, diff_ms)
7172
else:
7273
print("disconnected")
7374
if need_reconnect:

samples/melody/main.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ def HWPlayTone(freq: int, duration: int):
6969
"1:I",
7070
"2:once",
7171
"2:was",
72-
"1:lost", ],
73-
[
72+
"1:lost",
7473
"1:but",
7574
"2:now",
7675
"2:am",
@@ -150,7 +149,6 @@ def PlayTone(freq: int, duration: int, playToSpeaker: bool):
150149

151150

152151
def FeedbackHandler(layer, type, x, y):
153-
#print("FeedbackHandler", melodyApp)
154152
melodyApp.feedbackHandler(layer, type, x, y)
155153

156154

@@ -286,8 +284,6 @@ def run(self):
286284
def setupKey(self, octaveOffset: int, noteIdx: int) -> LayerGraphical:
287285
width = KEY_WIDTH - 2 * KEY_BORDER
288286
xOffset = noteIdx * KEY_WIDTH / 2
289-
#height
290-
#bgColor
291287
isSemi = False
292288
if noteIdx == 1 or noteIdx == 3 or noteIdx == 6 or noteIdx == 8 or noteIdx == 10:
293289
height = KEY_HEIGHT / 2 + 10
@@ -317,6 +313,7 @@ def setupKey(self, octaveOffset: int, noteIdx: int) -> LayerGraphical:
317313
h = height + 2 * KEY_BORDER
318314
keyLayer.pinLayer(l, t, w, h)
319315
return keyLayer
316+
320317

321318
def setupButton(self, label: str) -> LayerLcd:
322319
buttonLayer = LayerLcd(dd, 4, 1)
@@ -326,14 +323,12 @@ def setupButton(self, label: str) -> LayerLcd:
326323
buttonLayer.enableFeedback("f", FeedbackHandler)
327324
return buttonLayer
328325

326+
329327
def feedbackHandler(self, layer, type, x, y):
330-
#print("clicked")
331328
if layer == self.playLayer:
332329
self.play = not self.play
333330
if self.play:
334331
self.playLayer.backgroundColor("lightgreen")
335-
#self.lyricColIdx = 0
336-
#self.lyricRowIdx = 0
337332
else:
338333
self.playLayer.noBackgroundColor()
339334
elif layer == self.targetLayer:
@@ -344,8 +339,6 @@ def feedbackHandler(self, layer, type, x, y):
344339
self.targetLayer.noBackgroundColor()
345340
elif layer == self.restartLayer:
346341
self.restart = True
347-
#self.lyricColIdx = 0
348-
#self.lyricRowIdx = 0
349342
else:
350343
octaveOffset = layer.octaveOffset
351344
noteIdx = layer.noteIdx

0 commit comments

Comments
 (0)