mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-08 12:37:01 +03:00
terminate correctly statically created tasks
This commit is contained in:
@@ -35,6 +35,10 @@ extern struct buffer *outputbuf;
|
||||
// this is the only system-wide loglevel variable
|
||||
extern log_level loglevel;
|
||||
|
||||
// not great to have these here, but they should not be in embedded.h
|
||||
bool enable_bt_sink;
|
||||
bool enable_airplay;
|
||||
|
||||
#define RAOP_OUTPUT_SIZE (RAOP_SAMPLE_RATE * 2 * 2 * 2 * 1.2)
|
||||
|
||||
static raop_event_t raop_state;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#ifndef EMBEDDED_H
|
||||
#define EMBEDDED_H
|
||||
#include "esp_system.h"
|
||||
|
||||
#include <inttypes.h>
|
||||
|
||||
/* must provide
|
||||
@@ -8,6 +8,7 @@
|
||||
- pthread_create_name
|
||||
- stack size
|
||||
- s16_t, s32_t, s64_t and u64_t
|
||||
- EXT_BSS
|
||||
can overload (use #define)
|
||||
- exit
|
||||
- gettime_ms
|
||||
@@ -25,6 +26,7 @@
|
||||
#define IR_THREAD_STACK_SIZE 6 * 1024
|
||||
|
||||
//#define BASE_CAP "Model=squeezelite,AccuratePlayPoints=0,HasDigitalOut=1,HasPolarityInversion=1,Firmware=" VERSION
|
||||
#define EXT_BSS __attribute__((section(".ext_ram.bss")))
|
||||
|
||||
typedef int16_t s16_t;
|
||||
typedef int32_t s32_t;
|
||||
@@ -41,10 +43,6 @@ uint32_t _gettime_ms_(void);
|
||||
int pthread_create_name(pthread_t *thread, _CONST pthread_attr_t *attr,
|
||||
void *(*start_routine)( void * ), void *arg, char *name);
|
||||
|
||||
// these are here as they can be #define to nothing
|
||||
extern bool enable_bt_sink;
|
||||
extern bool enable_airplay;
|
||||
|
||||
void register_external(void);
|
||||
void deregister_external(void);
|
||||
|
||||
|
||||
@@ -533,7 +533,7 @@ static void process(u8_t *pack, int len) {
|
||||
static bool running;
|
||||
|
||||
static void slimproto_run() {
|
||||
static u8_t *buffer = NULL;
|
||||
static u8_t EXT_BSS buffer[MAXBUF];
|
||||
int expect = 0;
|
||||
int got = 0;
|
||||
u32_t now;
|
||||
@@ -541,9 +541,6 @@ 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) {
|
||||
@@ -626,14 +623,12 @@ static void slimproto_run() {
|
||||
bool _start_output = false;
|
||||
decode_state _decode_state;
|
||||
disconnect_code disconnect_code;
|
||||
static char *header = NULL;
|
||||
static char EXT_BSS header[MAX_HEADER];
|
||||
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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user