mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2026-01-29 22:00:54 +03:00
Merge with master
This commit is contained in:
@@ -26,17 +26,19 @@
|
||||
#include "embedded.h"
|
||||
#include "display.h"
|
||||
|
||||
#define TAG "display"
|
||||
static const char *TAG = "display";
|
||||
|
||||
static bool (*slimp_handler_chain)(u8_t *data, int len);
|
||||
static struct display_handle_s *handle;
|
||||
static void (*chained_notify)(in_addr_t ip, u16_t hport, u16_t cport);
|
||||
|
||||
static void server_attach(in_addr_t ip, u16_t hport, u16_t cport);
|
||||
static bool display_handler(u8_t *data, int len);
|
||||
|
||||
/****************************************************************************************
|
||||
*
|
||||
*/
|
||||
void display_init(void) {
|
||||
void display_init(char *welcome) {
|
||||
char *item = config_alloc_get(NVS_TYPE_STR, "display_config");
|
||||
|
||||
if (item && *item) {
|
||||
@@ -52,15 +54,27 @@ void display_init(void) {
|
||||
}
|
||||
}else {
|
||||
ESP_LOGE(TAG,"Unknown display driver name in display config: %s",item);
|
||||
|
||||
}
|
||||
} else {
|
||||
ESP_LOGW(TAG, "no display");
|
||||
}
|
||||
|
||||
chained_notify = server_notify;
|
||||
server_notify = server_attach;
|
||||
|
||||
if (item) free(item);
|
||||
}
|
||||
|
||||
/****************************************************************************************
|
||||
*
|
||||
*/
|
||||
static void server_attach(in_addr_t ip, u16_t hport, u16_t cport) {
|
||||
char msg[32];
|
||||
sprintf(msg, "%s:%hu", inet_ntoa(ip), hport);
|
||||
handle->print_message(msg);
|
||||
if (chained_notify) (*chained_notify)(ip, hport, cport);
|
||||
}
|
||||
|
||||
/****************************************************************************************
|
||||
* Process graphic display data
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user