rdmstartuptypes.h File Reference

RDM Startup Macros used by examples, tools, and tests. More...

#include "psptypes.h"
#include "rdmretcodetypes.h"
Include dependency graph for rdmstartuptypes.h:
This graph shows which files directly or indirectly include this file:

Macros

#define RDM_STARTUP_HOOK
 
#define RDM_SHUTDOWN_HOOK
 
#define RDM_STARTUP_EXAMPLE(name)
 

Detailed Description

RDM Startup Macros used by examples, tools, and tests.

Macro Definition Documentation

◆ RDM_SHUTDOWN_HOOK

#define RDM_SHUTDOWN_HOOK

Shutdown hook

Shutdown hook for examples, tools, and tests that are using any of the RDM_STARTUP macros

◆ RDM_STARTUP_EXAMPLE

#define RDM_STARTUP_EXAMPLE (   name)
Value:
int32_t main_##name (int32_t argc, const char *const *argv); \
int main (int argc, const char *const *argv) \
{ \
int32_t status; \
\
RDM_STARTUP_HOOK \
status = rdm_threadMain (main_##name, argc, argv); \
RDM_SHUTDOWN_HOOK \
return status; \
}
int32_t rdm_threadMain(int32_t(*main)(int32_t argc, const char *const *argv), int argc, const char *const *argv)
Start the main thread and call the named main function.

Startup for examples

This sets up a main function, with a startup hook, a call to a named main function, and a shutdown hook.

On some embedded platforms you may want to define RDM_STARTUP_HOOK to change the current working directory or do some other environment setup.

The named main function has the name main_NAME, where NAME is the parameter to this macro. This macro sets up a call to rdm_threadMain which in turn will call the named main function. Exactly what rdm_threadMain does is an implementation detail.

Examples
c-core/01_helloworld_c/core01Example_main.c, c-core/02_core/core02Example_main.c, c-core/03_core/core03Example_main.c, c-core/04_core/core04Example_main.c, c-core/05_core/core05Example_main.c, c-core/06_core/core06Example_main.c, c-core/07_core/core07Example_main.c, c-core/08_core/core08Example_main.c, c-core/09_core/core09Example_main.c, c-core/10_core/core10Example_main.c, c-core/11_core/core11Example_main.c, c-core/12_core/core12Example_main.c, c-core/13_core/core13Example_main.c, c-core/14_core/core14Example_main.c, c-core/15_core/core15Example_main.c, c-core/16_core/core16Example_main.c, c-core/17_core/core17Example_main.c, c-core/18_core/core18Example_main.c, c-core/19_core/core19Example_main.c, c-core/20_core/core20Example_main.c, c-core/21_core/core21Example_main.c, c-core/22_core/core22Example_main.c, c-core/23_core/core23Example_main.c, c-core/24_core/core24Example_main.c, c-core/25_core/core25Example_main.c, c-core/28_core/core28Example_main.c, c-core/29_core/core29Example_main.c, c-core/30_core/core30Example_main.c, c-core/31_core/core31Example_main.c, c-core/32_core/core32Example_main.c, c-core/33_core/core33Example_main.c, c-core/34_core/core34Example_main.c, c-core/35_core/core35Example_main.c, c-odbc/01_helloworld_odbc/odbc01Example_main.c, cpp/01_helloworld_cpp/cpp01Example_main.cpp, and cpp/18_cpp/cpp18Example_main.cpp.

◆ RDM_STARTUP_HOOK

#define RDM_STARTUP_HOOK

Startup hook

Startup hook for examples, tools, and tests that are using any of the RDM_STARTUP macros