Add drivers to module and make start/stop optional (#580)

This commit is contained in:
Ken Van Hoeylandt
2026-07-23 23:28:09 +02:00
committed by GitHub
parent 08eac48e64
commit 429125734a
131 changed files with 488 additions and 2381 deletions
+7 -19
View File
@@ -1,6 +1,4 @@
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/error.h>
#include <tactility/module.h>
extern "C" {
@@ -9,26 +7,16 @@ extern Driver papers3_power_driver;
extern Driver papers3_power_supply_driver;
extern Driver papers3_display_driver;
static error_t start() {
check(driver_construct_add(&papers3_power_supply_driver) == ERROR_NONE);
check(driver_construct_add(&papers3_power_driver) == ERROR_NONE);
check(driver_construct_add(&papers3_display_driver) == ERROR_NONE);
return ERROR_NONE;
}
static error_t stop() {
check(driver_remove_destruct(&papers3_display_driver) == ERROR_NONE);
check(driver_remove_destruct(&papers3_power_driver) == ERROR_NONE);
check(driver_remove_destruct(&papers3_power_supply_driver) == ERROR_NONE);
return ERROR_NONE;
}
static Driver* const papers3_drivers[] = {
&papers3_display_driver,
&papers3_power_driver,
&papers3_power_supply_driver,
nullptr
};
Module m5stack_papers3_module = {
.name = "m5stack-papers3",
.start = start,
.stop = stop,
.symbols = nullptr,
.internal = nullptr
.drivers = papers3_drivers
};
}