mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-31 21:59:43 +03:00
Compare commits
8 Commits
I2S-4MFlas
...
SqueezeAmp
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7f0ae69e81 | ||
|
|
e21e2cf7f9 | ||
|
|
57cd009e4c | ||
|
|
78e8d60021 | ||
|
|
4068e07a45 | ||
|
|
a633524936 | ||
|
|
40a698e2f1 | ||
|
|
38d28ae8c4 |
@@ -73,7 +73,7 @@ set_target_properties(recovery.elf PROPERTIES LINK_LIBRARIES "${BCA};idf::app_re
|
|||||||
# build squeezelite, add app_squeezelite to the link
|
# build squeezelite, add app_squeezelite to the link
|
||||||
add_executable(squeezelite.elf "CMakeLists.txt")
|
add_executable(squeezelite.elf "CMakeLists.txt")
|
||||||
add_dependencies(squeezelite.elf recovery.elf)
|
add_dependencies(squeezelite.elf recovery.elf)
|
||||||
set_target_properties(squeezelite.elf PROPERTIES LINK_LIBRARIES "${BCA};idf::app_squeezelite;-Wl,--Map=${BUILD_DIR}/squeezelite.map")
|
set_target_properties(squeezelite.elf PROPERTIES LINK_LIBRARIES "${BCA};idf::app_squeezelite;-Wl,--Map=${BUILD_DIR}/squeezelite.map,--wrap=esp_panic_handler")
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
TARGET squeezelite.elf
|
TARGET squeezelite.elf
|
||||||
POST_BUILD
|
POST_BUILD
|
||||||
@@ -228,4 +228,4 @@ endif()
|
|||||||
# target_compile_definitions(__idf_wear_levelling PRIVATE -DLOG_LOCAL_LEVEL=ESP_LOG_DEBUG)
|
# target_compile_definitions(__idf_wear_levelling PRIVATE -DLOG_LOCAL_LEVEL=ESP_LOG_DEBUG)
|
||||||
# target_compile_definitions(__idf_wifi_provisioning PRIVATE -DLOG_LOCAL_LEVEL=ESP_LOG_DEBUG)
|
# target_compile_definitions(__idf_wifi_provisioning PRIVATE -DLOG_LOCAL_LEVEL=ESP_LOG_DEBUG)
|
||||||
# target_compile_definitions(__idf_wpa_supplicant PRIVATE -DLOG_LOCAL_LEVEL=ESP_LOG_DEBUG)
|
# target_compile_definitions(__idf_wpa_supplicant PRIVATE -DLOG_LOCAL_LEVEL=ESP_LOG_DEBUG)
|
||||||
# target_compile_definitions(__idf_xtensa PRIVATE -DLOG_LOCAL_LEVEL=ESP_LOG_DEBUG)
|
# target_compile_definitions(__idf_xtensa PRIVATE -DLOG_LOCAL_LEVEL=ESP_LOG_DEBUG)
|
||||||
|
|||||||
@@ -705,6 +705,26 @@ esp_err_t i2s_stop(i2s_port_t i2s_num)
|
|||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* When a panic occurs during playback, the I2S interface can produce a loud noise burst.
|
||||||
|
* This code runs just before the system panic handler to "emergency stop" the I2S iterface
|
||||||
|
* to prevent the noise burst from happening. Note that when this code is called the system
|
||||||
|
* has already crashed, so no need to disable interrupts, acquire locks, or otherwise be nice.
|
||||||
|
*
|
||||||
|
* This code makes use of the linker --wrap feature to intercept the call to esp_panic_handler.
|
||||||
|
*/
|
||||||
|
|
||||||
|
void __real_esp_panic_handler(void*);
|
||||||
|
|
||||||
|
void __wrap_esp_panic_handler (void* info) {
|
||||||
|
esp_rom_printf("I2S abort!\r\n");
|
||||||
|
|
||||||
|
i2s_hal_stop_tx(&(p_i2s_obj[CONFIG_I2S_NUM]->hal));
|
||||||
|
|
||||||
|
/* Call the original panic handler function to finish processing this error */
|
||||||
|
__real_esp_panic_handler(info);
|
||||||
|
}
|
||||||
|
|
||||||
#if SOC_I2S_SUPPORTS_ADC_DAC
|
#if SOC_I2S_SUPPORTS_ADC_DAC
|
||||||
esp_err_t i2s_set_dac_mode(i2s_dac_mode_t dac_mode)
|
esp_err_t i2s_set_dac_mode(i2s_dac_mode_t dac_mode)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ static void register_free();
|
|||||||
static void register_setdevicename();
|
static void register_setdevicename();
|
||||||
static void register_heap();
|
static void register_heap();
|
||||||
static void register_dump_heap();
|
static void register_dump_heap();
|
||||||
|
static void register_abort();
|
||||||
static void register_version();
|
static void register_version();
|
||||||
static void register_restart();
|
static void register_restart();
|
||||||
#if CONFIG_WITH_CONFIG_UI
|
#if CONFIG_WITH_CONFIG_UI
|
||||||
@@ -90,6 +91,7 @@ void register_system()
|
|||||||
register_free();
|
register_free();
|
||||||
register_heap();
|
register_heap();
|
||||||
register_dump_heap();
|
register_dump_heap();
|
||||||
|
register_abort();
|
||||||
register_version();
|
register_version();
|
||||||
register_restart();
|
register_restart();
|
||||||
register_factory_boot();
|
register_factory_boot();
|
||||||
@@ -144,6 +146,27 @@ static void register_version()
|
|||||||
ESP_ERROR_CHECK( esp_console_cmd_register(&cmd) );
|
ESP_ERROR_CHECK( esp_console_cmd_register(&cmd) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 'abort' command */
|
||||||
|
static int cmd_abort(int argc, char **argv)
|
||||||
|
{
|
||||||
|
cmd_send_messaging(argv[0],MESSAGING_INFO,"ABORT!\r\n");
|
||||||
|
|
||||||
|
abort();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void register_abort()
|
||||||
|
{
|
||||||
|
const esp_console_cmd_t cmd = {
|
||||||
|
.command = "abort",
|
||||||
|
.help = "Crash now!",
|
||||||
|
.hint = NULL,
|
||||||
|
.func = &cmd_abort,
|
||||||
|
};
|
||||||
|
cmd_to_json(&cmd);
|
||||||
|
ESP_ERROR_CHECK( esp_console_cmd_register(&cmd) );
|
||||||
|
}
|
||||||
|
|
||||||
esp_err_t guided_boot(esp_partition_subtype_t partition_subtype)
|
esp_err_t guided_boot(esp_partition_subtype_t partition_subtype)
|
||||||
{
|
{
|
||||||
if(is_recovery_running){
|
if(is_recovery_running){
|
||||||
|
|||||||
@@ -687,6 +687,7 @@ void draw_VU(struct GDS_Device * display, int level, int x, int y, int width, bo
|
|||||||
static void grfe_handler( u8_t *data, int len) {
|
static void grfe_handler( u8_t *data, int len) {
|
||||||
struct grfe_packet *pkt = (struct grfe_packet*) data;
|
struct grfe_packet *pkt = (struct grfe_packet*) data;
|
||||||
|
|
||||||
|
GDS_CHECK_FOR_DEVICE(display,return);
|
||||||
// we don't support transition, simply claim we're done
|
// we don't support transition, simply claim we're done
|
||||||
if (pkt->transition != 'c') {
|
if (pkt->transition != 'c') {
|
||||||
LOG_INFO("Transition %c requested with offset %hu, param %d", pkt->transition, pkt->offset, pkt->param);
|
LOG_INFO("Transition %c requested with offset %hu, param %d", pkt->transition, pkt->offset, pkt->param);
|
||||||
@@ -773,7 +774,8 @@ static void grfs_handler(u8_t *data, int len) {
|
|||||||
htons(pkt->width), // last column of animation that contains a "full" screen
|
htons(pkt->width), // last column of animation that contains a "full" screen
|
||||||
htons(pkt->offset) // offset if multiple packets are sent
|
htons(pkt->offset) // offset if multiple packets are sent
|
||||||
);
|
);
|
||||||
|
|
||||||
|
GDS_CHECK_FOR_DEVICE(display,return);
|
||||||
// new grfs frame, build scroller info
|
// new grfs frame, build scroller info
|
||||||
if (!offset) {
|
if (!offset) {
|
||||||
// use the display as a general lock
|
// use the display as a general lock
|
||||||
@@ -820,6 +822,7 @@ static void grfg_handler(u8_t *data, int len) {
|
|||||||
|
|
||||||
LOG_DEBUG("gfrg s:%hu w:%hu (len:%u)", htons(pkt->screen), htons(pkt->width), len);
|
LOG_DEBUG("gfrg s:%hu w:%hu (len:%u)", htons(pkt->screen), htons(pkt->width), len);
|
||||||
|
|
||||||
|
GDS_CHECK_FOR_DEVICE(display,return);
|
||||||
// full screen artwork or for small screen, visu has priority when full screen
|
// full screen artwork or for small screen, visu has priority when full screen
|
||||||
if (((visu.mode & VISU_ESP32) && !visu.col && visu.row < displayer.height) || artwork.full) {
|
if (((visu.mode & VISU_ESP32) && !visu.col && visu.row < displayer.height) || artwork.full) {
|
||||||
return;
|
return;
|
||||||
@@ -864,6 +867,7 @@ static void grfa_handler(u8_t *data, int len) {
|
|||||||
int offset = htonl(pkt->offset);
|
int offset = htonl(pkt->offset);
|
||||||
int length = htonl(pkt->length);
|
int length = htonl(pkt->length);
|
||||||
|
|
||||||
|
GDS_CHECK_FOR_DEVICE(display,return);
|
||||||
// when using full screen visualizer on small screen there is a brief overlay
|
// when using full screen visualizer on small screen there is a brief overlay
|
||||||
artwork.enable = (length != 0);
|
artwork.enable = (length != 0);
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,8 @@ static EXT_RAM_ATTR struct {
|
|||||||
void *handle;
|
void *handle;
|
||||||
float loudness, volume;
|
float loudness, volume;
|
||||||
uint32_t samplerate;
|
uint32_t samplerate;
|
||||||
float gain[EQ_BANDS], loudness_gain[EQ_BANDS];
|
int8_t gain[EQ_BANDS];
|
||||||
|
float loudness_gain[EQ_BANDS];
|
||||||
bool update;
|
bool update;
|
||||||
} equalizer;
|
} equalizer;
|
||||||
|
|
||||||
@@ -151,6 +152,8 @@ void equalizer_set_gain(int8_t *gain) {
|
|||||||
char config[EQ_BANDS * 4 + 1] = { };
|
char config[EQ_BANDS * 4 + 1] = { };
|
||||||
int n = 0;
|
int n = 0;
|
||||||
|
|
||||||
|
if (memcmp(equalizer.gain, gain, EQ_BANDS) != 0) equalizer.update = true;
|
||||||
|
|
||||||
for (int i = 0; i < EQ_BANDS; i++) {
|
for (int i = 0; i < EQ_BANDS; i++) {
|
||||||
equalizer.gain[i] = gain[i];
|
equalizer.gain[i] = gain[i];
|
||||||
n += sprintf(config + n, "%d,", gain[i]);
|
n += sprintf(config + n, "%d,", gain[i]);
|
||||||
@@ -159,9 +162,6 @@ void equalizer_set_gain(int8_t *gain) {
|
|||||||
config[n-1] = '\0';
|
config[n-1] = '\0';
|
||||||
config_set_value(NVS_TYPE_STR, "equalizer", config);
|
config_set_value(NVS_TYPE_STR, "equalizer", config);
|
||||||
|
|
||||||
// update only if something changed
|
|
||||||
if (!memcmp(equalizer.gain, gain, EQ_BANDS)) equalizer.update = true;
|
|
||||||
|
|
||||||
LOG_INFO("equalizer gain %s", config);
|
LOG_INFO("equalizer gain %s", config);
|
||||||
#else
|
#else
|
||||||
LOG_INFO("no equalizer with 32 bits samples");
|
LOG_INFO("no equalizer with 32 bits samples");
|
||||||
|
|||||||
BIN
server_certs/r2m01.cer.52
Normal file
BIN
server_certs/r2m01.cer.52
Normal file
Binary file not shown.
Reference in New Issue
Block a user