mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-06 11:36:59 +03:00
refactor services, increase max sockets - release
This commit is contained in:
@@ -162,11 +162,6 @@ static void spdif_convert(ISAMPLE_T *src, size_t frames, u32_t *dst, size_t *cou
|
||||
#define TAS575x 0x98
|
||||
#define TAS578x 0x90
|
||||
|
||||
static struct {
|
||||
float sum, avg;
|
||||
u16_t count;
|
||||
} battery;
|
||||
|
||||
struct tas57xx_cmd_s {
|
||||
u8_t reg;
|
||||
u8_t value;
|
||||
@@ -583,18 +578,7 @@ static void *output_thread_i2s() {
|
||||
* Stats output thread
|
||||
*/
|
||||
static void *output_thread_i2s_stats() {
|
||||
int memory_count = 0;
|
||||
|
||||
while (running) {
|
||||
#ifdef TAS57xx
|
||||
battery.sum += adc1_get_raw(ADC1_CHANNEL_7) / 4095. * (10+174)/10. * 1.1;
|
||||
if (++battery.count == (300 * 1000) / STATS_PERIOD_MS) {
|
||||
battery.avg = battery.sum / battery.count;
|
||||
battery.sum = battery.count = 0;
|
||||
LOG_INFO("Voltage %.2fV", battery.avg);
|
||||
}
|
||||
#endif
|
||||
|
||||
LOCK;
|
||||
output_state state = output.state;
|
||||
UNLOCK;
|
||||
@@ -618,14 +602,6 @@ static void *output_thread_i2s_stats() {
|
||||
LOG_INFO(" ----------+----------+-----------+-----------+");
|
||||
RESET_ALL_MIN_MAX;
|
||||
}
|
||||
if (loglevel == lDEBUG || !memory_count--) {
|
||||
LOG_INFO("Heap internal:%zu (min:%zu) external:%zu (min:%zu)",
|
||||
heap_caps_get_free_size(MALLOC_CAP_INTERNAL),
|
||||
heap_caps_get_minimum_free_size(MALLOC_CAP_INTERNAL),
|
||||
heap_caps_get_free_size(MALLOC_CAP_SPIRAM),
|
||||
heap_caps_get_minimum_free_size(MALLOC_CAP_SPIRAM));
|
||||
memory_count = (60*1000) / STATS_PERIOD_MS;
|
||||
}
|
||||
usleep(STATS_PERIOD_MS *1000);
|
||||
}
|
||||
return NULL;
|
||||
|
||||
Reference in New Issue
Block a user