summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/main.cpp b/main.cpp
index 254cece..031c042 100644
--- a/main.cpp
+++ b/main.cpp
@@ -99,19 +99,13 @@ class DAC {
i2c.write_reg(0x4a, 0x02, 0x9e);
i2c.write_reg(0x4a, 0x06, (0 << 7) | (1 << 6) | (0 << 4) | (1 << 2) | (3 << 0));
- set_volume(-0x40);
- //i2c.write_reg(0x4a, 0x1a, 0);
- //i2c.write_reg(0x4a, 0x1b, 0);
- //i2c.write_reg(0x4a, 0x1a, -0x40 & 0x7f);
- //i2c.write_reg(0x4a, 0x1b, -0x40 & 0x7f);
}
uint8_t get_volume() {
return volume;
}
- void set_volume(uint8_t v) {
+ void set_volume(uint8_t c, uint8_t v) {
volume = v;
- i2c.write_reg(0x4a, 0x1a, volume & 0x7f);
- i2c.write_reg(0x4a, 0x1b, volume & 0x7f);
+ i2c.write_reg(0x4a, 0x1a + c, volume & 0x7f);
}
};