Skip to content

Commit bb7d86a

Browse files
committed
renesas-ra: Allow boards to override default enter_bootloader.
1 parent aa13bd6 commit bb7d86a

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

ports/renesas-ra/boardctrl.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@
3737
#define MICROPY_BOARD_STARTUP powerctrl_check_enter_bootloader
3838
#endif
3939

40+
#ifndef MICROPY_BOARD_ENTER_BOOTLOADER
41+
#define MICROPY_BOARD_ENTER_BOOTLOADER(nargs, args)
42+
#endif
43+
4044
#ifndef MICROPY_BOARD_EARLY_INIT
4145
#define MICROPY_BOARD_EARLY_INIT()
4246
#endif

ports/renesas-ra/modmachine.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
#include "gccollect.h"
4848
#include "irq.h"
4949
#include "powerctrl.h"
50+
#include "boardctrl.h"
5051
#include "pybthread.h"
5152
#include "storage.h"
5253
#include "pin.h"
@@ -182,13 +183,15 @@ STATIC mp_obj_t machine_soft_reset(void) {
182183
MP_DEFINE_CONST_FUN_OBJ_0(machine_soft_reset_obj, machine_soft_reset);
183184

184185
// Activate the bootloader without BOOT* pins.
185-
STATIC NORETURN mp_obj_t machine_bootloader(size_t n_args, const mp_obj_t *args) {
186+
NORETURN mp_obj_t machine_bootloader(size_t n_args, const mp_obj_t *args) {
186187
#if MICROPY_HW_ENABLE_STORAGE
187188
storage_flush();
188189
#endif
189190

190191
__disable_irq();
191192

193+
MICROPY_BOARD_ENTER_BOOTLOADER(n_args, args);
194+
192195
#if MICROPY_HW_USES_BOOTLOADER
193196
// ToDo: need to review how to implement
194197

ports/renesas-ra/modmachine.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ void machine_deinit(void);
4949
void machine_pin_init(void);
5050
void machine_pin_deinit(void);
5151
void machine_i2s_init0(void);
52+
NORETURN mp_obj_t machine_bootloader(size_t n_args, const mp_obj_t *args);
5253

5354
MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(machine_info_obj);
5455
MP_DECLARE_CONST_FUN_OBJ_0(machine_unique_id_obj);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy