From 8f5555b052788679db705d19573b4729843a2169 Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Wed, 31 May 2017 11:32:32 -0700 Subject: [PATCH] WM8731: Store headphone volume for mute() function. So when unmuted, previous volume can be restored. --- firmware/common/wm8731.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/firmware/common/wm8731.hpp b/firmware/common/wm8731.hpp index 87790b865..1f6b3e537 100644 --- a/firmware/common/wm8731.hpp +++ b/firmware/common/wm8731.hpp @@ -307,6 +307,7 @@ public: void set_headphone_volume(const volume_t volume) { const auto normalized = headphone_gain_range.normalize(volume); + headphone_volume = volume; auto n = normalized.centibel() / 10; write(LeftHeadphoneOut { @@ -337,6 +338,7 @@ private: I2C& bus; const I2C::address_t bus_address; RegisterMap map { default_after_reset }; + volume_t headphone_volume = -60.0_dB; bool write(const Register reg);