From 2629614eafafbd6f58a3cfd8447f222a65e11ea1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 27 Feb 2026 21:42:33 +0000 Subject: [PATCH 1/6] Initial plan From 969441fda2ab095f991742de1d109fba7ee071b0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 27 Feb 2026 21:47:05 +0000 Subject: [PATCH 2/6] Skip EEPROM programming prompt when running in the simulator Co-authored-by: lincoltd7 <117526452+lincoltd7@users.noreply.github.com> --- app.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app.py b/app.py index 8867065..dc12525 100644 --- a/app.py +++ b/app.py @@ -2,6 +2,7 @@ #import aioble #import bluetooth import os +import sys import time from math import cos, pi import ota @@ -151,6 +152,7 @@ #Misceallaneous Settings _LOGGING = False _ERASE_SLOT = 0 # Slot for user to set if they want to erase EEPROMs on HexDrives +_IS_SIMULATOR = sys.platform != "rp2" # True when running in the simulator, not on real badge hardware # _main_menu_items = ["Motor Moves", "Stepper Test", "Servo Test", "Settings", "About","Exit"] @@ -444,6 +446,9 @@ def check_port_for_hexdrive(self, port: int) -> bool: return False except RuntimeError: # not a valid header + if _IS_SIMULATOR: + # In the simulator there is no real EEPROM hardware, so skip the programming prompt + return False if self._settings['logging'].v: print(f"H:Found EEPROM on port {port}") self.ports_with_blank_eeprom.add(port) From afb193c47ef5468bf0c6c55fde76aad67726d8c1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 28 Feb 2026 13:34:42 +0000 Subject: [PATCH 3/6] Fix simulator compatibility: SyntaxWarning and Timer ImportError Co-authored-by: lincoltd7 <117526452+lincoltd7@users.noreply.github.com> --- app.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app.py b/app.py index dc12525..67868c8 100644 --- a/app.py +++ b/app.py @@ -13,7 +13,11 @@ from app_components import Menu from events.input import BUTTON_TYPES, Button, Buttons, ButtonUpEvent from frontboards.twentyfour import BUTTONS -from machine import I2C, Timer +from machine import I2C +try: + from machine import Timer +except ImportError: + Timer = None from system.eventbus import eventbus from system.hexpansion.events import (HexpansionInsertionEvent, HexpansionRemovalEvent) @@ -638,7 +642,7 @@ def erase_eeprom(self, port: int, addr: int) -> bool: def find_hexdrive_app(self, port: int) -> app: for an_app in scheduler.apps: - if type(an_app).__name__ is 'HexDriveApp': + if type(an_app).__name__ == 'HexDriveApp': if hasattr(an_app, "config") and hasattr(an_app.config, "port") and an_app.config.port == port: return an_app return None @@ -1928,7 +1932,7 @@ def __init__(self, container, hexdrive_app, step_size: int = 1, steps_per_rev: i self._hexdrive_app = hexdrive_app self._phase = 0 self._calibrated = False - self._timer = Timer(timer_id) + self._timer = Timer(timer_id) if Timer is not None else None self._timer_is_running = False self._timer_mode = 0 self._free_run_mode = 0 # direction of free run mode @@ -2068,6 +2072,8 @@ def track_target(self): self._update_timer((2//self._step_size)*abs(self._steps_per_sec)) # half steps per second def _update_timer(self,freq): + if self._timer is None: + return if self._timer_is_running and freq != self._freq: try: self._timer.deinit() From b4a23b6d5834b783e6593209b29cf0647efd8226 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 28 Feb 2026 13:47:58 +0000 Subject: [PATCH 4/6] Plan: fix RuntimeWarning for unawaited coroutine Co-authored-by: lincoltd7 <117526452+lincoltd7@users.noreply.github.com> --- app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.py b/app.py index 67868c8..087ae5d 100644 --- a/app.py +++ b/app.py @@ -327,7 +327,7 @@ def __init__(self): #aioble.register_services(self.ble_service) # We start with focus on launch, without an event emmited - self._gain_focus(RequestForegroundPushEvent(self)) + await self._gain_focus(RequestForegroundPushEvent(self)) ### ASYNC EVENT HANDLERS ### From 5fb89cf1aa1dc8d9d15a6559a46dd54ea1943cae Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 28 Feb 2026 13:49:30 +0000 Subject: [PATCH 5/6] Fix RuntimeWarning: use asyncio.create_task() instead of bare coroutine call in __init__ Co-authored-by: lincoltd7 <117526452+lincoltd7@users.noreply.github.com> --- app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.py b/app.py index 087ae5d..bcda07f 100644 --- a/app.py +++ b/app.py @@ -327,7 +327,7 @@ def __init__(self): #aioble.register_services(self.ble_service) # We start with focus on launch, without an event emmited - await self._gain_focus(RequestForegroundPushEvent(self)) + asyncio.create_task(self._gain_focus(RequestForegroundPushEvent(self))) ### ASYNC EVENT HANDLERS ### From c794ac6ee0b34b7ebf3614dd57af3474d9ab7f41 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 28 Feb 2026 14:57:44 +0000 Subject: [PATCH 6/6] Fix: use asyncio.get_event_loop().create_task() instead of asyncio.create_task() Co-authored-by: lincoltd7 <117526452+lincoltd7@users.noreply.github.com> --- app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.py b/app.py index bcda07f..2756fdb 100644 --- a/app.py +++ b/app.py @@ -327,7 +327,7 @@ def __init__(self): #aioble.register_services(self.ble_service) # We start with focus on launch, without an event emmited - asyncio.create_task(self._gain_focus(RequestForegroundPushEvent(self))) + asyncio.get_event_loop().create_task(self._gain_focus(RequestForegroundPushEvent(self))) ### ASYNC EVENT HANDLERS ###