mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-09 13:07:03 +03:00
BSS & jack changes
This commit is contained in:
@@ -8,11 +8,11 @@
|
|||||||
- pthread_create_name
|
- pthread_create_name
|
||||||
- stack size
|
- stack size
|
||||||
- s16_t, s32_t, s64_t and u64_t
|
- s16_t, s32_t, s64_t and u64_t
|
||||||
- EXT_BSS
|
|
||||||
can overload (use #define)
|
can overload (use #define)
|
||||||
- exit
|
- exit
|
||||||
- gettime_ms
|
- gettime_ms
|
||||||
- BASE_CAP
|
- BASE_CAP
|
||||||
|
- EXT_BSS
|
||||||
recommended to add platform specific include(s) here
|
recommended to add platform specific include(s) here
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -109,7 +109,8 @@ extern struct outputstate output;
|
|||||||
extern struct buffer *streambuf;
|
extern struct buffer *streambuf;
|
||||||
extern struct buffer *outputbuf;
|
extern struct buffer *outputbuf;
|
||||||
extern u8_t *silencebuf;
|
extern u8_t *silencebuf;
|
||||||
extern bool jack_mutes_amp;
|
|
||||||
|
bool jack_mutes_amp = false;
|
||||||
|
|
||||||
static log_level loglevel;
|
static log_level loglevel;
|
||||||
static bool running, isI2SStarted;
|
static bool running, isI2SStarted;
|
||||||
@@ -120,6 +121,7 @@ static u8_t *obuf;
|
|||||||
static frames_t oframes;
|
static frames_t oframes;
|
||||||
static bool spdif;
|
static bool spdif;
|
||||||
static size_t dma_buf_frames;
|
static size_t dma_buf_frames;
|
||||||
|
static int jack_status = -1; // 0 = inserted
|
||||||
|
|
||||||
DECLARE_ALL_MIN_MAX;
|
DECLARE_ALL_MIN_MAX;
|
||||||
|
|
||||||
@@ -154,7 +156,7 @@ static void spdif_convert(ISAMPLE_T *src, size_t frames, u32_t *dst, size_t *cou
|
|||||||
|
|
||||||
#define I2C_PORT 0
|
#define I2C_PORT 0
|
||||||
#define I2C_ADDR 0x4c
|
#define I2C_ADDR 0x4c
|
||||||
#define VOLUME_GPIO 33
|
#define VOLUME_GPIO 14
|
||||||
#define JACK_GPIO 34
|
#define JACK_GPIO 34
|
||||||
|
|
||||||
struct tas575x_cmd_s {
|
struct tas575x_cmd_s {
|
||||||
@@ -438,10 +440,17 @@ static void *output_thread_i2s() {
|
|||||||
|
|
||||||
TIME_MEASUREMENT_START(timer_start);
|
TIME_MEASUREMENT_START(timer_start);
|
||||||
|
|
||||||
LOCK;
|
// handle jack insertion as a polling function (to avoid to have to do de-bouncing)
|
||||||
if(jack_mutes_amp){
|
if (gpio_get_level(JACK_GPIO) != jack_status) {
|
||||||
// todo: implement some muting logic
|
jack_status = gpio_get_level(JACK_GPIO);
|
||||||
|
if (jack_mutes_amp) {
|
||||||
|
//gpio_set_level(VOLUME_GPIO, jack_status);
|
||||||
|
LOG_INFO("Changing jack status %d", jack_status);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LOCK;
|
||||||
|
|
||||||
// manage led display
|
// manage led display
|
||||||
if (state != output.state) {
|
if (state != output.state) {
|
||||||
LOG_INFO("Output state is %d", output.state);
|
LOG_INFO("Output state is %d", output.state);
|
||||||
|
|||||||
@@ -442,6 +442,10 @@ void _wake_create(event_event*);
|
|||||||
#define wake_close(e) CloseHandle(e)
|
#define wake_close(e) CloseHandle(e)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef EXT_BSS
|
||||||
|
#define EXT_BSS
|
||||||
|
#endif
|
||||||
|
|
||||||
// printf/scanf formats for u64_t
|
// printf/scanf formats for u64_t
|
||||||
#if (LINUX && __WORDSIZE == 64) || (FREEBSD && __LP64__)
|
#if (LINUX && __WORDSIZE == 64) || (FREEBSD && __LP64__)
|
||||||
#define FMT_u64 "%lu"
|
#define FMT_u64 "%lu"
|
||||||
|
|||||||
@@ -47,11 +47,12 @@
|
|||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
extern bool enable_bt_sink;
|
||||||
|
extern bool enable_airplay;
|
||||||
|
extern bool jack_mutes_amp;
|
||||||
|
|
||||||
EventGroupHandle_t wifi_event_group;
|
EventGroupHandle_t wifi_event_group;
|
||||||
bool enable_bt_sink=false;
|
|
||||||
bool enable_airplay=false;
|
|
||||||
bool jack_mutes_amp=false;
|
|
||||||
bool bypass_wifi_manager=false;
|
bool bypass_wifi_manager=false;
|
||||||
const int CONNECTED_BIT = BIT0;
|
const int CONNECTED_BIT = BIT0;
|
||||||
#define JOIN_TIMEOUT_MS (10000)
|
#define JOIN_TIMEOUT_MS (10000)
|
||||||
|
|||||||
Reference in New Issue
Block a user