From 2545bd45a2f8de2000ab95acd69736fccc519d75 Mon Sep 17 00:00:00 2001 From: duffyduck Date: Sun, 23 Nov 2025 12:33:29 +0100 Subject: [PATCH] PIN konflikt Buttons und I2S gefixt --- init.sh | 2 +- main/hardware_config.h | 27 +++++++++++---------------- 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/init.sh b/init.sh index 33d9c21..3c9dcef 100755 --- a/init.sh +++ b/init.sh @@ -1,6 +1,6 @@ git init git checkout -b main git add * -git commit -m "first commit" +git commit -m "PIN konflikt Buttons und I2S gefixt" git remote add origin https://git.hacker-net.de/Hacker-Software/lego-esp32s3-gameboy.git git push -u origin main diff --git a/main/hardware_config.h b/main/hardware_config.h index b3cd5fa..3c9ad88 100644 --- a/main/hardware_config.h +++ b/main/hardware_config.h @@ -72,9 +72,9 @@ extern "C" { #define I2S_SAMPLE_RATE 32000 // Hz (GameBoy: 32kHz) #define I2S_BITS_PER_SAMPLE 16 -#define I2S_PIN_BCLK 41 // Bit Clock -#define I2S_PIN_LRC 42 // Left/Right Clock (WS) -#define I2S_PIN_DIN 40 // Data In (to MAX98357A) +#define I2S_PIN_BCLK 35 // Bit Clock (moved from 41 - conflict fixed!) +#define I2S_PIN_LRC 36 // Left/Right Clock (WS) (moved from 42 - conflict fixed!) +#define I2S_PIN_DIN 37 // Data In (to MAX98357A) (moved from 40) // No MCLK needed for MAX98357A! #define I2S_DMA_BUF_COUNT 8 @@ -179,11 +179,13 @@ GPIO | Function | Direction | Notes 17 | LINK_SCLK | I/O | Link Cable 18 | LINK_SOUT | Output | Link Cable 21 | BTN_A | Input | Pull-up +35 | I2S_BCLK | Output | Audio Bit Clock +36 | I2S_LRC | Output | Audio Word Select +37 | I2S_DIN | Output | Audio Data 38 | LINK_SIN | Input | Link Cable 39 | LED_STATUS | Output | Status indicator -40 | I2S_DIN | Output | Audio -41 | BTN_RIGHT/I2S_BCLK| I/O | Shared! -42 | BTN_LEFT/I2S_LRC | I/O | Shared! +41 | BTN_RIGHT | Input | Pull-up (conflict fixed!) +42 | BTN_LEFT | Input | Pull-up (conflict fixed!) 43 | UART_TX | Output | Debug 44 | UART_RX | Input | Debug 45 | BTN_SELECT | Input | Pull-up @@ -192,10 +194,10 @@ GPIO | Function | Direction | Notes 48 | BTN_START | Input | Pull-up NOTES: -- GPIO 41/42 are SHARED between buttons and I2S! - → Configure carefully or use different pins +- PIN CONFLICTS FIXED! I2S moved to GPIO 35/36/37 +- Buttons GPIO 41/42 are now free from conflicts! - SPI bus is shared: Display + SD Card - → Use separate CS pins! + → Use separate CS pins! - I2C0: Touch controller - I2C1: NFC reader (separate bus!) - All buttons have internal pull-ups enabled @@ -207,13 +209,6 @@ NOTES: #define VALIDATE_PIN(pin) ((pin) >= 0 && (pin) <= 48) // Check for pin conflicts at compile time -#if (BTN_RIGHT == I2S_PIN_BCLK) - #warning "BTN_RIGHT and I2S_BCLK share GPIO 41!" -#endif - -#if (BTN_LEFT == I2S_PIN_LRC) - #warning "BTN_LEFT and I2S_LRC share GPIO 42!" -#endif #ifdef __cplusplus }