Replaced Logger usage with LOG_x (#548)

This commit is contained in:
Ken Van Hoeylandt
2026-07-04 23:49:19 +02:00
committed by GitHub
parent ecad2248d9
commit 9d5993930d
162 changed files with 1776 additions and 1842 deletions
@@ -1,16 +1,16 @@
#include "TdeckKeyboard.h"
#include <KeyboardBacklight/KeyboardBacklight.h>
#include <Tactility/Logger.h>
#include <Tactility/hal/display/DisplayDevice.h>
#include <Tactility/settings/DisplaySettings.h>
#include <Tactility/settings/KeyboardSettings.h>
#include <lvgl.h>
#include <tactility/drivers/i2c_controller.h>
#include <tactility/log.h>
using tt::hal::findFirstDevice;
static const auto LOGGER = tt::Logger("TdeckKeyboard");
constexpr auto* TAG = "TdeckKeyboard";
constexpr uint8_t TDECK_KEYBOARD_SLAVE_ADDRESS = 0x55;
@@ -34,15 +34,11 @@ static void keyboard_read_callback(lv_indev_t* indev, lv_indev_data_t* data) {
auto* keyboard = static_cast<TdeckKeyboard*>(lv_indev_get_user_data(indev));
if (i2c_controller_read(keyboard->getI2cController(), TDECK_KEYBOARD_SLAVE_ADDRESS, &read_buffer, 1, 100 / portTICK_PERIOD_MS) == ERROR_NONE) {
if (read_buffer == 0 && read_buffer != last_buffer) {
if (LOGGER.isLoggingDebug()) {
LOGGER.debug("Released {}", last_buffer);
}
LOG_D(TAG, "Released %d", last_buffer);
data->key = last_buffer;
data->state = LV_INDEV_STATE_RELEASED;
} else if (read_buffer != 0) {
if (LOGGER.isLoggingDebug()) {
LOGGER.debug("Pressed {}", read_buffer);
}
LOG_D(TAG, "Pressed %d", read_buffer);
data->key = read_buffer;
data->state = LV_INDEV_STATE_PRESSED;
// TODO: Avoid performance hit by calling loadOrGetDefault() on each key press