Merge pull request #8242 from tannewt/check_host_init
Two small changes
This commit is contained in:
commit
d57f3c888d
@ -1536,6 +1536,10 @@ msgstr ""
|
|||||||
msgid "No timer available"
|
msgid "No timer available"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: shared-module/usb/core/Device.c
|
||||||
|
msgid "No usb host port initialized"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: ports/nrf/common-hal/_bleio/__init__.c
|
#: ports/nrf/common-hal/_bleio/__init__.c
|
||||||
msgid "Nordic system firmware out of memory"
|
msgid "Nordic system firmware out of memory"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -211,7 +211,7 @@ SECTIONS
|
|||||||
_ld_dtcm_data_flash_copy = LOADADDR(.dtcm_data);
|
_ld_dtcm_data_flash_copy = LOADADDR(.dtcm_data);
|
||||||
_ld_dtcm_data_size = SIZEOF(.dtcm_data);
|
_ld_dtcm_data_size = SIZEOF(.dtcm_data);
|
||||||
|
|
||||||
.dtcm_bss :
|
.dtcm_bss (NOLOAD) :
|
||||||
{
|
{
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
|
|
||||||
|
@ -51,6 +51,10 @@ void tuh_umount_cb(uint8_t dev_addr) {
|
|||||||
STATIC xfer_result_t _xfer_result;
|
STATIC xfer_result_t _xfer_result;
|
||||||
STATIC size_t _actual_len;
|
STATIC size_t _actual_len;
|
||||||
bool common_hal_usb_core_device_construct(usb_core_device_obj_t *self, uint8_t device_number) {
|
bool common_hal_usb_core_device_construct(usb_core_device_obj_t *self, uint8_t device_number) {
|
||||||
|
if (!tuh_inited()) {
|
||||||
|
mp_raise_RuntimeError(translate("No usb host port initialized"));
|
||||||
|
}
|
||||||
|
|
||||||
if (device_number == 0 || device_number > CFG_TUH_DEVICE_MAX + CFG_TUH_HUB) {
|
if (device_number == 0 || device_number > CFG_TUH_DEVICE_MAX + CFG_TUH_HUB) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user