create file with .c
extension in components/
components/simple_module.c
:
#include "../lib/util.h" /* you can find some useful functions in `util.c` */
void
function_name(char *out, const char __unused *_a,
uint32_t __unused _i, void __unused *_p)
{
bprintf(out, "%s", "Hello, World!");
}
arg
, interval
and static_ptr
is optional argument
and if it is unused add __unused
attribute
then put:
void function_name FUNC_ARGS;
#define function_name {function_name, "thread name", 0}
at the end of aslstatus.h
for complex example see brightness and then entropy component (this components are "simple" and have detailed comments)
aslstatus.h
:
/* ... */
void my_module FUNC_ARGS;
#define my_module {my_module, "My Module", static_data_size}
in #define
: