Skip to content

Commit 3fda0c0

Browse files
committed
Fix board builds and use MP_ERROR_TEXT in py and extmod
1 parent 7f2f8e2 commit 3fda0c0

117 files changed

Lines changed: 424 additions & 564 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

extmod/modubinascii.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
static void check_not_unicode(const mp_obj_t arg) {
1414
#if MICROPY_CPYTHON_COMPAT
1515
if (mp_obj_is_str(arg)) {
16-
mp_raise_TypeError(translate("a bytes-like object is required"));
16+
mp_raise_TypeError(MP_ERROR_TEXT("a bytes-like object is required"));
1717
}
1818
#endif
1919
}

extmod/moduhashlib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ STATIC mp_obj_t uhashlib_sha256_digest(mp_obj_t self_in) {
8989
static void check_not_unicode(const mp_obj_t arg) {
9090
#if MICROPY_CPYTHON_COMPAT
9191
if (mp_obj_is_str(arg)) {
92-
mp_raise_TypeError(translate("a bytes-like object is required"));
92+
mp_raise_TypeError(MP_ERROR_TEXT("a bytes-like object is required"));
9393
}
9494
#endif
9595
}

extmod/vfs_fat.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ STATIC mp_obj_t vfs_fat_setlabel(mp_obj_t self_in, mp_obj_t label_in) {
430430
FRESULT res = f_setlabel(&self->fatfs, label_str);
431431
if (res != FR_OK) {
432432
if (res == FR_WRITE_PROTECTED) {
433-
mp_raise_msg(&mp_type_OSError, translate("Read-only filesystem"));
433+
mp_raise_msg(&mp_type_OSError, MP_ERROR_TEXT("Read-only filesystem"));
434434
}
435435
mp_raise_OSError(fresult_to_errno_table[res]);
436436
}

extmod/vfs_posix_file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include "extmod/vfs_posix.h"
1111
#include "supervisor/shared/translate.h"
1212

13-
#if defined(MICROPY_VFS_POSIX) && MICROPY_VFS_POSIX || MICROPY_VFS_POSIX_FILE
13+
#if (defined(MICROPY_VFS_POSIX) && MICROPY_VFS_POSIX) || (defined(MICROPY_VFS_POSIX_FILE) && MICROPY_VFS_POSIX_FILE)
1414

1515
#include <fcntl.h>
1616
#include <unistd.h>

lib/utils/interrupt_char.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,6 @@ void mp_hal_set_interrupt_char(int c) {
3535
mp_interrupt_char = c;
3636
}
3737

38-
void mp_keyboard_interrupt(void) {
39-
MP_STATE_VM(mp_pending_exception) = MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception));
40-
#if MICROPY_ENABLE_SCHEDULER
41-
if (MP_STATE_VM(sched_state) == MP_SCHED_IDLE) {
42-
MP_STATE_VM(sched_state) = MP_SCHED_PENDING;
43-
}
44-
#endif
45-
}
46-
4738
// Check to see if we've been CTRL-C'ed by autoreload or the user.
4839
bool mp_hal_is_interrupted(void) {
4940
return MP_STATE_VM(mp_pending_exception) != NULL;

lib/utils/interrupt_char.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030

3131
extern int mp_interrupt_char;
3232
void mp_hal_set_interrupt_char(int c);
33-
void mp_keyboard_interrupt(void);
3433
bool mp_hal_is_interrupted(void);
3534

3635
#endif // MICROPY_INCLUDED_LIB_UTILS_INTERRUPT_CHAR_H

ports/atmel-samd/bindings/samd/Clock.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(samd_clock_get_enabled_obj, samd_clock_get_enabled);
5656
const mp_obj_property_t samd_clock_enabled_obj = {
5757
.base.type = &mp_type_property,
5858
.proxy = {(mp_obj_t)&samd_clock_get_enabled_obj,
59-
(mp_obj_t)&mp_const_none_obj,
60-
(mp_obj_t)&mp_const_none_obj,},
59+
MP_ROM_NONE,
60+
MP_ROM_NONE,},
6161
};
6262

6363
//| parent: Union[Clock, None]
@@ -85,8 +85,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(samd_clock_get_parent_obj, samd_clock_get_parent);
8585
const mp_obj_property_t samd_clock_parent_obj = {
8686
.base.type = &mp_type_property,
8787
.proxy = {(mp_obj_t)&samd_clock_get_parent_obj,
88-
(mp_obj_t)&mp_const_none_obj,
89-
(mp_obj_t)&mp_const_none_obj,},
88+
MP_ROM_NONE,
89+
MP_ROM_NONE,},
9090
};
9191

9292
//| frequency: int
@@ -102,8 +102,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(samd_clock_get_frequency_obj, samd_clock_get_frequency
102102
const mp_obj_property_t samd_clock_frequency_obj = {
103103
.base.type = &mp_type_property,
104104
.proxy = {(mp_obj_t)&samd_clock_get_frequency_obj,
105-
(mp_obj_t)&mp_const_none_obj,
106-
(mp_obj_t)&mp_const_none_obj,},
105+
MP_ROM_NONE,
106+
MP_ROM_NONE,},
107107
};
108108

109109
//| calibration: int
@@ -134,7 +134,7 @@ const mp_obj_property_t samd_clock_calibration_obj = {
134134
.base.type = &mp_type_property,
135135
.proxy = {(mp_obj_t)&samd_clock_get_calibration_obj,
136136
(mp_obj_t)&samd_clock_set_calibration_obj,
137-
(mp_obj_t)&mp_const_none_obj,},
137+
MP_ROM_NONE,},
138138
};
139139

140140
STATIC const mp_rom_map_elem_t samd_clock_locals_dict_table[] = {

ports/raspberrypi/bindings/rp2pio/StateMachine.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ const mp_obj_property_t rp2pio_statemachine_frequency_obj = {
532532
.base.type = &mp_type_property,
533533
.proxy = {(mp_obj_t)&rp2pio_statemachine_get_frequency_obj,
534534
(mp_obj_t)&rp2pio_statemachine_set_frequency_obj,
535-
(mp_obj_t)&mp_const_none_obj},
535+
MP_ROM_NONE},
536536
};
537537

538538
//| rxstall: bool
@@ -550,8 +550,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(rp2pio_statemachine_get_rxstall_obj, rp2pio_statemachi
550550
const mp_obj_property_t rp2pio_statemachine_rxstall_obj = {
551551
.base.type = &mp_type_property,
552552
.proxy = {(mp_obj_t)&rp2pio_statemachine_get_rxstall_obj,
553-
(mp_obj_t)&mp_const_none_obj,
554-
(mp_obj_t)&mp_const_none_obj},
553+
MP_ROM_NONE,
554+
MP_ROM_NONE},
555555
};
556556

557557
//| in_waiting: int
@@ -568,8 +568,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(rp2pio_statemachine_get_in_waiting_obj, rp2pio_statema
568568
const mp_obj_property_t rp2pio_statemachine_in_waiting_obj = {
569569
.base.type = &mp_type_property,
570570
.proxy = {(mp_obj_t)&rp2pio_statemachine_get_in_waiting_obj,
571-
(mp_obj_t)&mp_const_none_obj,
572-
(mp_obj_t)&mp_const_none_obj},
571+
MP_ROM_NONE,
572+
MP_ROM_NONE},
573573
};
574574

575575
STATIC const mp_rom_map_elem_t rp2pio_statemachine_locals_dict_table[] = {

ports/unix/variants/dev/mpconfigvariant.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ PROG ?= micropython-dev
22

33
FROZEN_MANIFEST ?= $(VARIANT_DIR)/manifest.py
44

5-
MICROPY_ROM_TEXT_COMPRESSION = 1
65
MICROPY_VFS_FAT = 1
76
MICROPY_VFS_LFS1 = 1
87
MICROPY_VFS_LFS2 = 1

ports/unix/variants/minimal/mpconfigvariant.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ PROG = micropython-minimal
33

44
FROZEN_MANIFEST =
55

6-
MICROPY_ROM_TEXT_COMPRESSION = 1
76
MICROPY_PY_BTREE = 0
87
MICROPY_PY_FFI = 0
98
MICROPY_PY_SOCKET = 0

0 commit comments

Comments
 (0)