mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-14 15:37:10 +03:00
Compare commits
3 Commits
v0.5.662-v
...
v0.5.665-v
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8947f2fc75 | ||
|
|
b6c296460c | ||
|
|
e25c18a070 |
@@ -84,7 +84,7 @@ The parameter "dac_controlset" allows definition of simple commands to be sent o
|
|||||||
poweron: [ {"reg":<register>,"val":<value>,"mode":<nothing>|"or"|"and"}, ... {{"reg":<register>,"val":<value>,"mode":<nothing>|"or"|"and"} ],
|
poweron: [ {"reg":<register>,"val":<value>,"mode":<nothing>|"or"|"and"}, ... {{"reg":<register>,"val":<value>,"mode":<nothing>|"or"|"and"} ],
|
||||||
poweroff: [ {"reg":<register>,"val":<value>,"mode":<nothing>|"or"|"and"}, ... {{"reg":<register>,"val":<value>,"mode":<nothing>|"or"|"and"} ] }
|
poweroff: [ {"reg":<register>,"val":<value>,"mode":<nothing>|"or"|"and"}, ... {{"reg":<register>,"val":<value>,"mode":<nothing>|"or"|"and"} ] }
|
||||||
```
|
```
|
||||||
This is standard JSON notation, so if you are not familiar with it, Google is your best friend. Be aware that the '...' means you can have as many entries as you want, it's not part of the syntax. Every section is optional, but it does not make sense to set i2c in the 'dac_config' parameter and not setting anything here. The parameter 'mode' allows to *or* the register with the value or to *and* it. Don't set 'mode' if you simply want to write. **Note that all values must be decimal**
|
This is standard JSON notation, so if you are not familiar with it, Google is your best friend. Be aware that the '...' means you can have as many entries as you want, it's not part of the syntax. Every section is optional, but it does not make sense to set i2c in the 'dac_config' parameter and not setting anything here. The parameter 'mode' allows to *or* the register with the value or to *and* it. Don't set 'mode' if you simply want to write. **Note that all values must be decimal**. You can use a validator like [this](https://jsonlint.com) to verify your syntax
|
||||||
|
|
||||||
NB: For well-known configuration, this is ignored
|
NB: For well-known configuration, this is ignored
|
||||||
### SPDIF
|
### SPDIF
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ static esp_err_t i2c_write_reg(uint8_t reg, uint8_t val) {
|
|||||||
i2c_cmd_handle_t cmd = i2c_cmd_link_create();
|
i2c_cmd_handle_t cmd = i2c_cmd_link_create();
|
||||||
i2c_master_start(cmd);
|
i2c_master_start(cmd);
|
||||||
|
|
||||||
i2c_master_write_byte(cmd, i2c_addr | I2C_MASTER_WRITE, I2C_MASTER_NACK);
|
i2c_master_write_byte(cmd, (i2c_addr << 1) | I2C_MASTER_WRITE, I2C_MASTER_NACK);
|
||||||
i2c_master_write_byte(cmd, reg, I2C_MASTER_NACK);
|
i2c_master_write_byte(cmd, reg, I2C_MASTER_NACK);
|
||||||
i2c_master_write_byte(cmd, val, I2C_MASTER_NACK);
|
i2c_master_write_byte(cmd, val, I2C_MASTER_NACK);
|
||||||
|
|
||||||
@@ -153,11 +153,11 @@ static uint8_t i2c_read_reg(uint8_t reg) {
|
|||||||
i2c_cmd_handle_t cmd = i2c_cmd_link_create();
|
i2c_cmd_handle_t cmd = i2c_cmd_link_create();
|
||||||
i2c_master_start(cmd);
|
i2c_master_start(cmd);
|
||||||
|
|
||||||
i2c_master_write_byte(cmd, i2c_addr | I2C_MASTER_WRITE, I2C_MASTER_NACK);
|
i2c_master_write_byte(cmd, (i2c_addr << 1) | I2C_MASTER_WRITE, I2C_MASTER_NACK);
|
||||||
i2c_master_write_byte(cmd, reg, I2C_MASTER_NACK);
|
i2c_master_write_byte(cmd, reg, I2C_MASTER_NACK);
|
||||||
|
|
||||||
i2c_master_start(cmd);
|
i2c_master_start(cmd);
|
||||||
i2c_master_write_byte(cmd, i2c_addr | I2C_MASTER_READ, I2C_MASTER_NACK);
|
i2c_master_write_byte(cmd, (i2c_addr << 1) | I2C_MASTER_READ, I2C_MASTER_NACK);
|
||||||
i2c_master_read_byte(cmd, &data, I2C_MASTER_NACK);
|
i2c_master_read_byte(cmd, &data, I2C_MASTER_NACK);
|
||||||
|
|
||||||
i2c_master_stop(cmd);
|
i2c_master_stop(cmd);
|
||||||
|
|||||||
@@ -199,7 +199,6 @@ static void *stream_thread() {
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
polling = true;
|
|
||||||
pollinfo.fd = fd;
|
pollinfo.fd = fd;
|
||||||
pollinfo.events = POLLIN;
|
pollinfo.events = POLLIN;
|
||||||
if (stream.state == SEND_HEADERS) {
|
if (stream.state == SEND_HEADERS) {
|
||||||
@@ -208,6 +207,8 @@ static void *stream_thread() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
UNLOCK;
|
UNLOCK;
|
||||||
|
// no mutex needed - we just want to know if we are inside poll()
|
||||||
|
polling = true;
|
||||||
|
|
||||||
if (_poll(ssl, &pollinfo, 100)) {
|
if (_poll(ssl, &pollinfo, 100)) {
|
||||||
|
|
||||||
@@ -364,7 +365,6 @@ static void *stream_thread() {
|
|||||||
UNLOCK;
|
UNLOCK;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// it is safe to set it unlocked
|
|
||||||
polling = false;
|
polling = false;
|
||||||
LOG_SDEBUG("poll timeout");
|
LOG_SDEBUG("poll timeout");
|
||||||
}
|
}
|
||||||
@@ -490,8 +490,7 @@ void stream_sock(u32_t ip, u16_t port, const char *header, size_t header_len, un
|
|||||||
|
|
||||||
#if EMBEDDED
|
#if EMBEDDED
|
||||||
// wait till we are not polling anymore
|
// wait till we are not polling anymore
|
||||||
for (LOCK; running && polling; UNLOCK, usleep(10000), LOCK);
|
while (polling && running) { usleep(10000); }
|
||||||
UNLOCK;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int sock = socket(AF_INET, SOCK_STREAM, 0);
|
int sock = socket(AF_INET, SOCK_STREAM, 0);
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ menu "Squeezelite-ESP32"
|
|||||||
string
|
string
|
||||||
default "model=TAS57xx,bck=33,ws=25,do=32,sda=27,scl=26,mute=14:0" if SQUEEZEAMP
|
default "model=TAS57xx,bck=33,ws=25,do=32,sda=27,scl=26,mute=14:0" if SQUEEZEAMP
|
||||||
default "model=AC101,bck=27,ws=26,do=25,di=35,sda=33,scl=32" if A1S
|
default "model=AC101,bck=27,ws=26,do=25,di=35,sda=33,scl=32" if A1S
|
||||||
default "model=I2S,bck=26,ws=25,do=33,i2c=106,sda=21,scl=22" if TWATCH2020
|
default "model=I2S,bck=26,ws=25,do=33,i2c=53,sda=21,scl=22" if TWATCH2020
|
||||||
default ""
|
default ""
|
||||||
config SPDIF_CONFIG
|
config SPDIF_CONFIG
|
||||||
string
|
string
|
||||||
|
|||||||
Reference in New Issue
Block a user