31 #ifndef __RTDUINO_CORE__
32 #define __RTDUINO_CORE__
36 #ifndef RTDUINO_THREAD_SIZE
37 #define RTDUINO_THREAD_SIZE 2048
40 #ifndef RTDUINO_THREAD_PRIO
41 #define RTDUINO_THREAD_PRIO (RT_THREAD_PRIORITY_MAX - 2)
86 void (*
setup)(
void),
void (*
loop)(
void), rt_uint32_t stack_size, rt_uint8_t priority);
114 void (*
setup)(
void),
void (*
loop)(
void), rt_uint8_t priority)
130 void (*
setup)(
void),
void (*
loop)(
void), rt_uint32_t stack_size)
146 #define RTDUINO_SKETCH_LOADER_STACKSIZE_PRIO_INITLEVEL(name, setup, loop, stack_size, priority, init_level) \
147 static int _sketch_loader(void) \
149 rtduino_sketch_loader_create_stacksize_prio(name, setup, loop, stack_size, priority);\
152 init_level(_sketch_loader)
164 #define RTDUINO_SKETCH_LOADER_STACKSIZE_PRIO(name, setup, loop, stack_size, priority) \
165 RTDUINO_SKETCH_LOADER_STACKSIZE_PRIO_INITLEVEL(name, setup, loop, stack_size, priority, INIT_APP_EXPORT)
175 #define RTDUINO_SKETCH_LOADER(name, setup, loop) \
176 RTDUINO_SKETCH_LOADER_STACKSIZE_PRIO(name, setup, loop, RTDUINO_THREAD_SIZE, RTDUINO_THREAD_PRIO)
187 #define RTDUINO_SKETCH_LOADER_PRIO(name, setup, loop, priority) \
188 RTDUINO_SKETCH_LOADER_STACKSIZE_PRIO(name, setup, loop, RTDUINO_THREAD_SIZE, priority)
199 #define RTDUINO_SKETCH_LOADER_STACKSIZE(name, setup, loop, stack_size) \
200 RTDUINO_SKETCH_LOADER_STACKSIZE_PRIO(name, setup, loop, stack_size, RTDUINO_THREAD_PRIO)
Arduino Core Header File.
rt_inline rtduino_loader_t rtduino_sketch_loader_create_prio(const char *name, void(*setup)(void), void(*loop)(void), rt_uint8_t priority)
Creates an RTduino loader with specified priority.
Definition: RTduino.h:113
rtduino_loader_t rtduino_sketch_loader_create_stacksize_prio(const char *name, void(*setup)(void), void(*loop)(void), rt_uint32_t stack_size, rt_uint8_t priority)
Creates an RTduino loader with specified stack size and priority.
Definition: RTduino.cpp:42
rt_err_t rtduino_sketch_loader_delete(rtduino_loader_t loader)
Deletes an RTduino loader.
Definition: RTduino.cpp:79
rt_inline rtduino_loader_t rtduino_sketch_loader_create_stacksize(const char *name, void(*setup)(void), void(*loop)(void), rt_uint32_t stack_size)
Creates an RTduino loader with specified stack size.
Definition: RTduino.h:129
rt_inline rtduino_loader_t rtduino_sketch_loader_create(const char *name, void(*setup)(void), void(*loop)(void))
Creates an RTduino loader with default stack size and priority.
Definition: RTduino.h:97
void loop(void)
Main loop function for the Arduino program.
void setup(void)
Initialization function for the Arduino environment.
rt_thread_t thread
Definition: RTduino.h:62
const char * name
Definition: RTduino.h:59