summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/main.cpp b/main.cpp
index 6e46591..1cee450 100644
--- a/main.cpp
+++ b/main.cpp
@@ -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);
}
};