From f45fbaf5fc0847f035c3b60b5647b53e4725ffc9 Mon Sep 17 00:00:00 2001 From: Max Goltzsche Date: Mon, 30 Jan 2023 00:38:50 +0100 Subject: [PATCH] Make Amp2 detection more reliable After several test runs of the detect-hifiberry script, it did not detect my Amp2 anymore because `i2cget -y 1 0x4d 40` returned '0x03' as opposed to '0x02'. This behaviour was persistent across system reboots that day. The next day the behaviour started from the beginning, first returning 0x02 and then 0x03. --- buildroot/package/hifiberry-tools/detect-hifiberry | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildroot/package/hifiberry-tools/detect-hifiberry b/buildroot/package/hifiberry-tools/detect-hifiberry index 9819f834..573efa73 100755 --- a/buildroot/package/hifiberry-tools/detect-hifiberry +++ b/buildroot/package/hifiberry-tools/detect-hifiberry @@ -82,7 +82,7 @@ function detect_card { # DAC Plus res=`i2cget -y 1 0x4d 40 2>/dev/null` - if [ "$res" == "0x02" ]; then + if [ "$res" == "0x02" ] || [ "$res" == "0x03" ]; then DETECTED="dacplus" return fi