Skip to content

Adding C macro to enable main() to be renamed - #81

Open
joseph-yiu wants to merge 1 commit into
eembc:dev_2026q3from
joseph-yiu:fix/issue56_main_macro
Open

Adding C macro to enable main() to be renamed#81
joseph-yiu wants to merge 1 commit into
eembc:dev_2026q3from
joseph-yiu:fix/issue56_main_macro

Conversation

@joseph-yiu

Copy link
Copy Markdown
Contributor

This PR enables main() to be renamed easily by defining a C macro "MAIN_FUNC_NAME".
Normally the macro MAIN_FUNC_NAME should be undefined, and by default it is mapped to main() within core_main.c.
So there is no different from the original code. However, if needed, user can add a definition of MAIN_FUNC_NAME in core_portme.h. For example, by adding:
#define MAIN_FUNC_NAME coremark_task
The "main" function became "coremark_task".

This enhancement addresses the need described in #56
and allow CoreMark to be handled as a task inside an RTOS environment, where the real main is executed before/when the RTOS starts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant