Add stub to apply configuration

reverse-scroll
nirenjan 2021-07-21 10:49:16 -07:00
parent ac8bb6cdd9
commit 50f77119ff
3 changed files with 16 additions and 0 deletions

View File

@ -40,3 +40,15 @@ void x52d_config_load(const char *cfg_file)
} }
} }
#define CFG(section, key, name, parser, def) \
static void x52d_cfg_set_ ## section ## _ ## key(typeof(x52d_config . name) param) \
{ \
PINELOG_TRACE("Calling set " #section ":" #key); \
}
#include "x52d_config.def"
void x52d_config_apply(void)
{
#define CFG(section, key, name, parser, def) x52d_cfg_set_ ## section ## _ ## key(x52d_config . name);
#include "x52d_config.def"
}

View File

@ -48,5 +48,6 @@ int x52d_config_apply_overrides(struct x52d_config *cfg);
void x52d_config_clear_overrides(void); void x52d_config_clear_overrides(void);
void x52d_config_load(const char *cfg_file); void x52d_config_load(const char *cfg_file);
void x52d_config_apply(void);
#endif // !defined X52D_CONFIG_H #endif // !defined X52D_CONFIG_H

View File

@ -135,6 +135,9 @@ int main(int argc, char **argv)
// Start device threads // Start device threads
x52d_dev_init(); x52d_dev_init();
// Apply configuration
x52d_config_apply();
for(;;) { for(;;) {
// TODO: Replace with main event loop // TODO: Replace with main event loop
// Let all threads run in background forever // Let all threads run in background forever