Skip to content

Commit

Permalink
adjusted some mistakes
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasguyer committed Jul 16, 2024
2 parents ef5a614 + a7426ec commit 25913c6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
3 changes: 1 addition & 2 deletions cspot/src/TrackQueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -714,8 +714,7 @@ bool TrackQueue::queueNextTrack(int offset, uint32_t positionMs) {
void TrackQueue::prepareRepeat() {
if (currentTracksIndex > 0)
preloadedTracks.clear();
preloadedTracks.push_front(
std::make_shared<QueuedTrack>(currentTracks[currentTracksIndex], ctx, 0));
queueNextTrack(0);
}

bool TrackQueue::skipTrack(SkipDirection dir, bool expectNotify) {
Expand Down
18 changes: 10 additions & 8 deletions targets/esp32/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include "BellTask.h"
#include "civetweb.h"
#include "esp_event.h"
#include "esp_log.h"
#include "esp_spiffs.h"
#include "esp_system.h"
#include "esp_wifi.h"
Expand All @@ -32,6 +31,7 @@

#include "BellUtils.h"
#include "Logger.h"
#include "esp_log.h"

#define DEVICE_NAME CONFIG_CSPOT_DEVICE_NAME

Expand Down Expand Up @@ -241,22 +241,23 @@ void init_spiffs() {

if (ret != ESP_OK) {
if (ret == ESP_FAIL) {
ESP_LOGE(TAG, "Failed to mount or format filesystem");
ESP_LOGE("SPIFFS", "Failed to mount or format filesystem");
} else if (ret == ESP_ERR_NOT_FOUND) {
ESP_LOGE(TAG, "Failed to find SPIFFS partition");
ESP_LOGE("SPIFFS", "Failed to find SPIFFS partition");
} else {
ESP_LOGE(TAG, "Failed to initialize SPIFFS (%s)", esp_err_to_name(ret));
ESP_LOGE("SPIFFS", "Failed to initialize SPIFFS (%s)",
esp_err_to_name(ret));
}
return;
}

size_t total = 0, used = 0;
ret = esp_spiffs_info(conf.partition_label, &total, &used);
if (ret != ESP_OK) {
ESP_LOGE(TAG, "Failed to get SPIFFS partition information (%s)",
esp_err_to_name(ret));
ESP_LOGE("SPIFFS", "Failed to get SPIFFS partition information (%s)",
esp_err_to_name(ret));
} else {
ESP_LOGI(TAG, "Partition size: total: %d, used: %d", total, used);
CSPOT_LOG(info, "Partition size: total: %d, used: %d", total, used);
}
}

Expand All @@ -283,7 +284,8 @@ void app_main(void) {

// statusLed->setStatus(StatusLed::WIFI_CONNECTED);

ESP_LOGI(TAG, "Connected to AP, start spotify receiver");

ESP_LOGI("MAIN", "Connected to AP, start spotify receiver");
//auto taskHandle = xTaskCreatePinnedToCore(&cspotTask, "cspot", 12*1024, NULL, 5, NULL, 1);
/*auto taskHandle = */
bell::setDefaultLogger();
Expand Down

0 comments on commit 25913c6

Please sign in to comment.