fix(taranis): restore volume cli for I2C audio targets (#6543)
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -57,4 +57,9 @@ void audioSetVolume(uint8_t volume)
|
||||
write_i2c_volume(volumeScale[volume]);
|
||||
}
|
||||
|
||||
int32_t getVolume()
|
||||
{
|
||||
return read_i2c_volume();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user