diff options
author | Jon Bergli Heier <snakebite@jvnv.net> | 2012-09-29 16:56:38 +0200 |
---|---|---|
committer | Jon Bergli Heier <snakebite@jvnv.net> | 2012-09-29 16:56:38 +0200 |
commit | 9a95c5b6673e3833a05fab376a31b534d900508d (patch) | |
tree | 0a0a2afb8199b09fca7550fb35b87c0fb124bd43 | |
parent | 10c33c518fdea638ffd64cb7cbd2e59ed8c0ed1d (diff) |
Fixed volume values in set_volume and get_volume.
-rw-r--r-- | main.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -102,10 +102,10 @@ class DAC { uint8_t get_volume(uint8_t c) { uint8_t buf; i2c.read_reg(0x4a, 0x1a + c, 1, &buf); - return buf & 0x7f; + return ((buf & 0x7f) - 0x19) & 0x7f; } void set_volume(uint8_t c, uint8_t v) { - i2c.write_reg(0x4a, 0x1a + c, v & 0x7f); + i2c.write_reg(0x4a, 0x1a + c, (v + 0x19) & 0x7f); } }; |