mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-06 11:36:59 +03:00
allocate buffers to minimize .bss
This commit is contained in:
@@ -533,7 +533,7 @@ static void process(u8_t *pack, int len) {
|
||||
static bool running;
|
||||
|
||||
static void slimproto_run() {
|
||||
static u8_t buffer[MAXBUF];
|
||||
static u8_t *buffer = NULL;
|
||||
int expect = 0;
|
||||
int got = 0;
|
||||
u32_t now;
|
||||
@@ -541,6 +541,9 @@ static void slimproto_run() {
|
||||
event_handle ehandles[2];
|
||||
int timeouts = 0;
|
||||
|
||||
// just to avoid having to free that up at multiple places
|
||||
if (!buffer) buffer = malloc(MAXBUF);
|
||||
|
||||
set_readwake_handles(ehandles, sock, wake_e);
|
||||
|
||||
while (running && !new_server) {
|
||||
@@ -623,12 +626,15 @@ static void slimproto_run() {
|
||||
bool _start_output = false;
|
||||
decode_state _decode_state;
|
||||
disconnect_code disconnect_code;
|
||||
static char header[MAX_HEADER];
|
||||
static char *header = NULL;
|
||||
size_t header_len = 0;
|
||||
#if IR
|
||||
bool _sendIR = false;
|
||||
u32_t ir_code, ir_ts;
|
||||
#endif
|
||||
// just to avoid allocating it at every pass
|
||||
if (!header) header = malloc(MAX_HEADER);
|
||||
|
||||
last = now;
|
||||
|
||||
LOCK_S;
|
||||
|
||||
Reference in New Issue
Block a user