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:
Sebastien
2020-03-11 15:51:55 -04:00
parent 993cdc7492
commit ea873ae3bc
13 changed files with 50 additions and 791 deletions

View File

@@ -7,6 +7,6 @@ idf_component_register( SRCS
platform_console.c
INCLUDE_DIRS .
REQUIRES nvs_flash
PRIV_REQUIRES console tools services spi_flash app_update platform_config vfs pthread wifi-manager platform_config newlib telnet display)
PRIV_REQUIRES console tools services spi_flash app_update platform_config vfs pthread wifi-manager platform_config newlib telnet )
target_link_libraries(${COMPONENT_LIB} ${build_dir}/esp-idf/$<TARGET_PROPERTY:RECOVERY_PREFIX>/lib$<TARGET_PROPERTY:RECOVERY_PREFIX>.a )

View File

@@ -146,7 +146,7 @@ else {
if(err!=ESP_OK){
ESP_LOGE(TAG,"Unable to set partition as active for next boot. %s",esp_err_to_name(err));
bFound=false;
messaging_post_message(MESSAGING_ERROR,MESSAGING_CLASS_SYSTEM,"Unable to select partition for reboot.");
messaging_post_message(MESSAGING_ERROR,MESSAGING_CLASS_SYSTEM,"Unable to select partition for reboot: %s",esp_err_to_name(err));
}
else{
ESP_LOGW(TAG, "Application partition %s sub type %u is selected for boot", partition->label,partition_subtype);

View File

@@ -29,12 +29,7 @@
#include "platform_config.h"
#include "telnet.h"
#include "gds.h"
#include "gds_default_if.h"
#include "gds_draw.h"
#include "gds_text.h"
#include "gds_font.h"
#include "display.h"
#include "config.h"
pthread_t thread_console;
@@ -48,6 +43,7 @@ extern void register_squeezelite();
* This can be customized, made dynamic, etc.
*/
const char* prompt = LOG_COLOR_I "squeezelite-esp32> " LOG_RESET_COLOR;
const char* recovery_prompt = LOG_COLOR_E "recovery-squeezelite-esp32> " LOG_RESET_COLOR;
/* Console command history can be stored to and loaded from a file.
* The easiest way to do this is to use FATFS filesystem on top of
@@ -161,11 +157,6 @@ void initialize_console() {
}
void console_start() {
if(is_recovery_running){
GDS_ClearExt(display, true);
GDS_SetFont(display, &Font_droid_sans_fallback_15x17 );
GDS_TextPos(display, GDS_FONT_MEDIUM, GDS_TEXT_CENTERED, GDS_TEXT_CLEAR | GDS_TEXT_UPDATE, "RECOVERY");
}
if(!is_serial_suppressed()){
initialize_console();
}
@@ -224,13 +215,18 @@ void console_start() {
/* Since the terminal doesn't support escape sequences,
* don't use color codes in the prompt.
*/
if(is_recovery_running){
recovery_prompt= "recovery-squeezelite-esp32>";
}
prompt = "squeezelite-esp32> ";
#endif //CONFIG_LOG_COLORS
}
esp_pthread_cfg_t cfg = esp_pthread_get_default_config();
cfg.thread_name= "console";
cfg.inherit_cfg = true;
if(is_recovery_running){
prompt = recovery_prompt;
cfg.stack_size = 4096 ;
}
esp_pthread_set_cfg(&cfg);