Various fixes and improvements (#177)
- Remove custom `ESP_TARGET` and use `ESP_PLATFORM` everywhere - Add `Loader` service functionality to `tt::app::` namespace - Make `Loader` `PubSub` usable by exposing the messages - Add board type to crash log - Don't show SD card in Files app when it's not mounted - Set default SPI frequency for SD cards - Move TT_VERSION to scope that works for sim too - Log Tactility version and board on boot - Rename "Yellow Board" to "CYD 2432S024C"
This commit is contained in:
committed by
GitHub
parent
97b8007aca
commit
12a9839420
@@ -1,4 +1,4 @@
|
||||
#ifdef ESP_TARGET
|
||||
#ifdef ESP_PLATFORM
|
||||
|
||||
#include "EspPartitions_i.h"
|
||||
#include "Log.h"
|
||||
@@ -51,4 +51,4 @@ esp_err_t initPartitionsEsp() {
|
||||
|
||||
} // namespace
|
||||
|
||||
#endif // ESP_TARGET
|
||||
#endif // ESP_PLATFORM
|
||||
|
||||
@@ -38,6 +38,7 @@ static void register_and_start_system_services() {
|
||||
}
|
||||
|
||||
void initHeadless(const hal::Configuration& config) {
|
||||
TT_LOG_I(TAG, "Tactility v%s on %s (%s)", TT_VERSION, CONFIG_TT_BOARD_NAME, CONFIG_TT_BOARD_ID);
|
||||
#ifdef ESP_PLATFORM
|
||||
initEsp();
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#ifdef ESP_TARGET
|
||||
#ifdef ESP_PLATFORM
|
||||
|
||||
#include "TactilityCore.h"
|
||||
#include "EspPartitions_i.h"
|
||||
|
||||
@@ -74,7 +74,7 @@ bool SpiSdCard::mountInternal(const char* mountPoint) {
|
||||
// The following value is from T-Deck repo's UnitTest.ino project:
|
||||
// https://github.com/Xinyuan-LilyGO/T-Deck/blob/master/examples/UnitTest/UnitTest.ino
|
||||
// Observation: Using this automatically sets the bus to 20MHz
|
||||
host.max_freq_khz = config->spiFrequency / 1000U;
|
||||
host.max_freq_khz = config->spiFrequencyKhz;
|
||||
host.slot = config->spiHost;
|
||||
|
||||
esp_err_t result = esp_vfs_fat_sdspi_mount(mountPoint, &host, &slot_config, &mount_config, &card);
|
||||
|
||||
@@ -19,7 +19,6 @@ class SpiSdCard : public tt::hal::SdCard {
|
||||
public:
|
||||
struct Config {
|
||||
Config(
|
||||
int spiFrequency,
|
||||
gpio_num_t spiPinCs,
|
||||
gpio_num_t spiPinCd,
|
||||
gpio_num_t spiPinWp,
|
||||
@@ -27,8 +26,9 @@ public:
|
||||
MountBehaviour mountBehaviourAtBoot,
|
||||
std::shared_ptr<Lockable> lockable = nullptr,
|
||||
std::vector<gpio_num_t> csPinWorkAround = std::vector<gpio_num_t>(),
|
||||
spi_host_device_t spiHost = SPI2_HOST
|
||||
) : spiFrequency(spiFrequency),
|
||||
spi_host_device_t spiHost = SPI2_HOST,
|
||||
int spiFrequencyKhz = SDMMC_FREQ_DEFAULT
|
||||
) : spiFrequencyKhz(spiFrequencyKhz),
|
||||
spiPinCs(spiPinCs),
|
||||
spiPinCd(spiPinCd),
|
||||
spiPinWp(spiPinWp),
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
spiHost(spiHost)
|
||||
{}
|
||||
|
||||
int spiFrequency;
|
||||
int spiFrequencyKhz;
|
||||
gpio_num_t spiPinCs; // Clock
|
||||
gpio_num_t spiPinCd; // Card detect
|
||||
gpio_num_t spiPinWp; // Write-protect
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#ifdef ESP_TARGET
|
||||
#ifdef ESP_PLATFORM
|
||||
|
||||
#include "I2c.h"
|
||||
#include "Log.h"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef ESP_TARGET
|
||||
#ifdef ESP_PLATFORM
|
||||
#include <hal/i2c_types.h>
|
||||
#include <driver/i2c.h>
|
||||
#else
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#ifndef ESP_TARGET
|
||||
#ifndef ESP_PLATFORM
|
||||
|
||||
/**
|
||||
* This code is based on i2c_manager from https://github.com/ropg/i2c_manager/blob/master/i2c_manager/i2c_manager.c (original has MIT license)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#ifdef ESP_TARGET
|
||||
#ifdef ESP_PLATFORM
|
||||
|
||||
#include "Wifi.h"
|
||||
|
||||
@@ -970,4 +970,4 @@ extern const ServiceManifest manifest = {
|
||||
|
||||
} // namespace
|
||||
|
||||
#endif // ESP_TARGET
|
||||
#endif // ESP_PLATFORM
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "Wifi.h"
|
||||
|
||||
#ifndef ESP_TARGET
|
||||
#ifndef ESP_PLATFORM
|
||||
|
||||
#include "Check.h"
|
||||
#include "Log.h"
|
||||
@@ -160,4 +160,4 @@ extern const ServiceManifest manifest = {
|
||||
|
||||
} // namespace
|
||||
|
||||
#endif // ESP_TARGET
|
||||
#endif // ESP_PLATFORM
|
||||
@@ -1,4 +1,4 @@
|
||||
#ifdef ESP_TARGET
|
||||
#ifdef ESP_PLATFORM
|
||||
|
||||
#include "WifiGlobals.h"
|
||||
#include "WifiSettings.h"
|
||||
@@ -144,4 +144,4 @@ bool remove(const char* ssid) {
|
||||
|
||||
} // nemespace
|
||||
|
||||
#endif // ESP_TARGET
|
||||
#endif // ESP_PLATFORM
|
||||
@@ -1,4 +1,4 @@
|
||||
#ifndef ESP_TARGET
|
||||
#ifndef ESP_PLATFORM
|
||||
|
||||
#include "WifiSettings.h"
|
||||
#include "Log.h"
|
||||
@@ -25,4 +25,4 @@ bool remove(const char* ssid) {
|
||||
|
||||
} // namespace
|
||||
|
||||
#endif // ESP_TARGET
|
||||
#endif // ESP_PLATFORM
|
||||
Reference in New Issue
Block a user