mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-06 19:47:02 +03:00
Stabilizing a few things.
Music plays, httpd responds in a snap, messaging subsystem works, full end-to-end flash erase/flash/configure wifi & hardware/reboot to squeezelite was tested. CMake system works well: it now allows to flash in a single command (assuming esp-idf V4.0 is properly installed on the system) with the standard line: idf.py flash -p <comport> this makes building and flashing the app less confusing for new developers/users wanting to experiment
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
idf_component_register(SRC_DIRS . core core/ifaces fonts
|
||||
INCLUDE_DIRS . fonts core
|
||||
REQUIRES platform_config tools esp_common
|
||||
PRIV_REQUIRES services freertos driver
|
||||
PRIV_REQUIRES services freertos driver
|
||||
)
|
||||
|
||||
set_source_files_properties(display.c
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "gds_err.h"
|
||||
#include "gds_private.h"
|
||||
#include "gds_default_if.h"
|
||||
#include "messaging.h"
|
||||
|
||||
static int I2CPortNumber;
|
||||
static int I2CWait;
|
||||
@@ -89,6 +90,12 @@ bool GDS_I2CAttachDevice( struct GDS_Device* Device, int Width, int Height, int
|
||||
static bool I2CDefaultWriteBytes( int Address, bool IsCommand, const uint8_t* Data, size_t DataLength ) {
|
||||
i2c_cmd_handle_t* CommandHandle = NULL;
|
||||
static uint8_t ModeByte = 0;
|
||||
static uint32_t failures=0;
|
||||
if(failures > 1000){
|
||||
ESP_LOGE("I2C_Display","I2C Write failure");
|
||||
failures = 1;
|
||||
return false;
|
||||
}
|
||||
|
||||
NullCheck( Data, return false );
|
||||
|
||||
@@ -108,6 +115,10 @@ static bool I2CDefaultWriteBytes( int Address, bool IsCommand, const uint8_t* Da
|
||||
return true;
|
||||
|
||||
error:
|
||||
|
||||
if(++failures == 1){
|
||||
messaging_post_message(MESSAGING_ERROR,MESSAGING_CLASS_SYSTEM, "Display communication failed.");
|
||||
}
|
||||
if (CommandHandle) i2c_cmd_link_delete( CommandHandle );
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user