8000 ports/nrf: Add board init macros. by iabdalkader · Pull Request #6757 · micropython/micropython · GitHub
[go: up one dir, main page]

Skip to content

ports/nrf: Add board init macros. #6757

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ports/nrf/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ SRC_C += \
drivers/ticker.c \
drivers/bluetooth/ble_drv.c \
drivers/bluetooth/ble_uart.c \
$(wildcard boards/$(BOARD)/*.c) \

ifeq ($(MCU_SUB_VARIANT), nrf52840)

Expand Down
6 changes: 5 additions & 1 deletion ports/nrf/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,13 @@ extern uint32_t _heap_start;
extern uint32_t _heap_end;

int main(int argc, char **argv) {
// Hook for a board to run code at start up, for example check if a
// bootloader should be entered instead of the main application.
MICROPY_BOARD_STARTUP();


MICROPY_BOARD_EARLY_INIT();
soft_reset:

#if MICROPY_PY_TIME_TICKS
rtc1_init_time_ticks();
#endif
Expand Down
8 changes: 8 additions & 0 deletions ports/nrf/mpconfigport.h
Original file line number Diff line number Diff line change
Expand Up @@ -366,3 +366,11 @@ extern const struct _mp_obj_module_t music_module;
#ifndef MP_NEED_LOG2
#define MP_NEED_LOG2 (1)
#endif

#ifndef MICROPY_BOARD_STARTUP
#define MICROPY_BOARD_STARTUP()
#endif

#ifndef MICROPY_BOARD_EARLY_INIT
#define MICROPY_BOARD_EARLY_INIT()
#endif
0