Update i2smic.py to a more futureproof design

This commit is contained in:
LostNulide 2024-04-15 23:19:02 +02:00 committed by GitHub
parent b5c25be3bf
commit d7d1417be5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,4 +1,5 @@
import platform
import os
try:
from adafruit_shell import Shell
@ -56,7 +57,7 @@ Installing...""")
)
# Enable I2S overlay
if shell.get_raspbian_version() == "bookworm":
if os.path.exists("/boot/firmware/config.txt"):
shell.run_command("sed -i -e 's/#dtparam=i2s/dtparam=i2s/g' /boot/firmware/config.txt")
else:
shell.run_command("sed -i -e 's/#dtparam=i2s/dtparam=i2s/g' /boot/config.txt")