Fixes & memory optimizations (#540)
- Disable BlueTooth driver by default, to ensure it doesn't allocate memory - Update BlueTooth settings app behaviour to make sure it starts/stops the devices - Disable SPI RAM usage for ST7789 as it broke App Hub - Reduce T-Display and T-Deck display buffers from 1/3rd to 1/10th of resolution - Enabled dynamic buffers for MbedTLS to optimize memory - TLS 1.3 did not work with dynamic buffers: downgrade to 1.2 for now - WiFi is now enabled from the Boot app callback to the WiFi service, instead of the WiFi service start() function. This avoids a lockup when WiFi is started by the service while the Boot app is updating the WiFi settings.
This commit is contained in:
committed by
GitHub
parent
599fa46766
commit
d3439f6f45
@@ -166,11 +166,11 @@ class StatusbarService final : public Service {
|
||||
}
|
||||
|
||||
void updateBluetoothIcon() {
|
||||
auto radio_state = tt::bluetooth::getRadioState();
|
||||
struct Device* btdev = tt::bluetooth::findFirstDevice();
|
||||
auto radio_state = bluetooth::getRadioState();
|
||||
Device* btdev = device_find_first_active_by_type(&BLUETOOTH_TYPE);
|
||||
bool scanning = btdev ? bluetooth_is_scanning(btdev) : false;
|
||||
struct Device* serial_dev = bluetooth_serial_get_device();
|
||||
struct Device* midi_dev = bluetooth_midi_get_device();
|
||||
Device* serial_dev = bluetooth_serial_get_device();
|
||||
Device* midi_dev = bluetooth_midi_get_device();
|
||||
bool connected = (serial_dev && bluetooth_serial_is_connected(serial_dev)) ||
|
||||
(midi_dev && bluetooth_midi_is_connected(midi_dev));
|
||||
const char* desired_icon = getBluetoothStatusIcon(radio_state, scanning, connected);
|
||||
@@ -213,8 +213,8 @@ class StatusbarService final : public Service {
|
||||
}
|
||||
|
||||
void updateUsbIcon() {
|
||||
struct Device* hid_dev = device_find_first_active_by_type(&USB_HOST_HID_TYPE);
|
||||
struct Device* midi_dev = device_find_first_active_by_type(&USB_HOST_MIDI_TYPE);
|
||||
Device* hid_dev = device_find_first_active_by_type(&USB_HOST_HID_TYPE);
|
||||
Device* midi_dev = device_find_first_active_by_type(&USB_HOST_MIDI_TYPE);
|
||||
bool connected = (hid_dev && usb_host_hid_is_connected(hid_dev)) ||
|
||||
(midi_dev && usb_midi_is_connected(midi_dev));
|
||||
if (!connected) {
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#include <Tactility/service/wifi/WifiBootSplashInit.h>
|
||||
|
||||
#include "Tactility/service/wifi/Wifi.h"
|
||||
#include "Tactility/service/wifi/WifiSettings.h"
|
||||
|
||||
#include <Tactility/file/PropertiesFile.h>
|
||||
|
||||
#include <Tactility/MountPoints.h>
|
||||
@@ -116,7 +120,9 @@ static void importWifiApSettingsFromDir(const std::string& path) {
|
||||
}
|
||||
|
||||
void bootSplashInit() {
|
||||
LOGGER.info("bootSplashInit begin");
|
||||
getMainDispatcher().dispatch([] {
|
||||
LOGGER.info("bootSplashInit dispatch begin");
|
||||
// First import any provisioning files placed on the system data partition.
|
||||
const std::string data_settings_path = file::getChildPath(file::MOUNT_POINT_DATA, "settings");
|
||||
importWifiApSettingsFromDir(data_settings_path);
|
||||
@@ -127,7 +133,15 @@ void bootSplashInit() {
|
||||
const std::string sd_settings_path = file::getChildPath(sdcard_path, "settings");
|
||||
importWifiApSettingsFromDir(sd_settings_path);
|
||||
}
|
||||
|
||||
if (settings::shouldEnableOnBoot()) {
|
||||
LOGGER.info("Auto-enabling due to setting");
|
||||
getMainDispatcher().dispatch([] -> void { setEnabled(true); });
|
||||
}
|
||||
|
||||
LOGGER.info("bootSplashInit dispatch end");
|
||||
});
|
||||
LOGGER.info("bootSplashInit end");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -926,11 +926,6 @@ public:
|
||||
// We want to try and scan more often in case of startup or scan lock failure
|
||||
wifi_singleton->autoConnectTimer->start();
|
||||
|
||||
if (settings::shouldEnableOnBoot()) {
|
||||
LOGGER.info("Auto-enabling due to setting");
|
||||
getMainDispatcher().dispatch([] { dispatchEnable(wifi_singleton); });
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user