Skip to content

Commit b63d422

Browse files
committed
Fix more boards and docs
1 parent 3321442 commit b63d422

File tree

12 files changed

+25
-37
lines changed

12 files changed

+25
-37
lines changed

docs/supported_ports.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Additional testing is limited.
2020
../ports/mimxrt10xx/README
2121
../ports/nordic/README
2222
../ports/raspberrypi/README
23+
../ports/renode/README
2324
../ports/silabs/README
2425
../ports/stm/README
2526
../ports/unix/README

ports/espressif/supervisor/internal_flash.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@
4343

4444
#include "supervisor/filesystem.h"
4545
#include "supervisor/flash.h"
46+
47+
#if CIRCUITPY_USB
4648
#include "supervisor/usb.h"
49+
#endif
4750

4851
#define OP_READ 0
4952
#define OP_WRITE 1

ports/nordic/background.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,7 @@
2727
#include "background.h"
2828

2929
#include "py/runtime.h"
30-
#include "supervisor/filesystem.h"
3130
#include "supervisor/port.h"
32-
#include "supervisor/shared/stack.h"
33-
#include "supervisor/usb.h"
3431

3532
#if CIRCUITPY_DISPLAYIO
3633
#include "shared-module/displayio/__init__.h"

ports/nordic/common-hal/_bleio/Adapter.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
* THE SOFTWARE.
2727
*/
2828

29-
#include <math.h>
3029
#include <stdint.h>
3130
#include <stdio.h>
3231
#include <string.h>
@@ -43,14 +42,15 @@
4342
#include "supervisor/shared/bluetooth/bluetooth.h"
4443
#include "supervisor/shared/safe_mode.h"
4544
#include "supervisor/shared/tick.h"
46-
#include "supervisor/usb.h"
4745
#include "shared-bindings/_bleio/__init__.h"
4846
#include "shared-bindings/_bleio/Adapter.h"
4947
#include "shared-bindings/_bleio/Address.h"
5048
#include "shared-bindings/nvm/ByteArray.h"
5149
#include "shared-bindings/_bleio/Connection.h"
52-
#include "shared-bindings/_bleio/ScanEntry.h"
53-
#include "shared-bindings/time/__init__.h"
50+
51+
#if CIRCUITPY_USB
52+
#include "supervisor/usb.h"
53+
#endif
5454

5555
#if CIRCUITPY_OS_GETENV
5656
#include "shared-bindings/os/__init__.h"

shared-bindings/storage/__init__.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(storage_erase_filesystem_obj, 0, storage_erase_filesy
203203
//| ...
204204
//|
205205
STATIC mp_obj_t storage_disable_usb_drive(void) {
206-
#if CIRCUITPY_USB_MSC
206+
#if CIRCUITPY_USB && CIRCUITPY_USB_MSC
207207
if (!common_hal_storage_disable_usb_drive()) {
208208
#else
209209
if (true) {
@@ -228,7 +228,7 @@ MP_DEFINE_CONST_FUN_OBJ_0(storage_disable_usb_drive_obj, storage_disable_usb_dri
228228
//| ...
229229
//|
230230
STATIC mp_obj_t storage_enable_usb_drive(void) {
231-
#if CIRCUITPY_USB_MSC
231+
#if CIRCUITPY_USB && CIRCUITPY_USB_MSC
232232
if (!common_hal_storage_enable_usb_drive()) {
233233
#else
234234
if (true) {
@@ -275,38 +275,30 @@ STATIC const mp_rom_map_elem_t storage_module_globals_table[] = {
275275
//| larger filesystems, but you will need to format the filesystem on another device.
276276
//| """
277277
//| ...
278-
//|
279278
//| def open(self, path: str, mode: str) -> None:
280279
//| """Like builtin ``open()``"""
281280
//| ...
282-
//|
283281
//| def ilistdir(
284282
//| self, path: str
285283
//| ) -> Iterator[Union[Tuple[AnyStr, int, int, int], Tuple[AnyStr, int, int]]]:
286284
//| """Return an iterator whose values describe files and folders within
287285
//| ``path``"""
288286
//| ...
289-
//|
290287
//| def mkdir(self, path: str) -> None:
291288
//| """Like `os.mkdir`"""
292289
//| ...
293-
//|
294290
//| def rmdir(self, path: str) -> None:
295291
//| """Like `os.rmdir`"""
296292
//| ...
297-
//|
298293
//| def stat(self, path: str) -> Tuple[int, int, int, int, int, int, int, int, int, int]:
299294
//| """Like `os.stat`"""
300295
//| ...
301-
//|
302296
//| def statvfs(self, path: int) -> Tuple[int, int, int, int, int, int, int, int, int, int]:
303297
//| """Like `os.statvfs`"""
304298
//| ...
305-
//|
306299
//| def mount(self, readonly: bool, mkfs: VfsFat) -> None:
307300
//| """Don't call this directly, call `storage.mount`."""
308301
//| ...
309-
//|
310302
//| def umount(self) -> None:
311303
//| """Don't call this directly, call `storage.umount`."""
312304
//| ...

shared-module/busdisplay/BusDisplay.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@
4242
#include "shared-module/displayio/display_core.h"
4343
#include "supervisor/shared/display.h"
4444
#include "supervisor/shared/tick.h"
45+
46+
#if CIRCUITPY_USB
4547
#include "supervisor/usb.h"
48+
#endif
4649

4750
#include <stdint.h>
4851
#include <string.h>

shared-module/epaperdisplay/EPaperDisplay.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@
3535
#include "shared-module/displayio/__init__.h"
3636
#include "supervisor/shared/display.h"
3737
#include "supervisor/shared/tick.h"
38+
39+
#if CIRCUITPY_USB
3840
#include "supervisor/usb.h"
41+
#endif
3942

4043
#include <stdint.h>
4144
#include <string.h>

shared-module/framebufferio/FramebufferDisplay.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@
3535
#include "shared-module/displayio/display_core.h"
3636
#include "supervisor/shared/display.h"
3737
#include "supervisor/shared/tick.h"
38+
39+
#if CIRCUITPY_USB
3840
#include "supervisor/usb.h"
41+
#endif
3942

4043
#include <stdint.h>
4144
#include <string.h>

shared-module/storage/__init__.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,12 @@
3838
#include "shared-bindings/storage/__init__.h"
3939
#include "supervisor/filesystem.h"
4040
#include "supervisor/flash.h"
41+
42+
#if CIRCUITPY_USB
4143
#include "supervisor/usb.h"
44+
#endif
4245

43-
#if CIRCUITPY_USB_MSC
46+
#if CIRCUITPY_USB && CIRCUITPY_USB_MSC
4447
#include "tusb.h"
4548

4649
static const uint8_t usb_msc_descriptor_template[] = {
@@ -262,7 +265,7 @@ void common_hal_storage_remount(const char *mount_path, bool readonly, bool disa
262265
mp_raise_OSError(MP_EINVAL);
263266
}
264267

265-
#if CIRCUITPY_USB_MSC
268+
#if CIRCUITPY_USB && CIRCUITPY_USB_MSC
266269
if (!usb_msc_ejected() && storage_usb_is_enabled) {
267270
mp_raise_RuntimeError(MP_ERROR_TEXT("Cannot remount '/' when visible via USB."));
268271
}

shared-module/storage/__init__.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,9 @@
2727
#ifndef SHARED_MODULE_STORAGE___INIT___H
2828
#define SHARED_MODULE_STORAGE___INIT___H
2929

30-
#include "py/mpconfig.h"
30+
#if CIRCUITPY_USB
3131
#include "supervisor/usb.h"
3232

33-
#if CIRCUITPY_USB
3433
bool storage_usb_enabled(void);
3534
void storage_usb_set_defaults(void);
3635
size_t storage_usb_descriptor_length(void);

0 commit comments

Comments
 (0)