diff --git a/src/templates/module/module.cpp b/src/templates/module/module.cpp index 0d886f258d..42ab0e475d 100644 --- a/src/templates/module/module.cpp +++ b/src/templates/module/module.cpp @@ -162,8 +162,7 @@ Module *Module::instantiate(int argc, char *argv[]) } Module::Module(int example_param, bool example_flag) - : SuperBlock(nullptr, "MOD"), - _sys_autostart(this, "SYS_AUTOSTART", false) + : ModuleParams(nullptr) { } diff --git a/src/templates/module/module.h b/src/templates/module/module.h index 4f05838aa1..a5efb57745 100644 --- a/src/templates/module/module.h +++ b/src/templates/module/module.h @@ -34,13 +34,12 @@ #pragma once #include -#include -#include +#include extern "C" __EXPORT int module_main(int argc, char *argv[]); -class Module : public ModuleBase, public control::SuperBlock +class Module : public ModuleBase, public ModuleParams { public: Module(int example_param, bool example_flag); @@ -75,6 +74,9 @@ private: void parameters_update(int parameter_update_sub, bool force = false); - control::BlockParamInt _sys_autostart; /**< example parameter */ + DEFINE_PARAMETERS( + (ParamInt) _sys_autostart, /**< example parameter */ + (ParamInt) _sys_autoconfig /**< another parameter */ + ) };