Skip to content

Commit 4b74d77

Browse files
shenkimithro
authored andcommitted
lm32: remove unused code from main
This follows what other ports do here. Signed-off-by: Joel Stanley <[email protected]>
1 parent e986102 commit 4b74d77

File tree

1 file changed

+8
-15
lines changed

1 file changed

+8
-15
lines changed

lm32/main.c

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,9 @@ int main(int argc, char **argv) {
4848
gc_init(heap, heap + sizeof(heap));
4949
#endif
5050
mp_init();
51-
#if MICROPY_REPL_EVENT_DRIVEN
52-
pyexec_event_repl_init();
53-
for (;;) {
54-
int c = mp_hal_stdin_rx_chr();
55-
if (pyexec_event_repl_process_char(c)) {
56-
break;
57-
}
58-
}
59-
#else
51+
6052
pyexec_friendly_repl();
61-
#endif
62-
//do_str("print('hello world!', list(x+1 for x in range(10)), end='eol\\n')", MP_PARSE_SINGLE_INPUT);
63-
//do_str("for i in range(10):\r\n print(i)", MP_PARSE_FILE_INPUT);
53+
6454
mp_deinit();
6555
return 0;
6656
}
@@ -88,13 +78,16 @@ mp_obj_t mp_builtin_open(uint n_args, const mp_obj_t *args, mp_map_t *kwargs) {
8878
}
8979
MP_DEFINE_CONST_FUN_OBJ_KW(mp_builtin_open_obj, 1, mp_builtin_open);
9080

91-
void nlr_jump_fail(void *val) {
92-
}
93-
9481
void NORETURN __fatal_error(const char *msg) {
9582
while (1);
9683
}
9784

85+
void nlr_jump_fail(void *val) {
86+
printf("FATAL: uncaught exception %p\n", val);
87+
mp_obj_print_exception(&mp_plat_print, (mp_obj_t)val);
88+
__fatal_error("");
89+
}
90+
9891
#ifndef NDEBUG
9992
void MP_WEAK __assert_func(const char *file, int line, const char *func, const char *expr) {
10093
printf("Assertion '%s' failed, at file %s:%d\n", expr, file, line);

0 commit comments

Comments
 (0)