diff --git a/main/light.c b/main/light.c index 9e367f7..d8e0498 100644 --- a/main/light.c +++ b/main/light.c @@ -244,23 +244,11 @@ void light_play_colors(uint16_t len, uint8_t *buffer) { light_mode = light_mode_desktop_sending_colors; printf("COLORS=%.*s\r\n", len, buffer); - ESP_ERROR_CHECK(light_led_strip->clear(light_led_strip, 100)); for (uint16_t led_index = 0, buffer_cursor = 0; led_index < STRIP_LED_NUMBER && buffer_cursor < len; led_index++, buffer_cursor += 3) { uint8_t r = buffer[buffer_cursor], g = buffer[buffer_cursor + 1], b = buffer[buffer_cursor + 2]; - ESP_LOGI(LIGHT_TAG, "RGB: %d %d %d", r, g, b); - ESP_ERROR_CHECK( - light_led_strip->set_pixel(light_led_strip, led_index, r, g, b)); - } - ESP_ERROR_CHECK(light_led_strip->refresh(light_led_strip, 100)); - vTaskDelay(pdMS_TO_TICKS(10)); - for (uint16_t led_index = 0, buffer_cursor = 0; - led_index < STRIP_LED_NUMBER && buffer_cursor < len; - led_index++, buffer_cursor += 3) { - uint8_t r = buffer[buffer_cursor], g = buffer[buffer_cursor + 1], b = 0; - ESP_LOGI(LIGHT_TAG, "RGB: %d %d %d", r, g, b); ESP_ERROR_CHECK( light_led_strip->set_pixel(light_led_strip, led_index, r, g, b)); } diff --git a/main/mqtt.c b/main/mqtt.c index e55a785..e07717c 100644 --- a/main/mqtt.c +++ b/main/mqtt.c @@ -66,7 +66,7 @@ static void mqtt_event_handler(void *handler_args, esp_event_base_t base, msg_id = esp_mqtt_client_publish(client, MQTT_KEY_BOARD_ONLINE, "ONLINE", 0, 1, 0); ESP_LOGI(MQTT_TAG, "sent publish successful, msg_id=%d", msg_id); - esp_mqtt_client_subscribe(client, MQTT_KEY_DESKTOP_ALL, 0); + esp_mqtt_client_subscribe(client, MQTT_KEY_DESKTOP_ALL, 1); break; case MQTT_EVENT_DISCONNECTED: ESP_LOGI(MQTT_TAG, "MQTT_EVENT_DISCONNECTED");