Fix a few tests

* Re-enable a couple FATFS configurations we added.
* Remove MICROPY_PY_IO_FILEIO.
* Remove uasyncio from standard unix build.
* Re-add our unicode printing improvements.
This commit is contained in:
Scott Shawcroft 2023-10-05 10:59:08 -07:00
parent 7e0e6fcdca
commit 18c03a74dd
No known key found for this signature in database
GPG Key ID: 0DFD512649C052DA
8 changed files with 14 additions and 14 deletions

View File

@ -232,12 +232,10 @@ STATIC mp_obj_t fat_vfs_open(mp_obj_t self_in, mp_obj_t path_in, mp_obj_t mode_i
mode |= FA_READ | FA_WRITE; mode |= FA_READ | FA_WRITE;
plus_count++; plus_count++;
break; break;
#if MICROPY_PY_IO_FILEIO
case 'b': case 'b':
bt_count++; bt_count++;
type = &mp_type_vfs_fat_fileio; type = &mp_type_vfs_fat_fileio;
break; break;
#endif
case 't': case 't':
bt_count++; bt_count++;
type = &mp_type_vfs_fat_textio; type = &mp_type_vfs_fat_textio;

View File

@ -72,8 +72,8 @@
#define FF_USE_MKFS 1 #define FF_USE_MKFS 1
/* This option switches f_mkfs() function. (0:Disable or 1:Enable) */ /* This option switches f_mkfs() function. (0:Disable or 1:Enable) */
#ifdef MICROPY_FF_MKFS_FAT32 #ifdef MICROPY_FATFS_MKFS_FAT32
#define FF_MKFS_FAT32 MICROPY_FF_MKFS_FAT32 #define FF_MKFS_FAT32 MICROPY_FATFS_MKFS_FAT32
#else #else
#define FF_MKFS_FAT32 0 #define FF_MKFS_FAT32 0
#endif #endif

View File

@ -62,7 +62,7 @@
#define MICROPY_FATFS_EXFAT (0) #define MICROPY_FATFS_EXFAT (0)
// FAT32 mkfs takes about 500 bytes. // FAT32 mkfs takes about 500 bytes.
#define MICROPY_FF_MKFS_FAT32 (0) #define MICROPY_FATFS_MKFS_FAT32 (0)
// Only support simpler HID descriptors on SAMD21. // Only support simpler HID descriptors on SAMD21.
#define CIRCUITPY_USB_HID_MAX_REPORT_IDS_PER_DESCRIPTOR (1) #define CIRCUITPY_USB_HID_MAX_REPORT_IDS_PER_DESCRIPTOR (1)

View File

@ -45,8 +45,8 @@
#define CIRCUITPY_DISPLAY_AREA_BUFFER_SIZE (1920) #define CIRCUITPY_DISPLAY_AREA_BUFFER_SIZE (1920)
#define CIRCUITPY_PROCESSOR_COUNT (4) #define CIRCUITPY_PROCESSOR_COUNT (4)
#define MICROPY_FF_MKFS_FAT32 (1)
#define MICROPY_FATFS_EXFAT (1) #define MICROPY_FATFS_EXFAT (1)
#define MICROPY_FATFS_MKFS_FAT32 (1)
//////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////

View File

@ -154,6 +154,8 @@ typedef long mp_off_t;
#define MICROPY_FATFS_RPATH (2) #define MICROPY_FATFS_RPATH (2)
#define MICROPY_FATFS_MAX_SS (4096) #define MICROPY_FATFS_MAX_SS (4096)
#define MICROPY_FATFS_LFN_CODE_PAGE 437 /* 1=SFN/ANSI 437=LFN/U.S.(OEM) */ #define MICROPY_FATFS_LFN_CODE_PAGE 437 /* 1=SFN/ANSI 437=LFN/U.S.(OEM) */
#define MICROPY_FATFS_MKFS_FAT32 (1)
#define MICROPY_FATFS_USE_LABEL (1)
#define MICROPY_ALLOC_PATH_MAX (PATH_MAX) #define MICROPY_ALLOC_PATH_MAX (PATH_MAX)

View File

@ -1,3 +1 @@
include("$(PORT_DIR)/variants/manifest.py") include("$(PORT_DIR)/variants/manifest.py")
include("$(MPY_DIR)/extmod/uasyncio")

View File

@ -128,7 +128,6 @@ extern void common_hal_mcu_enable_interrupts(void);
#define MICROPY_PY_CMATH (0) #define MICROPY_PY_CMATH (0)
#define MICROPY_PY_COLLECTIONS (CIRCUITPY_COLLECTIONS) #define MICROPY_PY_COLLECTIONS (CIRCUITPY_COLLECTIONS)
#define MICROPY_PY_DESCRIPTORS (1) #define MICROPY_PY_DESCRIPTORS (1)
#define MICROPY_PY_IO_FILEIO (1)
#define MICROPY_PY_GC (1) #define MICROPY_PY_GC (1)
// Supplanted by shared-bindings/math // Supplanted by shared-bindings/math
#define MICROPY_PY_IO (CIRCUITPY_IO) #define MICROPY_PY_IO (CIRCUITPY_IO)
@ -264,8 +263,8 @@ typedef long mp_off_t;
#define MICROPY_FATFS_EXFAT (CIRCUITPY_FULL_BUILD) #define MICROPY_FATFS_EXFAT (CIRCUITPY_FULL_BUILD)
#endif #endif
#ifndef MICROPY_FF_MKFS_FAT32 #ifndef MICROPY_FATFS_MKFS_FAT32
#define MICROPY_FF_MKFS_FAT32 (CIRCUITPY_FULL_BUILD) #define MICROPY_FATFS_MKFS_FAT32 (CIRCUITPY_FULL_BUILD)
#endif #endif
// LONGINT_IMPL_xxx are defined in the Makefile. // LONGINT_IMPL_xxx are defined in the Makefile.

View File

@ -59,6 +59,7 @@ STATIC void uni_print_quoted(const mp_print_t *print, const byte *str_data, uint
while (s < top) { while (s < top) {
unichar ch; unichar ch;
ch = utf8_get_char(s); ch = utf8_get_char(s);
const byte *start = s;
s = utf8_next_char(s); s = utf8_next_char(s);
if (ch == quote_char) { if (ch == quote_char) {
mp_printf(print, "\\%c", quote_char); mp_printf(print, "\\%c", quote_char);
@ -72,12 +73,14 @@ STATIC void uni_print_quoted(const mp_print_t *print, const byte *str_data, uint
mp_print_str(print, "\\r"); mp_print_str(print, "\\r");
} else if (ch == '\t') { } else if (ch == '\t') {
mp_print_str(print, "\\t"); mp_print_str(print, "\\t");
} else if (ch < 0x100) { } else if (ch <= 0x1f || (0x7f <= ch && ch <= 0xa0) || ch == 0xad) {
mp_printf(print, "\\x%02x", ch); mp_printf(print, "\\x%02x", ch);
} else if (ch < 0x10000) { } else if ((0x2000 <= ch && ch <= 0x200f) || ch == 0x2028 || ch == 0x2029) {
mp_printf(print, "\\u%04x", ch); mp_printf(print, "\\u%04x", ch);
} else { } else {
mp_printf(print, "\\U%08x", ch); // Print the full character out.
int width = s - start;
mp_print_strn(print, (const char *)start, width, 0, ' ', width);
} }
} }
mp_printf(print, "%c", quote_char); mp_printf(print, "%c", quote_char);