From 523bb1157736f87be70db5fd42e2780d7bfa4aa4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Wed, 21 Feb 2018 11:34:03 +0100 Subject: [PATCH] module template: update to use the new Param classes --- src/templates/module/module.cpp | 3 +-- src/templates/module/module.h | 10 ++++++---- 2 files changed, 7 insertions(+), 6 deletions(-) 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 */ + ) };