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
+14 -13
View File
@@ -7,7 +7,6 @@
#if CONFIG_TINYUSB_MSC_ENABLED == 1
#include <Tactility/Logger.h>
#include <esp_system.h>
#include <freertos/FreeRTOS.h>
#include <freertos/task.h>
@@ -15,6 +14,8 @@
#include <tusb_msc_storage.h>
#include <wear_levelling.h>
#include <tactility/log.h>
#if CONFIG_IDF_TARGET_ESP32P4
#include "hal/usb_wrap_ll.h"
#endif
@@ -23,7 +24,7 @@
#define TUSB_DESC_TOTAL_LEN (TUD_CONFIG_DESC_LEN + TUD_MSC_DESC_LEN)
#define SECTOR_SIZE 512
static const auto LOGGER = tt::Logger("USB");
constexpr auto* TAG = "USB";
namespace tt::hal::usb {
extern sdmmc_card_t* getCard();
@@ -105,18 +106,18 @@ static uint8_t const msc_hs_configuration_desc[] = {
static void storage_mount_changed_cb(tinyusb_msc_event_t* event) {
if (event->mount_changed_data.is_mounted) {
LOGGER.info("MSC Mounted");
LOG_I(TAG, "MSC Mounted");
// Storage is only (re)mounted into our own filesystem after the host sends a SCSI
// START STOP UNIT eject (see tud_msc_start_stop_cb() in tusb_msc_storage.c). Windows
// is known not to send this reliably, so this is a best-effort path for hosts that do
// (e.g. Linux/macOS) - the "Return to OS" button on the boot screen is the primary one.
// If we got here while booted into MSC mode, it's safe to reboot back into normal OS now.
if (startedFromBootMode) {
LOGGER.info("MSC ejected by host, rebooting into normal OS");
LOG_I(TAG, "MSC ejected by host, rebooting into normal OS");
esp_restart();
}
} else {
LOGGER.info("MSC Unmounted");
LOG_I(TAG, "MSC Unmounted");
}
}
@@ -149,7 +150,7 @@ static bool ensureDriverInstalled() {
};
if (tinyusb_driver_install(&tusb_cfg) != ESP_OK) {
LOGGER.error("Failed to install TinyUSB driver");
LOG_E(TAG, "Failed to install TinyUSB driver");
#if CONFIG_IDF_TARGET_ESP32P4
// Roll back routing when TinyUSB did not start.
usb_wrap_ll_phy_select(&USB_WRAP, 1);
@@ -171,7 +172,7 @@ bool tusbStartMassStorageWithSdmmc(bool fromBootMode) {
auto* card = tt::hal::usb::getCard();
if (card == nullptr) {
LOGGER.error("SD card not mounted");
LOG_E(TAG, "SD card not mounted");
return false;
}
@@ -190,16 +191,16 @@ bool tusbStartMassStorageWithSdmmc(bool fromBootMode) {
auto result = tinyusb_msc_storage_init_sdmmc(&config_sdmmc);
if (result != ESP_OK) {
LOGGER.error("TinyUSB SDMMC init failed: {}", esp_err_to_name(result));
LOG_E(TAG, "TinyUSB SDMMC init failed: %s", esp_err_to_name(result));
} else {
LOGGER.info("TinyUSB SDMMC init success");
LOG_I(TAG, "TinyUSB SDMMC init success");
}
return result == ESP_OK;
}
bool tusbStartMassStorageWithFlash(bool fromBootMode) {
LOGGER.info("Starting flash MSC");
LOG_I(TAG, "Starting flash MSC");
if (!ensureDriverInstalled()) {
return false;
}
@@ -207,7 +208,7 @@ bool tusbStartMassStorageWithFlash(bool fromBootMode) {
wl_handle_t handle = tt::getDataPartitionWlHandle();
if (handle == WL_INVALID_HANDLE) {
LOGGER.error("WL not mounted for /data");
LOG_E(TAG, "WL not mounted for /data");
return false;
}
@@ -226,9 +227,9 @@ bool tusbStartMassStorageWithFlash(bool fromBootMode) {
esp_err_t result = tinyusb_msc_storage_init_spiflash(&config_flash);
if (result != ESP_OK) {
LOGGER.error("TinyUSB flash init failed: {}", esp_err_to_name(result));
LOG_E(TAG, "TinyUSB flash init failed: %s", esp_err_to_name(result));
} else {
LOGGER.info("TinyUSB flash init success");
LOG_I(TAG, "TinyUSB flash init success");
}
return result == ESP_OK;
}