fix(taranis): restore volume cli for I2C audio targets (#6543)

This commit is contained in:
fpenard
2026-08-30 18:50:08 +10:00
committed by GitHub
parent 34afae5a26
commit bfe6cd1e7e
3 changed files with 13 additions and 0 deletions
+5
View File
@@ -1497,6 +1497,11 @@ int cliDisplay(const char ** argv)
gettime(&utm);
cliSerialPrint("rtc = %4d-%02d-%02d %02d:%02d:%02d.%02d0", utm.tm_year+TM_YEAR_BASE, utm.tm_mon+1, utm.tm_mday, utm.tm_hour, utm.tm_min, utm.tm_sec, g_ms100);
}
#if defined(VOLUME_I2C_ADDRESS)
else if (!strcmp(argv[1], "volume")) {
cliSerialPrint("volume = %d", getVolume());
}
#endif
else if (!strcmp(argv[1], "uid")) {
char str[LEN_CPU_UID+1];
getCPUUniqueID(str);
+3
View File
@@ -883,6 +883,9 @@
#if !defined(SOFTWARE_VOLUME)
#define VOLUME_I2C_ADDRESS 0x2E
#define VOLUME_I2C_BUS I2C_Bus_1
#include <stdint.h>
int32_t getVolume();
#endif
#define I2C_B1_CLK_RATE 400000
+5
View File
@@ -57,4 +57,9 @@ void audioSetVolume(uint8_t volume)
write_i2c_volume(volumeScale[volume]);
}
int32_t getVolume()
{
return read_i2c_volume();
}
#endif