mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-07 12:07:09 +03:00
add Vcc_GPIO & handle LMS 32-pixels fixed display height
This commit is contained in:
@@ -29,6 +29,8 @@ static const char *TAG = "services";
|
||||
*
|
||||
*/
|
||||
void services_init(void) {
|
||||
char *nvs_item;
|
||||
|
||||
gpio_install_isr_service(0);
|
||||
|
||||
#ifdef CONFIG_SQUEEZEAMP
|
||||
@@ -38,6 +40,21 @@ void services_init(void) {
|
||||
}
|
||||
#endif
|
||||
|
||||
// set fixed gpio if any
|
||||
if ((nvs_item = config_alloc_get(NVS_TYPE_STR, "Vcc_GPIO")) != NULL) {
|
||||
char *p = nvs_item;
|
||||
while (p && *p) {
|
||||
int gpio = atoi(p);
|
||||
gpio_pad_select_gpio(gpio);
|
||||
gpio_set_direction(gpio, GPIO_MODE_OUTPUT);
|
||||
gpio_set_level(gpio, 1);
|
||||
p = strchr(p, ',');
|
||||
ESP_LOGI(TAG, "set GPIO %u to Vcc", gpio);
|
||||
if (p) p++;
|
||||
}
|
||||
free(nvs_item);
|
||||
}
|
||||
|
||||
const i2c_config_t * i2c_config = config_i2c_get(&i2c_system_port);
|
||||
|
||||
ESP_LOGI(TAG,"Configuring I2C sda:%d scl:%d port:%u speed:%u", i2c_config->sda_io_num, i2c_config->scl_io_num, i2c_system_port, i2c_config->master.clk_speed);
|
||||
|
||||
Reference in New Issue
Block a user