Skip to content

Commit 2c852ad

Browse files
authored
Upgrade Korvo2 BSP for voice_agent example (#29)
* Upgrade to latest Korvo2 BSP * Update BSP usage
1 parent 58a9174 commit 2c852ad

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

examples/voice_agent/main/board.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ void board_init()
1717
// Initialize board support package and LEDs
1818
bsp_i2c_init();
1919
bsp_leds_init();
20-
bsp_led_set(BSP_LED_RED, true);
21-
bsp_led_set(BSP_LED_BLUE, true);
2220

2321
// Initialize temperature sensor
2422
temperature_sensor_config_t temp_sensor_config = TEMPERATURE_SENSOR_CONFIG_DEFAULT(10, 50);

examples/voice_agent/main/example.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,20 +65,21 @@ static void set_led_state(const livekit_rpc_invocation_t* invocation, void* ctx)
6565
}
6666

6767
const char *color = color_entry->valuestring;
68+
6869
bool state = cJSON_IsTrue(state_entry);
6970

7071
bsp_led_t led;
7172
if (strncmp(color, "red", 3) == 0) {
72-
led = BSP_LED_RED;
73-
} else if (strncmp(color, "blue", 4) == 0) {
73+
// TODO: there is a bug in the Korvo2 BSP which causes the LED pins to be swapped
74+
// (i.e., blue is mapped to red and red is mapped to blue): https://github.com/espressif/esp-bsp/pull/632
7475
led = BSP_LED_BLUE;
76+
} else if (strncmp(color, "blue", 4) == 0) {
77+
led = BSP_LED_RED;
7578
} else {
7679
error = "Unsupported color";
7780
break;
7881
}
79-
// There is a known bug in the BSP component, so we need to invert the state for now.
80-
// See https://github.com/espressif/esp-bsp/pull/610.
81-
if (bsp_led_set(led, !state) != ESP_OK) {
82+
if (bsp_led_set(led, state) != ESP_OK) {
8283
error = "Failed to set LED state";
8384
break;
8485
}

examples/voice_agent/main/idf_component.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ dependencies:
66
path: ../../../components/third_party/esp-webrtc-solution/components/codec_board
77
# Eventually, the BSP will perform all the functions of the codec_board component.
88
# It currently is used because codec_board is required to support AEC.
9-
esp32_s3_korvo_2:
10-
version: ">=0.1"
9+
esp32_s3_korvo_2: "4.1.0"
1110
render_impl:
1211
path: ../../../components/third_party/esp-webrtc-solution/components/av_render/render_impl
1312
livekit_sandbox:

0 commit comments

Comments
 (0)