Skip to content

Commit 8e9dc37

Browse files
committed
pbio/drv/core: Drop ioport quirk that delayed boot by 500ms.
This workaround is no longer needed after recent fixes to the LEGO UART protocol handler. See pybricks/support#747 for rationale.
1 parent cc0c062 commit 8e9dc37

File tree

6 files changed

+0
-18
lines changed

6 files changed

+0
-18
lines changed

lib/pbio/drv/core.c

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -73,25 +73,12 @@ void pbdrv_init(void) {
7373
__asm volatile ("cpsie i" : : : "memory");
7474
#endif
7575

76-
// Some hubs turn on power to the I/O ports in the bootloader. This causes
77-
// us to miss the initial synchronization window, so we lose more time.
78-
// This is fixed by power cycling them here and allowing some reset time.
79-
#if PBDRV_CONFIG_IOPORT_PUP_QUIRK_POWER_CYCLE
80-
pbdrv_ioport_enable_vcc(false);
81-
uint32_t ioport_reset_time = pbdrv_clock_get_ms();
82-
#endif
83-
8476
// Wait for all async pbdrv drivers to initialize before starting
8577
// higher level system processes.
8678
while (pbio_busy_count_busy()) {
8779
pbio_os_run_processes_once();
8880
}
8981

90-
#if PBDRV_CONFIG_IOPORT_PUP_QUIRK_POWER_CYCLE
91-
while (pbdrv_clock_get_ms() - ioport_reset_time < 500) {
92-
pbio_os_run_processes_once();
93-
}
94-
#endif
9582
pbdrv_ioport_enable_vcc(true);
9683
}
9784

lib/pbio/platform/city_hub/pbdrvconfig.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
#define PBDRV_CONFIG_IOPORT (1)
4646
#define PBDRV_CONFIG_IOPORT_HAS_ADC (0)
4747
#define PBDRV_CONFIG_IOPORT_NUM_DEV (2)
48-
#define PBDRV_CONFIG_IOPORT_PUP_QUIRK_POWER_CYCLE (1)
4948

5049
#define PBDRV_CONFIG_LED (1)
5150
#define PBDRV_CONFIG_LED_NUM_DEV (1)

lib/pbio/platform/essential_hub/pbdrvconfig.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@
6969
#define PBDRV_CONFIG_IOPORT (1)
7070
#define PBDRV_CONFIG_IOPORT_HAS_ADC (0)
7171
#define PBDRV_CONFIG_IOPORT_NUM_DEV (2)
72-
#define PBDRV_CONFIG_IOPORT_PUP_QUIRK_POWER_CYCLE (0)
7372

7473
#define PBDRV_CONFIG_LED (1)
7574
#define PBDRV_CONFIG_LED_NUM_DEV (2)

lib/pbio/platform/move_hub/pbdrvconfig.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
#define PBDRV_CONFIG_IOPORT (1)
4545
#define PBDRV_CONFIG_IOPORT_HAS_ADC (0)
4646
#define PBDRV_CONFIG_IOPORT_NUM_DEV (4)
47-
#define PBDRV_CONFIG_IOPORT_PUP_QUIRK_POWER_CYCLE (0)
4847

4948
#define PBDRV_CONFIG_LED (1)
5049
#define PBDRV_CONFIG_LED_NUM_DEV (1)

lib/pbio/platform/prime_hub/pbdrvconfig.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@
7070
#define PBDRV_CONFIG_IOPORT (1)
7171
#define PBDRV_CONFIG_IOPORT_HAS_ADC (0)
7272
#define PBDRV_CONFIG_IOPORT_NUM_DEV (6)
73-
#define PBDRV_CONFIG_IOPORT_PUP_QUIRK_POWER_CYCLE (0)
7473

7574
#define PBDRV_CONFIG_LED (1)
7675
#define PBDRV_CONFIG_LED_NUM_DEV (5)

lib/pbio/platform/technic_hub/pbdrvconfig.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
#define PBDRV_CONFIG_IOPORT (1)
5656
#define PBDRV_CONFIG_IOPORT_HAS_ADC (0)
5757
#define PBDRV_CONFIG_IOPORT_NUM_DEV (4)
58-
#define PBDRV_CONFIG_IOPORT_PUP_QUIRK_POWER_CYCLE (1)
5958

6059
#define PBDRV_CONFIG_LED (1)
6160
#define PBDRV_CONFIG_LED_NUM_DEV (1)

0 commit comments

Comments
 (0)