Kernel improvements (#468)

* **New Features**
  * Plugin-style modules for platforms and devices with start/stop lifecycle and a runtime-consumable device tree array.

* **Refactor**
  * Consolidated initialization into a kernel/module startup flow.
  * Generated devicetree artifacts moved to the build Generated directory.

* **Changes**
  * Removed legacy no-op registration hooks and I2C lock/unlock wrappers.
  * Driver ownership and private state moved to explicit module/owner model.
  * Added ERROR_NOT_ALLOWED error code.
This commit is contained in:
Ken Van Hoeylandt
2026-01-31 09:18:02 +01:00
committed by GitHub
parent d62314f41f
commit c9185740d7
119 changed files with 1639 additions and 440 deletions
+7 -3
View File
@@ -1,5 +1,7 @@
#pragma once
#include "tactility/device.h"
#include "tactility/module.h"
#include <Tactility/Dispatcher.h>
#include <Tactility/app/AppManifest.h>
#include <Tactility/hal/Configuration.h>
@@ -16,10 +18,12 @@ struct Configuration {
};
/**
* Attempts to initialize Tactility and all configured hardware.
* @param[in] config
* @brief Main entry point for Tactility.
* @param platformModule Platform module to start (non-null).
* @param deviceModule Device module to start (non-null).
* @param devicetreeDevices Null-terminated array where an entry { NULL, NULL } marks the end of the list.
*/
void run(const Configuration& config);
void run(const Configuration& config, Module* platformModule, Module* deviceModule, CompatibleDevice devicetreeDevices[]);
/**
* While technically nullable, this instance is always set if tt_init() succeeds.
+10 -1
View File
@@ -22,6 +22,8 @@
#include <Tactility/service/loader/Loader.h>
#include <Tactility/settings/TimePrivate.h>
#include <tactility/kernel_init.h>
#include <map>
#include <format>
@@ -317,10 +319,17 @@ void registerApps() {
registerInstalledAppsFromSdCards();
}
void run(const Configuration& config) {
void run(const Configuration& config, Module* platformModule, Module* deviceModule, CompatibleDevice devicetreeDevices[]) {
LOGGER.info("Tactility v{} on {} ({})", TT_VERSION, CONFIG_TT_DEVICE_NAME, CONFIG_TT_DEVICE_ID);
assert(config.hardware);
LOGGER.info(R"(Calling kernel_init with modules: "{}" and "{}")", platformModule->name, deviceModule->name);
if (kernel_init(platformModule, deviceModule, devicetreeDevices) != ERROR_NONE) {
LOGGER.error("Failed to initialize kernel");
return;
}
const hal::Configuration& hardware = *config.hardware;
// Assign early so starting services can use it