module_base: remove CRTP template pattern to reduce flash bloat (#26476)

* module_base: claude rewrite to remove CRTP bloat

* module_base: apply to all drivers/modules

* format

* fix build errors

* fix missing syntax

* remove reference to module.h in files that need module_base.h

* remove old ModuleBase<T>

* add module_base.cpp to px4_protected_layers.cmake

* fix IridiumSBD can_stop()

* fix IridiumSBD.cpp

* clang-tidy: downcast static cast

* get_instance() template accessor, revert clang-tidy global

* rename module_base.h to module.h

* revert changes in zenoh/Kconfig.topics
This commit is contained in:
Jacob Dahl
2026-02-19 15:17:17 +13:00
committed by GitHub
parent 657854ae1b
commit ce3e62841f
227 changed files with 1741 additions and 1496 deletions
+8 -1
View File
@@ -68,7 +68,7 @@ void I2CLauncher::Run()
{
if (should_exit()) {
ScheduleClear();
exit_and_cleanup();
exit_and_cleanup(desc);
return;
}
@@ -189,6 +189,11 @@ void I2CLauncher::scan_i2c_bus(int bus, int batt_index)
px4_i2cbus_uninitialize(i2c_dev);
}
int I2CLauncher::task_spawn(int argc, char *argv[])
{
return -1;
}
int I2CLauncher::custom_command(int argc, char *argv[])
{
return print_usage("unknown command");
@@ -216,6 +221,8 @@ Daemon that starts drivers based on found I2C devices.
return 0;
}
ModuleBase::Descriptor I2CLauncher::desc{task_spawn, custom_command, print_usage};
extern "C" __EXPORT int i2c_launcher_main(int argc, char *argv[])
{
using ThisDriver = I2CLauncher;
+3 -1
View File
@@ -48,9 +48,11 @@
using namespace time_literals;
class I2CLauncher : public ModuleBase<I2CLauncher>, public ModuleParams, public px4::ScheduledWorkItem
class I2CLauncher : public ModuleBase, public ModuleParams, public px4::ScheduledWorkItem
{
public:
static Descriptor desc;
I2CLauncher(int bus, int batt_index);
~I2CLauncher() override;