New logging and more (#446)
- `TT_LOG_*` macros are replaced by `Logger` via `#include<Tactility/Logger.h>` - Changed default timezone to Europe/Amsterdam - Fix for logic bug in unPhone hardware - Fix for init/deinit in DRV2605 driver - Other fixes - Removed optimization that broke unPhone (disabled the moving of heap-related functions to flash)
This commit is contained in:
committed by
GitHub
parent
719f7bcece
commit
f620255c41
@@ -2,6 +2,7 @@
|
||||
|
||||
#include <Tactility/app/wificonnect/View.h>
|
||||
#include <Tactility/app/wificonnect/WifiConnect.h>
|
||||
#include <Tactility/Logger.h>
|
||||
#include <Tactility/lvgl/Toolbar.h>
|
||||
#include <Tactility/lvgl/Spinner.h>
|
||||
#include <Tactility/service/wifi/WifiApSettings.h>
|
||||
@@ -12,7 +13,7 @@
|
||||
|
||||
namespace tt::app::wificonnect {
|
||||
|
||||
constexpr auto* TAG = "WifiConnect";
|
||||
static const auto LOGGER = Logger("WifiConnect");
|
||||
|
||||
void View::resetErrors() {
|
||||
lv_obj_add_flag(password_error, LV_OBJ_FLAG_HIDDEN);
|
||||
@@ -30,7 +31,7 @@ static void onConnect(TT_UNUSED lv_event_t* event) {
|
||||
const char* ssid = lv_textarea_get_text(view.ssid_textarea);
|
||||
size_t ssid_len = strlen(ssid);
|
||||
if (ssid_len > TT_WIFI_SSID_LIMIT) {
|
||||
TT_LOG_E(TAG, "SSID too long");
|
||||
LOGGER.error("SSID too long");
|
||||
lv_label_set_text(view.ssid_error, "SSID too long");
|
||||
lv_obj_remove_flag(view.ssid_error, LV_OBJ_FLAG_HIDDEN);
|
||||
return;
|
||||
@@ -39,7 +40,7 @@ static void onConnect(TT_UNUSED lv_event_t* event) {
|
||||
const char* password = lv_textarea_get_text(view.password_textarea);
|
||||
size_t password_len = strlen(password);
|
||||
if (password_len > TT_WIFI_CREDENTIALS_PASSWORD_LIMIT) {
|
||||
TT_LOG_E(TAG, "Password too long");
|
||||
LOGGER.error("Password too long");
|
||||
lv_label_set_text(view.password_error, "Password too long");
|
||||
lv_obj_remove_flag(view.password_error, LV_OBJ_FLAG_HIDDEN);
|
||||
return;
|
||||
@@ -199,7 +200,7 @@ void View::init(AppContext& app, lv_obj_t* parent) {
|
||||
}
|
||||
|
||||
std::string password;
|
||||
if (optPasswordParameter(bundle, ssid)) {
|
||||
if (optPasswordParameter(bundle, password)) {
|
||||
lv_textarea_set_text(password_textarea, password.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
#include <Tactility/app/wificonnect/WifiConnect.h>
|
||||
|
||||
#include <Tactility/Logger.h>
|
||||
#include <Tactility/LogMessages.h>
|
||||
#include <Tactility/app/AppContext.h>
|
||||
#include <Tactility/lvgl/LvglSync.h>
|
||||
#include <Tactility/service/loader/Loader.h>
|
||||
#include <Tactility/service/wifi/Wifi.h>
|
||||
#include <Tactility/lvgl/LvglSync.h>
|
||||
|
||||
namespace tt::app::wificonnect {
|
||||
|
||||
constexpr auto* TAG = "WifiConnect";
|
||||
static const auto LOGGER = Logger("WifiConnect");
|
||||
constexpr auto* WIFI_CONNECT_PARAM_SSID = "ssid"; // String
|
||||
constexpr auto* WIFI_CONNECT_PARAM_PASSWORD = "password"; // String
|
||||
|
||||
@@ -72,7 +74,7 @@ void WifiConnect::requestViewUpdate() {
|
||||
view.update();
|
||||
lvgl::unlock();
|
||||
} else {
|
||||
TT_LOG_E(TAG, LOG_MESSAGE_MUTEX_LOCK_FAILED_FMT, "LVGL");
|
||||
LOGGER.error(LOG_MESSAGE_MUTEX_LOCK_FAILED_FMT, "LVGL");
|
||||
}
|
||||
}
|
||||
unlock();
|
||||
|
||||
Reference in New Issue
Block a user