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
@@ -0,0 +1,41 @@
|
||||
#ifdef ESP_PLATFORM
|
||||
|
||||
#include <Tactility/Logger.h>
|
||||
#include <Tactility/PartitionsEsp.h>
|
||||
#include <Tactility/TactilityCore.h>
|
||||
|
||||
#include "esp_event.h"
|
||||
#include "esp_netif.h"
|
||||
#include "nvs_flash.h"
|
||||
|
||||
namespace tt {
|
||||
|
||||
static auto LOGGER = Logger("Tactility");
|
||||
|
||||
// Initialize NVS
|
||||
static void initNvs() {
|
||||
LOGGER.info("Init NVS");
|
||||
esp_err_t ret = nvs_flash_init();
|
||||
if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND) {
|
||||
LOGGER.info("NVS erasing");
|
||||
ESP_ERROR_CHECK(nvs_flash_erase());
|
||||
ret = nvs_flash_init();
|
||||
}
|
||||
ESP_ERROR_CHECK(ret);
|
||||
}
|
||||
|
||||
static void initNetwork() {
|
||||
LOGGER.info("Init network");
|
||||
ESP_ERROR_CHECK(esp_netif_init());
|
||||
ESP_ERROR_CHECK(esp_event_loop_create_default());
|
||||
}
|
||||
|
||||
void initEsp() {
|
||||
initNvs();
|
||||
initPartitionsEsp();
|
||||
initNetwork();
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user