mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2024-12-13 19:54:39 +00:00
WM8731: Store headphone volume for mute() function.
So when unmuted, previous volume can be restored.
This commit is contained in:
parent
f6e1e78e8a
commit
8f5555b052
@ -307,6 +307,7 @@ public:
|
|||||||
|
|
||||||
void set_headphone_volume(const volume_t volume) {
|
void set_headphone_volume(const volume_t volume) {
|
||||||
const auto normalized = headphone_gain_range.normalize(volume);
|
const auto normalized = headphone_gain_range.normalize(volume);
|
||||||
|
headphone_volume = volume;
|
||||||
auto n = normalized.centibel() / 10;
|
auto n = normalized.centibel() / 10;
|
||||||
|
|
||||||
write(LeftHeadphoneOut {
|
write(LeftHeadphoneOut {
|
||||||
@ -337,6 +338,7 @@ private:
|
|||||||
I2C& bus;
|
I2C& bus;
|
||||||
const I2C::address_t bus_address;
|
const I2C::address_t bus_address;
|
||||||
RegisterMap map { default_after_reset };
|
RegisterMap map { default_after_reset };
|
||||||
|
volume_t headphone_volume = -60.0_dB;
|
||||||
|
|
||||||
bool write(const Register reg);
|
bool write(const Register reg);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user