diff --git a/src/drivers/drv_serial_vtx_sa.c b/src/drivers/drv_serial_vtx_sa.c index 51731001b..388283644 100644 --- a/src/drivers/drv_serial_vtx_sa.c +++ b/src/drivers/drv_serial_vtx_sa.c @@ -380,13 +380,13 @@ void serial_smart_audio_send_payload(uint8_t cmd, const uint8_t *payload, const vtx_last_valid_read = time_millis(); } -int8_t smart_audio_dac_power_level_index(uint8_t dac) { +uint8_t smart_audio_dac_power_level_index(uint8_t dac) { for (uint8_t level = 0; level < 4; level++) { if (dac == smart_audio_settings.dac_power_levels[level]) { return level; } } - return -1; + return 0; } #endif diff --git a/src/drivers/drv_serial_vtx_sa.h b/src/drivers/drv_serial_vtx_sa.h index aa99c8c98..e7695d323 100644 --- a/src/drivers/drv_serial_vtx_sa.h +++ b/src/drivers/drv_serial_vtx_sa.h @@ -34,4 +34,4 @@ typedef struct { void serial_smart_audio_init(); vtx_update_result_t serial_smart_audio_update(); void serial_smart_audio_send_payload(uint8_t cmd, const uint8_t *payload, const uint32_t size); -int8_t smart_audio_dac_power_level_index(uint8_t dac); \ No newline at end of file +uint8_t smart_audio_dac_power_level_index(uint8_t dac); \ No newline at end of file diff --git a/src/main/vtx.c b/src/main/vtx.c index d14a8e747..fb62dedde 100644 --- a/src/main/vtx.c +++ b/src/main/vtx.c @@ -191,13 +191,13 @@ const uint16_t tramp_power_level[4] = { 400, }; -int8_t tramp_power_level_index(uint16_t power) { +vtx_power_level_t tramp_power_level_index(uint16_t power) { for (uint8_t level = 0; level < VTX_POWER_LEVEL_MAX; level++) { if (power >= tramp_power_level[level] && power <= tramp_power_level[level]) { return level; } } - return -1; + return VTX_POWER_LEVEL_1; } vtx_detect_status_t vtx_tramp_update(vtx_settings_t *actual) {