@@ -188,30 +188,12 @@ def keypad_read_cb(indev, data):
188188 current_key = lv .KEY .END
189189 else :
190190 # Check joystick
191- angle = read_joystick_angle (0.30 ) # 0.25-0.27 is right on the edge so 0.30 seems good
192- if angle and time .time () < 60 :
193- print (f"got joystick angle: { angle } " )
194- #gc.collect()
195- print ("Memory after joystick:" , end = " " )
196- micropython .mem_info ()
191+ angle = read_joystick_angle (0.30 ) # 0.25-0.27 is right on the edge so 0.30 should be good
192+ if angle :
197193 try :
198194 mpos .ui .focus_direction .move_focus_direction (angle )
199195 except Exception as e :
200- print (f"Error in move_focus_direction: { e } " )
201- print (f"after joystick angle: { angle } " )
202- #gc.collect()
203- print ("Memory after joystick:" , end = " " )
204- micropython .mem_info ()
205- else : # old behavior
206- joystick = read_joystick ()
207- if joystick == "LEFT" :
208- current_key = lv .KEY .LEFT
209- elif joystick == "RIGHT" :
210- current_key = lv .KEY .RIGHT
211- elif joystick == "UP" :
212- current_key = lv .KEY .UP
213- elif joystick == "DOWN" :
214- current_key = lv .KEY .DOWN
196+ print (f"Exception from move_focus_direction: { e } " )
215197
216198 # Key repeat logic
217199 if current_key :
@@ -223,7 +205,7 @@ def keypad_read_cb(indev, data):
223205 last_state = lv .INDEV_STATE .PRESSED
224206 key_press_start = current_time
225207 last_repeat_time = current_time
226- else :
208+ else : # same key
227209 # Key held: Check for repeat
228210 elapsed = time .ticks_diff (current_time , key_press_start )
229211 since_last_repeat = time .ticks_diff (current_time , last_repeat_time )
0 commit comments