You've already forked MicroPythonOS
mirror of
https://github.com/m5stack/MicroPythonOS.git
synced 2026-05-20 11:51:27 -07:00
fri3d-2024: less debugging output
This commit is contained in:
@@ -188,30 +188,12 @@ def keypad_read_cb(indev, data):
|
||||
current_key = lv.KEY.END
|
||||
else:
|
||||
# Check joystick
|
||||
angle = read_joystick_angle(0.30) # 0.25-0.27 is right on the edge so 0.30 seems good
|
||||
if angle and time.time() < 60:
|
||||
print(f"got joystick angle: {angle}")
|
||||
#gc.collect()
|
||||
print("Memory after joystick:", end=" ")
|
||||
micropython.mem_info()
|
||||
angle = read_joystick_angle(0.30) # 0.25-0.27 is right on the edge so 0.30 should be good
|
||||
if angle:
|
||||
try:
|
||||
mpos.ui.focus_direction.move_focus_direction(angle)
|
||||
except Exception as e:
|
||||
print(f"Error in move_focus_direction: {e}")
|
||||
print(f"after joystick angle: {angle}")
|
||||
#gc.collect()
|
||||
print("Memory after joystick:", end=" ")
|
||||
micropython.mem_info()
|
||||
else: # old behavior
|
||||
joystick = read_joystick()
|
||||
if joystick == "LEFT":
|
||||
current_key = lv.KEY.LEFT
|
||||
elif joystick == "RIGHT":
|
||||
current_key = lv.KEY.RIGHT
|
||||
elif joystick == "UP":
|
||||
current_key = lv.KEY.UP
|
||||
elif joystick == "DOWN":
|
||||
current_key = lv.KEY.DOWN
|
||||
print(f"Exception from move_focus_direction: {e}")
|
||||
|
||||
# Key repeat logic
|
||||
if current_key:
|
||||
@@ -223,7 +205,7 @@ def keypad_read_cb(indev, data):
|
||||
last_state = lv.INDEV_STATE.PRESSED
|
||||
key_press_start = current_time
|
||||
last_repeat_time = current_time
|
||||
else:
|
||||
else: # same key
|
||||
# Key held: Check for repeat
|
||||
elapsed = time.ticks_diff(current_time, key_press_start)
|
||||
since_last_repeat = time.ticks_diff(current_time, last_repeat_time)
|
||||
|
||||
@@ -194,7 +194,7 @@ def move_focus_direction(angle):
|
||||
if isinstance(current_focused, lv.dropdown) and current_focused.is_open():
|
||||
print("focus is on an open dropdown, which has its own move_focus_direction: NOT moving")
|
||||
return
|
||||
o = find_closest_obj_in_direction(focus_group, current_focused, angle, True)
|
||||
o = find_closest_obj_in_direction(focus_group, current_focused, angle, False)
|
||||
if o:
|
||||
print("move_focus_direction: moving focus to:")
|
||||
mpos.util.print_lvgl_widget(o)
|
||||
|
||||
Reference in New Issue
Block a user