Rename reload_next_character to reload_requested to make it match it's intended use
This commit is contained in:
parent
567f3e30a7
commit
698912633f
4
main.c
4
main.c
@ -168,7 +168,7 @@ bool start_mp(safe_mode_t safe_mode) {
|
||||
reset_status_led();
|
||||
|
||||
if (result.return_code & PYEXEC_FORCED_EXIT) {
|
||||
return reload_next_character;
|
||||
return reload_requested;
|
||||
}
|
||||
}
|
||||
|
||||
@ -180,7 +180,7 @@ bool start_mp(safe_mode_t safe_mode) {
|
||||
#ifdef MICROPY_VM_HOOK_LOOP
|
||||
MICROPY_VM_HOOK_LOOP
|
||||
#endif
|
||||
if (reload_next_character) {
|
||||
if (reload_requested) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@ int mp_hal_stdin_rx_chr(void) {
|
||||
#ifdef MICROPY_VM_HOOK_LOOP
|
||||
MICROPY_VM_HOOK_LOOP
|
||||
#endif
|
||||
// if (reload_next_character) {
|
||||
// if (reload_requested) {
|
||||
// return CHAR_CTRL_D;
|
||||
// }
|
||||
if (usb_bytes_available()) {
|
||||
|
@ -100,7 +100,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(supervisor_set_rgb_status_brightness_obj, supervisor_s
|
||||
//| Reload the microcontroller (equivalent to hitting Ctrl-D at the REPL).
|
||||
//|
|
||||
STATIC mp_obj_t supervisor_reload(void) {
|
||||
reload_next_character = true;
|
||||
reload_requested = true;
|
||||
|
||||
MP_STATE_VM(mp_pending_exception) = MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_reload_exception));
|
||||
#if MICROPY_ENABLE_SCHEDULER
|
||||
|
@ -32,23 +32,23 @@
|
||||
volatile uint32_t autoreload_delay_ms = 0;
|
||||
bool autoreload_enabled = false;
|
||||
static bool autoreload_suspended = false;
|
||||
volatile bool reload_next_character = false;
|
||||
volatile bool reload_requested = false;
|
||||
|
||||
inline void autoreload_tick() {
|
||||
if (autoreload_delay_ms == 0) {
|
||||
return;
|
||||
}
|
||||
if (autoreload_delay_ms == 1 && autoreload_enabled &&
|
||||
!autoreload_suspended && !reload_next_character) {
|
||||
!autoreload_suspended && !reload_requested) {
|
||||
mp_keyboard_interrupt();
|
||||
reload_next_character = true;
|
||||
reload_requested = true;
|
||||
}
|
||||
autoreload_delay_ms--;
|
||||
}
|
||||
|
||||
void autoreload_enable() {
|
||||
autoreload_enabled = true;
|
||||
reload_next_character = false;
|
||||
reload_requested = false;
|
||||
}
|
||||
|
||||
void autoreload_disable() {
|
||||
@ -73,5 +73,5 @@ void autoreload_start() {
|
||||
|
||||
void autoreload_stop() {
|
||||
autoreload_delay_ms = 0;
|
||||
reload_next_character = false;
|
||||
reload_requested = false;
|
||||
}
|
||||
|
@ -29,7 +29,7 @@
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
extern volatile bool reload_next_character;
|
||||
extern volatile bool reload_requested;
|
||||
|
||||
void autoreload_tick(void);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user