Skip to content

Commit 0a5c7a4

Browse files
author
DozenCrows
committed
Removed timing safety net now I2C IR blaster in use; tidied commented out code
1 parent c3d27dd commit 0a5c7a4

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

PyGameInterface.py

-8
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ def __getattr__(self, attr):
5252
TIME_STEP = 0.008
5353

5454
test_button_layout = [
55-
# dotdict({ 'x':0, 'y':0, 'width':2, 'height':1, 'text':"Power", 'code':"Phillips-HTS KEY_POWER KEY_POWER KEY_POWER;RM-ED050-12 KEY_POWER" }),
5655
dotdict({ 'x':0, 'y':0, 'width':2, 'height':1, 'text':"Power", 'code':"Phillips-HTS KEY_POWER;RM-ED050-12 KEY_POWER;Phillips-HTS KEY_POWER" }),
5756
dotdict({ 'x':0, 'y':1, 'width':0.5, 'height':1, 'text':"Vol +", 'code':"Phillips-HTS KEY_VOLUMEUP" }),
5857
dotdict({ 'x':0, 'y':2, 'width':0.5, 'height':1, 'text':"Vol -", 'code':"Phillips-HTS KEY_VOLUMEDOWN" }),
@@ -229,7 +228,6 @@ def run(self):
229228
Style.BORDER_WIDTH: 1, Style.TEXT_COLOUR: (255, 255, 255), Style.HIGHLIGHT_COLOUR: (0, 255, 0) })
230229

231230
self.layout_buttons(test_button_layout)
232-
# self.init_gpio_interrupt_buttons(gpio_buttons)
233231
self.init_gpio_buttons(gpio_buttons)
234232
self.init_i2c_buttons(i2c_buttons)
235233

@@ -296,20 +294,14 @@ def run(self):
296294

297295
event = pygame.event.poll()
298296

299-
if self.current_button and time.time() - self.press_time > BUTTON_TIMEOUT:
300-
self.release_current_button()
301-
302297
self.screen_saver_count -= TIME_STEP
303298

304299
if self.screen_saver_count <= 0 and not self.screen_saver:
305300
self.enable_screen_saver()
306301

307302
if not waiting_for_input:
308303
self.update_display()
309-
pygame.event.set_blocked([pygame.MOUSEBUTTONDOWN, pygame.MOUSEBUTTONUP, pygame.MOUSEMOTION])
310304
self.send_ir(self.current_ir_code)
311-
time.sleep(0.1)
312-
pygame.event.set_allowed([pygame.MOUSEBUTTONDOWN, pygame.MOUSEBUTTONUP, pygame.MOUSEMOTION])
313305

314306
self.backlight.set(False)
315307
I2C.deinit()

0 commit comments

Comments
 (0)