Skip to content

Commit adc3d7d

Browse files
committed
update Python API according to review comments
1 parent 3e2236b commit adc3d7d

File tree

19 files changed

+211
-122
lines changed

19 files changed

+211
-122
lines changed

ports/nrf/bluetooth/ble_uart.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
#include "shared-bindings/_bleio/Service.h"
4141
#include "shared-bindings/_bleio/UUID.h"
4242

43-
#if CIRCUITPY_REPL_BLE
43+
#if CIRCUITPY_CONSOLE_BLE
4444

4545
static const char default_name[] = "CP-REPL"; // max 8 chars or uuid won't fit in adv data
4646
static const char NUS_UUID[] = "6e400001-b5a3-f393-e0a9-e50e24dcca9e";
@@ -188,4 +188,4 @@ void mp_hal_stdout_tx_strn(const char *str, size_t len) {
188188
}
189189
}
190190

191-
#endif // CIRCUITPY_REPL_BLE
191+
#endif // CIRCUITPY_CONSOLE_BLE

ports/nrf/supervisor/serial.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@
2828

2929
#include "supervisor/serial.h"
3030

31-
#if CIRCUITPY_REPL_BLE
31+
#if CIRCUITPY_CONSOLE_BLE
3232
#include "ble_uart.h"
33-
#elif CIRCUITPY_REPL_UART
33+
#elif CIRCUITPY_CONSOLE_UART
3434
#include <string.h>
3535
#include "nrf_gpio.h"
3636
#include "nrfx_uarte.h"
3737
#endif
3838

39-
#if CIRCUITPY_REPL_BLE
39+
#if CIRCUITPY_CONSOLE_BLE
4040

4141
void serial_init(void) {
4242
ble_uart_init();
@@ -58,7 +58,7 @@ void serial_write(const char *text) {
5858
ble_uart_stdout_tx_str(text);
5959
}
6060

61-
#elif CIRCUITPY_REPL_UART
61+
#elif CIRCUITPY_CONSOLE_UART
6262

6363
uint8_t serial_received_char;
6464
nrfx_uarte_t serial_instance = NRFX_UARTE_INSTANCE(0);
@@ -124,4 +124,4 @@ void serial_write_substring(const char *text, uint32_t len) {
124124
}
125125
}
126126

127-
#endif // CIRCUITPY_REPL_UART
127+
#endif // CIRCUITPY_CONSOLE_UART

py/circuitpy_mpconfig.mk

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,12 @@ CFLAGS += -DCIRCUITPY_DIGITALIO=$(CIRCUITPY_DIGITALIO)
133133
CIRCUITPY_COMPUTED_GOTO_SAVE_SPACE ?= 0
134134
CFLAGS += -DCIRCUITPY_COMPUTED_GOTO_SAVE_SPACE=$(CIRCUITPY_COMPUTED_GOTO_SAVE_SPACE)
135135

136+
CIRCUITPY_CONSOLE_BLE ?= 0
137+
CFLAGS += -DCIRCUITPY_CONSOLE_BLE=$(CIRCUITPY_CONSOLE_BLE)
138+
139+
CIRCUITPY_CONSOLE_UART ?= 0
140+
CFLAGS += -DCIRCUITPY_CONSOLE_UART=$(CIRCUITPY_CONSOLE_UART)
141+
136142
CIRCUITPY_COUNTIO ?= $(CIRCUITPY_FULL_BUILD)
137143
CFLAGS += -DCIRCUITPY_COUNTIO=$(CIRCUITPY_COUNTIO)
138144

@@ -246,12 +252,6 @@ CFLAGS += -DCIRCUITPY_RE=$(CIRCUITPY_RE)
246252
CIRCUITPY_RE_DEBUG ?= 0
247253
CFLAGS += -DCIRCUITPY_RE_DEBUG=$(CIRCUITPY_RE_DEBUG)
248254

249-
CIRCUITPY_REPL_BLE ?= 0
250-
CFLAGS += -DCIRCUITPY_REPL_BLE=$(CIRCUITPY_REPL_BLE)
251-
252-
CIRCUITPY_REPL_UART ?= 0
253-
CFLAGS += -DCIRCUITPY_REPL_UART=$(CIRCUITPY_REPL_UART)
254-
255255
# Should busio.I2C() check for pullups?
256256
# Some boards in combination with certain peripherals may not want this.
257257
CIRCUITPY_REQUIRE_I2C_PULLUPS ?= 1
@@ -337,8 +337,8 @@ CFLAGS += -DCIRCUITPY_USB=$(CIRCUITPY_USB)
337337

338338
CIRCUITPY_USB_CDC ?= 1
339339
CFLAGS += -DCIRCUITPY_USB_CDC=$(CIRCUITPY_USB_CDC)
340-
CIRCUITPY_USB_CDC_REPL_ENABLED_DEFAULT ?= 1
341-
CFLAGS += -DCIRCUITPY_USB_CDC_REPL_ENABLED_DEFAULT=$(CIRCUITPY_USB_CDC_REPL_ENABLED_DEFAULT)
340+
CIRCUITPY_USB_CDC_CONSOLE_ENABLED_DEFAULT ?= 1
341+
CFLAGS += -DCIRCUITPY_USB_CDC_CONSOLE_ENABLED_DEFAULT=$(CIRCUITPY_USB_CDC_CONSOLE_ENABLED_DEFAULT)
342342
CIRCUITPY_USB_CDC_DATA_ENABLED_DEFAULT ?= 0
343343
CFLAGS += -DCIRCUITPY_USB_CDC_DATA_ENABLED_DEFAULT=$(CIRCUITPY_USB_CDC_DATA_ENABLED_DEFAULT)
344344

shared-bindings/storage/__init__.c

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -158,33 +158,45 @@ mp_obj_t storage_erase_filesystem(void) {
158158
}
159159
MP_DEFINE_CONST_FUN_OBJ_0(storage_erase_filesystem_obj, storage_erase_filesystem);
160160

161-
//| def configure_usb(enabled: bool = True) -> None:
162-
//| """Configure the USB mass storage device.
163-
//| Enable or disable presenting ``CIRCUITPY`` as a USB mass storage device.
161+
//| def disable_usb_drive() -> None:
162+
//| """Disable presenting ``CIRCUITPY`` as a USB mass storage device.
164163
//| By default, the device is enabled and ``CIRCUITPY`` is visible.
165-
//| Can be called in ``boot.py``, before USB is connected.
164+
//| Can be called in ``boot.py``, before USB is connected."""
165+
//| ...
166166
//|
167-
//| :param enabled bool: Enable or disable the USB mass storage device.
168-
//| True to enable; False to disable. Enabled by default."""
167+
STATIC mp_obj_t storage_disable_usb_drive(void) {
168+
if (!common_hal_storage_disable_usb_drive()) {
169+
mp_raise_RuntimeError(translate("Cannot change usb devices now"));
170+
}
171+
return mp_const_none;
172+
}
173+
MP_DEFINE_CONST_FUN_OBJ_0(storage_disable_usb_drive_obj, storage_disable_usb_drive);
174+
175+
//| def enable_usb_drive() -> None:
176+
//| """Enabled presenting ``CIRCUITPY`` as a USB mass storage device.
177+
//| By default, the device is enabled and ``CIRCUITPY`` is visible,
178+
//| so you do not normally need to call this function.
179+
//| Can be called in ``boot.py``, before USB is connected."""
169180
//| ...
170181
//|
171-
STATIC mp_obj_t storage_configure_usb(mp_obj_t enabled) {
172-
if (!common_hal_storage_configure_usb(mp_obj_is_true(enabled))) {
182+
STATIC mp_obj_t storage_enable_usb_drive(void) {
183+
if (!common_hal_storage_enable_usb_drive()) {
173184
mp_raise_RuntimeError(translate("Cannot change usb devices now"));
174185
}
175186
return mp_const_none;
176187
}
177-
MP_DEFINE_CONST_FUN_OBJ_1(storage_configure_usb_obj, storage_configure_usb);
188+
MP_DEFINE_CONST_FUN_OBJ_0(storage_enable_usb_drive_obj, storage_enable_usb_drive);
178189

179190
STATIC const mp_rom_map_elem_t storage_module_globals_table[] = {
180191
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_storage) },
181192

182-
{ MP_ROM_QSTR(MP_QSTR_mount), MP_ROM_PTR(&storage_mount_obj) },
183-
{ MP_ROM_QSTR(MP_QSTR_umount), MP_ROM_PTR(&storage_umount_obj) },
184-
{ MP_ROM_QSTR(MP_QSTR_remount), MP_ROM_PTR(&storage_remount_obj) },
185-
{ MP_ROM_QSTR(MP_QSTR_getmount), MP_ROM_PTR(&storage_getmount_obj) },
186-
{ MP_ROM_QSTR(MP_QSTR_erase_filesystem), MP_ROM_PTR(&storage_erase_filesystem_obj) },
187-
{ MP_ROM_QSTR(MP_QSTR_configure_usb), MP_ROM_PTR(&storage_configure_usb_obj) },
193+
{ MP_ROM_QSTR(MP_QSTR_mount), MP_ROM_PTR(&storage_mount_obj) },
194+
{ MP_ROM_QSTR(MP_QSTR_umount), MP_ROM_PTR(&storage_umount_obj) },
195+
{ MP_ROM_QSTR(MP_QSTR_remount), MP_ROM_PTR(&storage_remount_obj) },
196+
{ MP_ROM_QSTR(MP_QSTR_getmount), MP_ROM_PTR(&storage_getmount_obj) },
197+
{ MP_ROM_QSTR(MP_QSTR_erase_filesystem), MP_ROM_PTR(&storage_erase_filesystem_obj) },
198+
{ MP_ROM_QSTR(MP_QSTR_disable_usb_drive), MP_ROM_PTR(&storage_disable_usb_drive_obj) },
199+
{ MP_ROM_QSTR(MP_QSTR_enable_usb_drive), MP_ROM_PTR(&storage_enable_usb_drive_obj) },
188200

189201
//| class VfsFat:
190202
//| def __init__(self, block_device: str) -> None:

shared-bindings/storage/__init__.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ void common_hal_storage_umount_object(mp_obj_t vfs_obj);
3838
void common_hal_storage_remount(const char *path, bool readonly, bool disable_concurrent_write_protection);
3939
mp_obj_t common_hal_storage_getmount(const char *path);
4040
void common_hal_storage_erase_filesystem(void);
41-
bool common_hal_storage_configure_usb(bool enabled);
41+
42+
bool common_hal_storage_disable_usb_drive(void);
43+
bool common_hal_storage_enable_usb_drive(void);
4244

4345
#endif // MICROPY_INCLUDED_SHARED_BINDINGS_STORAGE___INIT___H

shared-bindings/usb_cdc/__init__.c

Lines changed: 45 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -39,60 +39,77 @@
3939
//| The `usb_cdc` module allows access to USB CDC (serial) communications.
4040
//|
4141
//| On Windows, each `Serial` is visible as a separate COM port. The ports will often
42-
//| be assigned consecutively, REPL first, but this is not always true.
42+
//| be assigned consecutively, `console` first, but this is not always true.
4343
//|
44-
//| On Linux, the ports are typically ``/dev/ttyACM0`` and ``/dev/ttyACM1``. The REPL
45-
//| is usually first.
44+
//| On Linux, the ports are typically ``/dev/ttyACM0`` and ``/dev/ttyACM1``.
45+
//| The `console` port will usually be first.
4646
//|
4747
//| On MacOS, the ports are typically ``/dev/cu.usbmodem<something>``. The something
48-
//| varies based on the USB bus and port used. The REPL is usually first.
48+
//| varies based on the USB bus and port used. The `console` port will usually be first.
4949
//| """
5050
//|
51-
//| repl: Optional[Serial]
52-
//| """The `Serial` object that can be used to communicate over the REPL serial
53-
//| channel. ``None`` if disabled.
51+
//| console: Optional[Serial]
52+
//| """The `console` `Serial` object is used for the REPL, and for `sys.stdin` and `sys.stdout`.
53+
//| `console` is ``None`` if disabled.
5454
//|
55-
//| Note that`sys.stdin` and `sys.stdout` are also connected to the REPL, though
56-
//| they are text-based streams, and the `repl` object is a binary stream."""
55+
//| However, note that`sys.stdin` and `sys.stdout` are text-based streams,
56+
//| and the `console` object is a binary stream.
57+
//| You do not normally need to write to `console` unless you wnat to write binary data.
58+
//| """
5759
//|
5860
//| data: Optional[Serial]
5961
//| """A `Serial` object that can be used to send and receive binary data to and from
6062
//| the host.
61-
//| Note that `data` is *disabled* by default."""
63+
//| Note that `data` is *disabled* by default. ``data`` is ``None`` if disabled."""
64+
65+
//| def disable() -> None:
66+
//| """Do not present any USB CDC device to the host.
67+
//| Can be called in ``boot.py``, before USB is connected.
68+
//| Equivalent to ``usb_cdc.enable(console=False, data=False)``."""
69+
//| ...
70+
//|
71+
STATIC mp_obj_t usb_cdc_disable(void) {
72+
if (!common_hal_usb_cdc_disable()) {
73+
mp_raise_RuntimeError(translate("Cannot change USB devices now"));
74+
}
75+
return mp_const_none;
76+
}
77+
MP_DEFINE_CONST_FUN_OBJ_0(usb_cdc_disable_obj, usb_cdc_disable);
6278

63-
//| def configure_usb(*, repl_enabled: bool = True, data_enabled: bool = False) -> None:
64-
//| """Configure the USB CDC devices. Can be called in ``boot.py``, before USB is connected.
79+
//| def enable(*, console: bool = True, data: bool = False) -> None:
80+
//| """Enable or disable each CDC device. Can be called in ``boot.py``, before USB is connected.
6581
//|
66-
//| :param repl_enabled bool: Enable or disable the `repl` USB serial device.
82+
//| :param console bool: Enable or disable the `console` USB serial device.
6783
//| True to enable; False to disable. Enabled by default.
68-
//| :param data_enabled bool: Enable or disable the `data` USB serial device.
84+
//| :param data bool: Enable or disable the `data` USB serial device.
6985
//| True to enable; False to disable. *Disabled* by default."""
7086
//| ...
7187
//|
72-
STATIC mp_obj_t usb_cdc_configure_usb(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
73-
enum { ARG_repl_enabled, ARG_data_enabled };
88+
STATIC mp_obj_t usb_cdc_enable(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
89+
enum { ARG_console, ARG_data };
7490
static const mp_arg_t allowed_args[] = {
75-
{ MP_QSTR_repl_enabled, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = true } },
76-
{ MP_QSTR_data_enabled, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = false } },
91+
{ MP_QSTR_console, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = true } },
92+
{ MP_QSTR_data, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = false } },
7793
};
7894
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
7995
mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
8096

81-
if (!common_hal_usb_cdc_configure_usb(args[ARG_repl_enabled].u_bool, args[ARG_data_enabled].u_bool)) {
97+
if (!common_hal_usb_cdc_enable(args[ARG_console].u_bool, args[ARG_data].u_bool)) {
8298
mp_raise_RuntimeError(translate("Cannot change USB devices now"));
8399
}
84100
return mp_const_none;
85101
}
86-
MP_DEFINE_CONST_FUN_OBJ_KW(usb_cdc_configure_usb_obj, 0, usb_cdc_configure_usb);
102+
MP_DEFINE_CONST_FUN_OBJ_KW(usb_cdc_enable_obj, 0, usb_cdc_enable);
87103

88-
// The usb_cdc module dict is mutable so that .repl and .data may
104+
// The usb_cdc module dict is mutable so that .console and .data may
89105
// be set to a Serial or to None depending on whether they are enabled or not.
90106
static mp_map_elem_t usb_cdc_module_globals_table[] = {
91-
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_usb_cdc) },
92-
{ MP_ROM_QSTR(MP_QSTR_Serial), MP_OBJ_FROM_PTR(&usb_cdc_serial_type) },
93-
{ MP_ROM_QSTR(MP_QSTR_repl), mp_const_none },
94-
{ MP_ROM_QSTR(MP_QSTR_data), mp_const_none },
95-
{ MP_ROM_QSTR(MP_QSTR_configure_usb), MP_OBJ_FROM_PTR(&usb_cdc_configure_usb_obj) },
107+
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_usb_cdc) },
108+
{ MP_ROM_QSTR(MP_QSTR_Serial), MP_OBJ_FROM_PTR(&usb_cdc_serial_type) },
109+
{ MP_ROM_QSTR(MP_QSTR_console), mp_const_none },
110+
{ MP_ROM_QSTR(MP_QSTR_data), mp_const_none },
111+
{ MP_ROM_QSTR(MP_QSTR_disable), MP_OBJ_FROM_PTR(&usb_cdc_disable_obj) },
112+
{ MP_ROM_QSTR(MP_QSTR_enable), MP_OBJ_FROM_PTR(&usb_cdc_enable_obj) },
96113
};
97114

98115
static MP_DEFINE_MUTABLE_DICT(usb_cdc_module_globals, usb_cdc_module_globals_table);
@@ -109,8 +126,8 @@ static void set_module_dict_entry(mp_obj_t key_qstr, mp_obj_t serial_obj) {
109126
}
110127
}
111128

112-
void usb_cdc_set_repl(mp_obj_t serial_obj) {
113-
set_module_dict_entry(MP_ROM_QSTR(MP_QSTR_repl), serial_obj);
129+
void usb_cdc_set_console(mp_obj_t serial_obj) {
130+
set_module_dict_entry(MP_ROM_QSTR(MP_QSTR_console), serial_obj);
114131
}
115132

116133
void usb_cdc_set_data(mp_obj_t serial_obj) {

shared-bindings/usb_cdc/__init__.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@
3030
#include "shared-module/usb_cdc/__init__.h"
3131

3232
// Set the module dict entries.
33-
void usb_cdc_set_repl(mp_obj_t serial_obj);
33+
void usb_cdc_set_console(mp_obj_t serial_obj);
3434
void usb_cdc_set_data(mp_obj_t serial_obj);
3535

36-
extern bool common_hal_usb_cdc_configure_usb(bool repl_enabled, bool data_enabled);
36+
extern bool common_hal_usb_cdc_disable(void);
37+
extern bool common_hal_usb_cdc_enable(bool console, bool data);
3738

3839
#endif // MICROPY_INCLUDED_SHARED_BINDINGS_USB_CDC___INIT___H

shared-bindings/usb_hid/Device.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
//|
4141

4242
//| def __init__(self, *, descriptor: ReadableBuffer, usage_page: int, usage: int, in_report_length: int, out_report_length: int = 0, report_id_index: Optional[int]) -> None:
43-
//| """Create a description of a USB HID device. To create an actual device,
44-
//| pass a `Device` to `usb_hid.configure_usb()`.
43+
//| """Create a description of a USB HID device. The actual device is created when you
44+
//| pass a `Device` to `usb_hid.enable()`.
4545
//|
4646
//| :param ReadableBuffer report_descriptor: The USB HID Report descriptor bytes. The descriptor is not
4747
//| not verified for correctness; it is up to you to make sure it is not malformed.

shared-bindings/usb_hid/__init__.c

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,19 @@
4040
//| """Tuple of all active HID device interfaces."""
4141
//|
4242

43-
//| def configure_usb(devices: Optional[Sequence[Device]]) -> None:
44-
//| """Configure the USB HID devices that will be available.
43+
//| def disable() -> None:
44+
//| """Do not present any USB HID devices to the host computer.
45+
//| Can be called in ``boot.py``, before USB is connected."""
46+
STATIC mp_obj_t usb_hid_disable(void) {
47+
if (!common_hal_usb_hid_disable()) {
48+
mp_raise_RuntimeError(translate("Cannot change USB devices now"));
49+
}
50+
return mp_const_none;
51+
}
52+
MP_DEFINE_CONST_FUN_OBJ_0(usb_hid_disable_obj, usb_hid_disable);
53+
54+
//| def enable(devices: Optional[Sequence[Device]]) -> None:
55+
//| """Specify which USB HID devices that will be available.
4556
//| Can be called in ``boot.py``, before USB is connected.
4657
//|
4758
//| :param Sequence devices: `Device` objects.
@@ -51,7 +62,7 @@
5162
//| """
5263
//| ...
5364
//|
54-
STATIC mp_obj_t usb_hid_configure_usb(mp_obj_t devices) {
65+
STATIC mp_obj_t usb_hid_enable(mp_obj_t devices) {
5566
const mp_int_t len = mp_obj_get_int(mp_obj_len(devices));
5667
for (mp_int_t i = 0; i < len; i++) {
5768
mp_obj_t item = mp_obj_subscr(devices, MP_OBJ_NEW_SMALL_INT(i), MP_OBJ_SENTINEL);
@@ -60,20 +71,21 @@ STATIC mp_obj_t usb_hid_configure_usb(mp_obj_t devices) {
6071
}
6172
}
6273

63-
if (!common_hal_usb_hid_configure_usb(devices)) {
74+
if (!common_hal_usb_hid_enable(devices)) {
6475
mp_raise_RuntimeError(translate("Cannot change USB devices now"));
6576
}
6677

6778
return mp_const_none;
6879
}
69-
MP_DEFINE_CONST_FUN_OBJ_1(usb_hid_configure_usb_obj, usb_hid_configure_usb);
80+
MP_DEFINE_CONST_FUN_OBJ_1(usb_hid_enable_obj, usb_hid_enable);
7081

7182
// usb_hid.devices is set once the usb devices are determined, after boot.py runs.
7283
STATIC mp_map_elem_t usb_hid_module_globals_table[] = {
73-
{ MP_ROM_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR_usb_hid) },
74-
{ MP_ROM_QSTR(MP_QSTR_configure_usb), MP_OBJ_FROM_PTR(&usb_hid_configure_usb_obj) },
75-
{ MP_ROM_QSTR(MP_QSTR_devices), mp_const_none },
76-
{ MP_ROM_QSTR(MP_QSTR_Device), MP_OBJ_FROM_PTR(&usb_hid_device_type) },
84+
{ MP_ROM_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR_usb_hid) },
85+
{ MP_ROM_QSTR(MP_QSTR_Device), MP_OBJ_FROM_PTR(&usb_hid_device_type) },
86+
{ MP_ROM_QSTR(MP_QSTR_devices), mp_const_none },
87+
{ MP_ROM_QSTR(MP_QSTR_disable), MP_OBJ_FROM_PTR(&usb_hid_disable_obj) },
88+
{ MP_ROM_QSTR(MP_QSTR_enable), MP_OBJ_FROM_PTR(&usb_hid_enable_obj) },
7789
};
7890

7991
STATIC MP_DEFINE_MUTABLE_DICT(usb_hid_module_globals, usb_hid_module_globals_table);

shared-bindings/usb_hid/__init__.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ extern mp_obj_tuple_t common_hal_usb_hid_devices;
3535

3636
void usb_hid_set_devices(mp_obj_t devices);
3737

38-
bool common_hal_usb_hid_configure_usb(const mp_obj_t devices_seq);
38+
bool common_hal_usb_hid_disable(void);
39+
bool common_hal_usb_hid_enable(const mp_obj_t devices_seq);
3940

4041
#endif // SHARED_BINDINGS_USB_HID_H

0 commit comments

Comments
 (0)