From a4a1a5523b61175f1f7d04e192391ccceb51e4f9 Mon Sep 17 00:00:00 2001 From: Thom Johansen Date: Thu, 16 Jun 2005 21:42:37 +0000 Subject: [PATCH] Let's actually take volume into account this time. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6732 a1c6a512-1295-4272-9138-f99709370657 --- firmware/drivers/uda1380.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/firmware/drivers/uda1380.c b/firmware/drivers/uda1380.c index bcc94474fa..721bce41d8 100644 --- a/firmware/drivers/uda1380.c +++ b/firmware/drivers/uda1380.c @@ -96,8 +96,8 @@ int uda1380_setvol(int vol) uda1380_volume = vol; /* Simple linear volume crossfade curves */ - vol_l = MAX(uda1380_balance*0xff/100, 0); - vol_r = MAX(-uda1380_balance*0xff/100, 0); + vol_l = MAX(uda1380_balance*(255 - vol)/100 + vol, vol); + vol_r = MAX(-uda1380_balance*(255 - vol)/100 + vol, vol); return uda1380_write_reg(REG_MASTER_VOL, MASTER_VOL_LEFT(vol_l) | MASTER_VOL_RIGHT(vol_r)); }