mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2026-01-01 22:29:18 +03:00
add a quick LED helper / prepare SqueezeAMP menuconfig
This commit is contained in:
@@ -123,26 +123,17 @@ menu "Squeezelite-ESP32"
|
||||
menu "Audio Output"
|
||||
choice OUTPUT_TYPE
|
||||
prompt "Output Type"
|
||||
default DACAUDIO
|
||||
default BASIC_I2C_BT
|
||||
help
|
||||
Type of output for squeezelite to send audio to
|
||||
config DACAUDIO
|
||||
bool "DAC over I2S"
|
||||
config BTAUDIO
|
||||
bool "Bluetooth A2DP"
|
||||
Type of hardware platform
|
||||
config SQUEEZEAMP
|
||||
bool "SqueezeAMP (TAS575x & Bluetooth)"
|
||||
config BASIC_I2C_BT
|
||||
bool "Generic I2S & Bluetooth"
|
||||
endchoice
|
||||
config OUTPUT_NAME
|
||||
string
|
||||
default ""
|
||||
default "BT" if BTAUDIO
|
||||
default "DAC" if DACAUDIO
|
||||
|
||||
config OUTPUT_RATES
|
||||
string "Output rates"
|
||||
default "44100"
|
||||
help
|
||||
<rates>[:<delay>] Sample rates supported, allows output to be off when squeezelite is started; rates = <maxrate>|<minrate>-<maxrate>|<rate1>,<rate2>,<rate3>; delay = optional delay switching rates in ms
|
||||
menu "DAC I2S settings"
|
||||
|
||||
menu "DAC I2S settings"
|
||||
depends on BASIC_I2C_BT
|
||||
config I2S_NUM
|
||||
int "I2S channel (0 or 1). "
|
||||
default 0
|
||||
@@ -180,6 +171,7 @@ menu "Squeezelite-ESP32"
|
||||
default 24 if I2S_BITS_PER_CHANNEL_24
|
||||
default 8 if I2S_BITS_PER_CHANNEL_8
|
||||
endmenu
|
||||
|
||||
menu "A2DP settings"
|
||||
config A2DP_SINK_NAME
|
||||
string "Name of Bluetooth A2DP device"
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "esp_wifi.h"
|
||||
#include "tcpip_adapter.h"
|
||||
#include "esp_event.h"
|
||||
#include "led.h"
|
||||
|
||||
#define JOIN_TIMEOUT_MS (10000)
|
||||
|
||||
@@ -46,8 +47,10 @@ static void event_handler(void* arg, esp_event_base_t event_base,
|
||||
{
|
||||
if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_STA_DISCONNECTED) {
|
||||
esp_wifi_connect();
|
||||
led_blink(LED_GREEN, 250, 250);
|
||||
xEventGroupClearBits(wifi_event_group, CONNECTED_BIT);
|
||||
} else if (event_base == IP_EVENT && event_id == IP_EVENT_STA_GOT_IP) {
|
||||
led_release(LED_GREEN);
|
||||
xEventGroupSetBits(wifi_event_group, CONNECTED_BIT);
|
||||
}
|
||||
}
|
||||
@@ -89,6 +92,7 @@ static void initialise_wifi(void)
|
||||
ESP_ERROR_CHECK( esp_wifi_set_mode(WIFI_MODE_NULL) );
|
||||
ESP_ERROR_CHECK( esp_wifi_start() );
|
||||
initialized = true;
|
||||
led_blink(LED_GREEN, 250, 250);
|
||||
}
|
||||
|
||||
static bool wifi_join(const char *ssid, const char *pass, int timeout_ms)
|
||||
|
||||
@@ -18,10 +18,21 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "platform_esp32.h"
|
||||
#include "led.h"
|
||||
|
||||
#ifdef CONFIG_SQUEEZEAMP
|
||||
#define LED_GREEN_GPIO 12
|
||||
#define LED_RED_GPIO 13
|
||||
#else
|
||||
#define LED_GREEN_GPIO 0
|
||||
#define LED_RED_GPIO 0
|
||||
#endif
|
||||
|
||||
void app_main()
|
||||
{
|
||||
led_config(LED_GREEN, LED_GREEN_GPIO, 0);
|
||||
led_config(LED_RED, LED_RED_GPIO, 0);
|
||||
|
||||
console_start();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user