handle case w/o display - release

This commit is contained in:
philippe44
2020-01-30 22:48:36 -08:00
parent 9d2aa978d5
commit 5d07344b4d
9 changed files with 55 additions and 22 deletions

View File

@@ -207,7 +207,7 @@ static bool raop_sink_cmd_handler(raop_event_t event, va_list args)
ms = ((u64_t) ((_buf_used(outputbuf) - raop_sync.len) / BYTES_PER_FRAME + output.device_frames + output.frames_in_process) * 1000) / RAOP_SAMPLE_RATE - (now - output.updated);
raop_sync.error[raop_sync.idx] = (raop_sync.playtime - now) - ms;
sync_nb = SYNC_NB;
LOG_INFO("head local:%u, remote:%u (delta:%d)", ms, raop_sync.playtime - now, raop_sync.error[raop_sync.idx]);
LOG_DEBUG("head local:%u, remote:%u (delta:%d)", ms, raop_sync.playtime - now, raop_sync.error[raop_sync.idx]);
LOG_DEBUG("obuf:%u, sync_len:%u, devframes:%u, inproc:%u", _buf_used(outputbuf), raop_sync.len, output.device_frames, output.frames_in_process);
}

View File

@@ -137,10 +137,16 @@ static void scroll_task(void* arg);
/****************************************************************************************
*
*/
void sb_display_init(void) {
bool sb_display_init(void) {
static DRAM_ATTR StaticTask_t xTaskBuffer __attribute__ ((aligned (4)));
static EXT_RAM_ATTR StackType_t xStack[SCROLL_STACK_SIZE] __attribute__ ((aligned (4)));
// no display, just make sure we won't have requests
if (!display || display->height == 0 || display->width == 0) {
LOG_INFO("no display for LMS");
return false;
}
// need to force height to 32 maximum
display_width = display->width;
display_height = min(display->height, 32);
@@ -163,6 +169,8 @@ void sb_display_init(void) {
notify_chain = server_notify;
server_notify = server;
return true;
}
/****************************************************************************************

View File

@@ -50,9 +50,11 @@ uint32_t _gettime_ms_(void) {
}
extern void sb_controls_init(void);
extern void sb_display_init(void);
extern bool sb_display_init(void);
u8_t custom_player_id = 12;
void embedded_init(void) {
sb_controls_init();
sb_display_init();
if (sb_display_init()) custom_player_id = 100;
}

View File

@@ -26,7 +26,10 @@
#define OUTPUT_THREAD_STACK_SIZE 6 * 1024
#define IR_THREAD_STACK_SIZE 6 * 1024
#define PLAYER_ID 100
// or can be as simple as #define PLAYER_ID 100
#define PLAYER_ID custom_player_id;
extern u8_t custom_player_id;
#define BASE_CAP "Model=squeezeesp32,AccuratePlayPoints=1,HasDigitalOut=1,HasPolarityInversion=1,Firmware=" VERSION
#define EXT_BSS __attribute__((section(".ext_ram.bss")))

View File

@@ -45,7 +45,7 @@ static sockfd sock = -1;
static in_addr_t slimproto_ip = 0;
static u16_t slimproto_hport = 9000;
static u16_t slimproto_cport = 9090;
static u8_t player_id = PLAYER_ID;
static u8_t player_id;
extern struct buffer *streambuf;
extern struct buffer *outputbuf;