Commit bbbc2ddf authored by matt's avatar matt
Browse files

Fix a few warnings found when testing esp-idf 4.2

parent ce53184b
......@@ -95,7 +95,7 @@ void ChannelMgr_Main() {
LedDrv_States[6+4] = avg;
if (!I2cMgr_Seize(false, pdMS_TO_TICKS(1000))) {
ESP_LOGE(TAG, "Couldn't seize bus !!");
return false;
return;
}
LedDrv_Update();
I2cMgr_Release(false);
......
......@@ -15,13 +15,13 @@ void Gd3ParseDescriptor(FILE *f, VgmInfoStruct_t *info, Gd3Descriptor_t *desc) {
fread(&magic, 4, 1, f);
if (magic != 0x20336447) {
ESP_LOGE(TAG, "Bad magic !!");
return false;
return;
}
fread(&desc->version, 4, 1, f);
if (desc->version != 0x00000100) {
ESP_LOGE(TAG, "Bad version !!");
return false;
return;
}
//skip size
......@@ -71,4 +71,4 @@ void Gd3GetStringChars(FILE *f, Gd3Descriptor_t *desc, Gd3String_t stringid, cha
}
}
*buf = 0;
}
\ No newline at end of file
}
......@@ -18,6 +18,6 @@ void Hspi_Setup() {
esp_err_t ret = spi_bus_initialize(HSPI_HOST, &HspiBusConfig, 1);
if (ret != ESP_OK) {
ESP_LOGE(TAG, "Spi bus init fail !! 0x%x", ret);
return false;
return;
}
}
\ No newline at end of file
}
......@@ -33,7 +33,7 @@ bool KeyMgr_Setup() {
void KeyMgr_SendEvent(uint8_t key, uint8_t state) {
if (KeyMgr_TargetQueue == NULL) {
ESP_LOGW(TAG, "Warning: Sending key event when no target queue is set !!");
return false;
return;
}
KeyEvent_t KeyEvent;
KeyEvent.Key = key;
......@@ -41,7 +41,7 @@ void KeyMgr_SendEvent(uint8_t key, uint8_t state) {
BaseType_t ret = xQueueSend(KeyMgr_TargetQueue, &KeyEvent, 0);
if (ret == errQUEUE_FULL) {
ESP_LOGW(TAG, "Warning: Target queue for key events is full, event will be dropped !!");
return false;
return;
}
if (KeyMgr_TargetTask != NULL && (state & KEY_EVENT_PRESS)) xTaskNotify(KeyMgr_TargetTask, 0, eNoAction);
}
......@@ -110,4 +110,4 @@ void KeyMgr_Main() {
}
}
}
}
\ No newline at end of file
}
......@@ -185,7 +185,7 @@ bool LedDrv_Setup() {
void LedDrv_UpdateBrightness() {
if (!I2cMgr_Seize(false, pdMS_TO_TICKS(1000))) {
ESP_LOGE(TAG, "Couldn't seize bus !!");
return false;
return;
}
LedDrv_WriteRegister(0, 0x0a, LedDrv_Brightness);
......
......@@ -165,7 +165,7 @@ void Player_Main() {
ESP_LOGI(TAG, "Wait for driver to resume...");
if ((xEventGroupWaitBits(Driver_CommandEvents, DRIVER_EVENT_RUNNING, false, false, pdMS_TO_TICKS(3000)) & DRIVER_EVENT_RUNNING) == 0) {
ESP_LOGE(TAG, "Driver resume timeout !!");
return false;
return;
}
}
xEventGroupClearBits(Player_Status, PLAYER_STATUS_PAUSED);
......
......@@ -21,7 +21,7 @@ volatile bool Queue_Shuffle = false;
static const char cachefilename[] = "/sd/.mega/m3ucache.bin";
static const char cachefilename_shuf[] = "/sd/.mega/m3ushufl.bin";
void QueueLoadM3u(char *M3uPath, char *M3uFilename, uint32_t pos, bool CountComments, bool ShufflePreserveCurrentEntry) { //make sure to never call this while player is running! it fucks with the fileptr, temp vars, and queue position!
void QueueLoadM3u(const char *M3uPath, const char *M3uFilename, uint32_t pos, bool CountComments, bool ShufflePreserveCurrentEntry) { //make sure to never call this while player is running! it fucks with the fileptr, temp vars, and queue position!
CountComments = false; //needs to either be handled properly, or deleted. just doing this for now...
ESP_LOGI(TAG, "QueueLoadM3u() starting");
......
......@@ -19,9 +19,9 @@ extern IRAM_ATTR uint32_t QueuePosition;
extern IRAM_ATTR uint32_t QueueLength;
extern volatile bool Queue_Shuffle;
void QueueLoadM3u(char *M3uPath, char *M3uFilename, uint32_t pos, bool CountComments, bool ShufflePreserveCurrentEntry);
void QueueLoadM3u(const char *M3uPath, const char *M3uFilename, uint32_t pos, bool CountComments, bool ShufflePreserveCurrentEntry);
bool QueueNext();
bool QueuePrev();
void QueueSetupEntry(bool ReturnComments, bool ProcessShuffle);
#endif
\ No newline at end of file
#endif
......@@ -66,7 +66,7 @@ static IRAM_ATTR lv_obj_t *broken_vgm_time_warning;
static uint8_t selectedopt = 0;
static bool optionsopen = false;
static lv_style_t textstyle_sm_sel;
static char loopcountbuf[3] = {0,0,0};
static char loopcountbuf[4] = {0};
static char pitchbuf[10] = "";
static const char *loading = "Nothing playing...";
static const char *broken_vgm_time_warning_text = " Playback time unavailable due to broken VGM file";
......
......@@ -175,7 +175,7 @@ void Ui_ShuffleAll_Setup(lv_obj_t *uiscreen) {
temppath = malloc(264);
if (path == NULL || temppath == NULL) {
ESP_LOGE(TAG, "out of heap in shuffle all");
return false;
return;
}
strcpy(path, "/sd");
ESP_LOGI(TAG, "start dumping playlist");
......@@ -216,4 +216,4 @@ void Ui_ShuffleAll_Destroy() {
void Ui_ShuffleAll_Key(KeyEvent_t event) {
}
\ No newline at end of file
}
......@@ -65,7 +65,7 @@ bool Ui_SoftBar_Setup(lv_obj_t *uiscreen) {
return true;
}
bool Ui_SoftBar_Update(uint8_t id, bool enabled, char *text, bool HandleMutex) {
bool Ui_SoftBar_Update(uint8_t id, bool enabled, const char *text, bool HandleMutex) {
if (HandleMutex) LcdDma_Mutex_Take(pdMS_TO_TICKS(1000));
lv_obj_set_style(softbarlabels[id], enabled?&softbarstyle:&softbarstyle_disbl);
lv_label_set_text(softbarlabels[id], text);
......@@ -74,7 +74,7 @@ bool Ui_SoftBar_Update(uint8_t id, bool enabled, char *text, bool HandleMutex) {
return true;
}
bool Ui_SoftBar_UpdateModal(uint8_t id, bool enabled, char *text, bool HandleMutex) {
bool Ui_SoftBar_UpdateModal(uint8_t id, bool enabled, const char *text, bool HandleMutex) {
if (HandleMutex) LcdDma_Mutex_Take(pdMS_TO_TICKS(1000));
lv_obj_set_style(softbarlabels_modal[id], enabled?&softbarstyle:&softbarstyle_disbl);
lv_label_set_text(softbarlabels_modal[id], text);
......
......@@ -5,8 +5,8 @@
#include "lvgl.h"
bool Ui_SoftBar_Setup(lv_obj_t *uiscreen);
bool Ui_SoftBar_Update(uint8_t id, bool enabled, char *text, bool HandleMutex);
bool Ui_SoftBar_UpdateModal(uint8_t id, bool enabled, char *text, bool HandleMutex);
bool Ui_SoftBar_Update(uint8_t id, bool enabled, const char *text, bool HandleMutex);
bool Ui_SoftBar_UpdateModal(uint8_t id, bool enabled, const char *text, bool HandleMutex);
void Ui_SoftBar_ShowModal(bool show, bool HandleMutex);
#endif
\ No newline at end of file
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment