mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
NRF: Fix early board init/deinit.
This commit is contained in:
parent
64bb3a6631
commit
a7fe87753b
@ -1 +1 @@
|
|||||||
Subproject commit 819228ab6914cb80b58b5e0174937371af730067
|
Subproject commit dbc31104a1a41507dc3086da4227a89023b32609
|
||||||
@ -88,33 +88,16 @@ uint32_t HAL_GetHalVersion()
|
|||||||
return ((2<<24) | (0<<16) | (0<<8) | (0<<0));
|
return ((2<<24) | (0<<16) | (0<<8) | (0<<0));
|
||||||
}
|
}
|
||||||
|
|
||||||
void do_str(const char *src, mp_parse_input_kind_t input_kind) {
|
|
||||||
mp_lexer_t *lex = mp_lexer_new_from_str_len(MP_QSTR__lt_stdin_gt_, src, strlen(src), 0);
|
|
||||||
if (lex == NULL) {
|
|
||||||
printf("MemoryError: lexer could not allocate memory\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
nlr_buf_t nlr;
|
|
||||||
if (nlr_push(&nlr) == 0) {
|
|
||||||
qstr source_name = lex->source_name;
|
|
||||||
mp_parse_tree_t pn = mp_parse(lex, input_kind);
|
|
||||||
mp_obj_t module_fun = mp_compile(&pn, source_name, true);
|
|
||||||
mp_call_function_0(module_fun);
|
|
||||||
nlr_pop();
|
|
||||||
} else {
|
|
||||||
// uncaught exception
|
|
||||||
mp_obj_print_exception(&mp_plat_print, (mp_obj_t)nlr.ret_val);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
extern uint32_t _heap_start;
|
extern uint32_t _heap_start;
|
||||||
extern uint32_t _heap_end;
|
extern uint32_t _heap_end;
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
|
||||||
soft_reset:
|
soft_reset:
|
||||||
|
#if defined(MICROPY_BOARD_EARLY_INIT)
|
||||||
|
MICROPY_BOARD_EARLY_INIT();
|
||||||
|
#endif
|
||||||
|
|
||||||
#if MICROPY_PY_TIME_TICKS
|
#if MICROPY_PY_TIME_TICKS
|
||||||
rtc1_init_time_ticks();
|
rtc1_init_time_ticks();
|
||||||
#endif
|
#endif
|
||||||
@ -140,7 +123,6 @@ soft_reset:
|
|||||||
|
|
||||||
readline_init0();
|
readline_init0();
|
||||||
|
|
||||||
|
|
||||||
#if MICROPY_PY_MACHINE_HW_SPI
|
#if MICROPY_PY_MACHINE_HW_SPI
|
||||||
spi_init0();
|
spi_init0();
|
||||||
#endif
|
#endif
|
||||||
@ -309,6 +291,10 @@ soft_reset:
|
|||||||
sd_softdevice_disable();
|
sd_softdevice_disable();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(MICROPY_BOARD_DEINIT)
|
||||||
|
MICROPY_BOARD_DEINIT();
|
||||||
|
#endif
|
||||||
|
|
||||||
goto soft_reset;
|
goto soft_reset;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@ -186,6 +186,7 @@ FIRM_OBJ += $(wildcard $(BUILD)/$(OMV_DIR)/ports/$(PORT)/modules/*.o)
|
|||||||
|
|
||||||
#------------- MicroPy Objects -------------------#
|
#------------- MicroPy Objects -------------------#
|
||||||
FIRM_OBJ += $(wildcard $(BUILD)/$(MICROPY_DIR)/py/*.o)
|
FIRM_OBJ += $(wildcard $(BUILD)/$(MICROPY_DIR)/py/*.o)
|
||||||
|
FIRM_OBJ += $(wildcard $(BUILD)/$(MICROPY_DIR)/boards/$(TARGET)/*.o)
|
||||||
|
|
||||||
FIRM_OBJ += $(addprefix $(BUILD)/$(MICROPY_DIR)/,\
|
FIRM_OBJ += $(addprefix $(BUILD)/$(MICROPY_DIR)/,\
|
||||||
mphalport.o \
|
mphalport.o \
|
||||||
@ -290,7 +291,6 @@ FIRM_OBJ += $(addprefix $(BUILD)/$(MICROPY_DIR)/modules/,\
|
|||||||
music/musictunes.o \
|
music/musictunes.o \
|
||||||
ble/modble.o \
|
ble/modble.o \
|
||||||
)
|
)
|
||||||
FIRM_OBJ += $(wildcard $(BUILD)/$(MICROPY_DIR)/boards/$(TARGET)/*.o)
|
|
||||||
|
|
||||||
ifeq ($(MICROPY_PY_ULAB), 1)
|
ifeq ($(MICROPY_PY_ULAB), 1)
|
||||||
FIRM_OBJ += $(addprefix $(BUILD)/$(MICROPY_DIR)/extmod/ulab/,\
|
FIRM_OBJ += $(addprefix $(BUILD)/$(MICROPY_DIR)/extmod/ulab/,\
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user