Skip to content

Commit d57f3c8

Browse files
authored
Merge pull request #8242 from tannewt/check_host_init
Two small changes
2 parents 8664a06 + af0245a commit d57f3c8

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

locale/circuitpython.pot

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1536,6 +1536,10 @@ msgstr ""
15361536
msgid "No timer available"
15371537
msgstr ""
15381538

1539+
#: shared-module/usb/core/Device.c
1540+
msgid "No usb host port initialized"
1541+
msgstr ""
1542+
15391543
#: ports/nrf/common-hal/_bleio/__init__.c
15401544
msgid "Nordic system firmware out of memory"
15411545
msgstr ""

ports/raspberrypi/link.ld

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ SECTIONS
211211
_ld_dtcm_data_flash_copy = LOADADDR(.dtcm_data);
212212
_ld_dtcm_data_size = SIZEOF(.dtcm_data);
213213

214-
.dtcm_bss :
214+
.dtcm_bss (NOLOAD) :
215215
{
216216
. = ALIGN(4);
217217

shared-module/usb/core/Device.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ void tuh_umount_cb(uint8_t dev_addr) {
5151
STATIC xfer_result_t _xfer_result;
5252
STATIC size_t _actual_len;
5353
bool common_hal_usb_core_device_construct(usb_core_device_obj_t *self, uint8_t device_number) {
54+
if (!tuh_inited()) {
55+
mp_raise_RuntimeError(translate("No usb host port initialized"));
56+
}
57+
5458
if (device_number == 0 || device_number > CFG_TUH_DEVICE_MAX + CFG_TUH_HUB) {
5559
return false;
5660
}

0 commit comments

Comments
 (0)