I2C improvements and fixes (#201)

- Show I2C device name in I2C Scanner app
- Register various I2C devices from board implementations
- Fix M5Stack Core2 power status
- Fix pre-allocation issue in `hal::Device`
This commit is contained in:
Ken Van Hoeylandt
2025-02-02 17:54:36 +01:00
committed by GitHub
parent 2e61aea93c
commit c0f4738abe
13 changed files with 133 additions and 59 deletions
+1 -2
View File
@@ -1,6 +1,5 @@
#include "Tactility/hal/Device.h"
#include <ranges>
#include <Tactility/Mutex.h>
namespace tt::hal {
@@ -58,7 +57,7 @@ std::vector<std::shared_ptr<Device>> findDevices(const std::function<bool(const
return {};
}
static std::shared_ptr<Device> _Nullable findDevice(const std::function<bool(const std::shared_ptr<Device>&)>& filterFunction) {
std::shared_ptr<Device> _Nullable findDevice(const std::function<bool(const std::shared_ptr<Device>&)>& filterFunction) {
auto scoped_mutex = mutex.scoped();
if (scoped_mutex->lock()) {
auto result_set = devices | std::views::filter([&filterFunction](auto& device) {