From 3fe1a457abcf834c00ba3c9c216d9ca5ec46b61c Mon Sep 17 00:00:00 2001 From: Aadi Desai <21363892+supleed2@users.noreply.github.com> Date: Sat, 24 Jun 2023 21:06:39 +0100 Subject: [PATCH] Fix volume, higher = louder --- demo/main.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/demo/main.cpp b/demo/main.cpp index 608537c..0cd1619 100644 --- a/demo/main.cpp +++ b/demo/main.cpp @@ -274,11 +274,12 @@ static void amp_vol_cmd(char **val) { return; } if (token == *val) { - printf("AMP volume is %d (of 63)\n", temp.pot0); + printf("AMP volume is %d (of 63)\n", 63 - temp.pot0); } else { uint8_t vol = (uint8_t)strtol(token, NULL, 0); printf("Setting AMP volume to %d (of 63)\n", vol); - if (!amp_write({vol, vol, temp.conf})) { + uint8_t v = 63u - vol; + if (!amp_write({v, v, temp.conf})) { printf("Failed to write AMP state\n"); } }