Hilfe zum Zusammenbau und Anpassung

Hallo,

hier ist die Datei.

#ifndef SRC_CONSTANTS_HPP_
#define SRC_CONSTANTS_HPP_
#include <Arduino.h>

// ######################################################################
// ####### default pins #################################################
// ######################################################################

/* #### Classic/Every/Esp32-Nano ###########################################################
*                         | A0| A1| A2| A3| A4| A5| A6| A7| D0| D1| D2| D3| D5| D6| D7| D8|
* ------------------------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
* Com to DF Player        |   |   |   |   |   |   |   |   |RX*|TX*| RX| TX|   |   |   |   |
* 3 Button                | P | U | D |   |   |   |   |   |   |   |   |   |   |   |   |   |
* 5 Button                | P | V+| V-| U | D |   |   |   |   |   |   |   |   |   |   |   |
* 3x3 Button Board        | P | U | D | A |   |   |   |   |   |   |   |   |   |   |   |   |
* Open pin for random     |   |   |   |   |   |   |   | x |   |   |   |   |   |   |   |   |
* Rotary encoder          |   |   |   |CLK| DT|   |   |   |   |   |   |   |   |   |   |   |
* Poti                    |   |   |   | x |   |   |   |   |   |   |   |   |   |   |   |   |
* Neo Ring/LED animat.    |   |   |   |   |   |   |   |   |   |   |(x)|   | x |   |   |   |
* Speaker off             |   |   |   |   |   |   |   |   |   |   |   |   |   | x |   |   |
* Shutdown                |   |   |   |   |   |   |   |   |   |   |   |   |   |   | x |   |
* headphone jack detection|   |   |   |   |   |   |   |   |   |   |   |   |   |   |   | x |
* special start shortcut  |   |   |   |   |   |   | x |   |   |   |   |   |   |   |   |   |
* bat voltage measurement |   |   |   |   |   | x |   |   |   |   |   |   |   |   |   |   |
* Bluetooth ON/OFF        |   |   |   |   |   |   |   |   |   |   | x*|   |   | x |   |   |
* Bluetooth Pairing       |   |   |   |   |   |   |   |   |   |   |   | x*|   |   |   | x |
* Button LED Pins         |   |   |   |   |   | P |   |   |   |   |   |   | D | U |   |   |
* #########################################################################################
*
* (*) Hardware Serial on Every/Esp32-Nano
*/
/* ### AiOplus #########################################################################################
*                         | A0| A1| A2| A3| A4| A5| A6| A7|D10|D14|D19|D21|D27|D31|D32|D33|D36|D37|A14|
*                         |   |   |   |   |   |   |   |   |PB2|PC0|PC5|PC7|PD5|PE1|PE2|PE3|PF2|PF3|PF4|
* ------------------------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
* 3 Button                | P | D | U |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |
* 5 Button                | P | D | U | V-| V+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
* 3x3 Button Board        | P |   | A | D | U |   |   |   |   |   |   |   |   |   |   |   |   |   |   |
* Open pin for random     |   |   |   |   |   |   |   | x |   |   |   |   |   |   |   |   |   |   |   |
* Rotary encoder          |   |   |   |   |   |   |   |   |   |   |   |   |   |CLK| DT|   |CLK| DT|   |
* Poti                    |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   | x |
* Neo Ring/LED animat.    |   |   |   |   |   |   |   |   | x |(x)|   |   |   |   |   |   |   |   |   |
* Speaker off             |   |   |   |   |   |   |   |   |   |   | x |   |   |   |   |   |   |   |   |
* Shutdown                |   |   |   |   |   |   |   |   |   |   |   |   | x |   |   |   |   |   |   |
* headphone jack detection|   |   |   |   |   |   |   |   |   |   |   | x |   |   |   |   |   |   |   |
* special start shortcut  |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   | x |   |   |   |
* bat voltage measurement |   |   |   |   |   |   | x |   |   |   |   |   |   |   |   |   |   |   |   |
* #####################################################################################################
*/
/* ### AiO #################################################################
*                         | A0| A1| A2| A3| A4| A5| A6| A7| D5| D6| D7| D8|
* ------------------------+---+---+---+---+---+---+---+---+---+---+---+---+
* 3 Button                | P | D | U |   |   |   |   |   |   |   |   |   |
* 5 Button                | P | D | U | V-| V+|   |   |   |   |   |   |   |
* 3x3 Button Board        | P |   | A | D | U |   |   |   |   |   |   |   |
* Open pin for random     |   |   |   |   |   |   |   | x |   |   |   |   |
* Rotary encoder          |   |   |   |CLK| DT|   |   |   |   |   |   |   |
* Poti                    |   |   |   | x |   |   |   |   |   |   |   |   |
* Neo Ring/LED animat.    |   |   |   |   |   |   |   |   | x |   |   |   |
* Speaker off             |   |   |   |   |   |   |   |   |   |   |   | x |
* Shutdown                |   |   |   |   |   |   |   |   |   |   | x |   |
* special start shortcut  |   |   |   |   |   |   | x |   |   |   |   |   |
* #########################################################################
*/
/* #### Esp32-Wroom32 ##############################################################
* GPIO                    | 33| 25| 26| 27| 44| 35| 12| 39| 16| 17|  2| 15| 13| 34|
* Pin                     |D33|D25|D26|D27|D14|D35|D12| VN|RX2|TX2| D2|D15|D13|D34|
* ------------------------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
* Com to DF Player        |   |   |   |   |   |   |   |   | RX| TX|   |   |   |   |
* 3 Button                | P | U | D |   |   |   |   |   |   |   |   |   |   |   |
* 5 Button                | P | V+| V-| U | D |   |   |   |   |   |   |   |   |   |
* 3x3 Button Board        | P | U | D | A |   |   |   |   |   |   |   |   |   |   |
* Open pin for random     |   |   |   |   |   |   |   | x |   |   |   |   |   |   |
* Rotary encoder          |   |   |   |CLK| DT|   |   |   |   |   |   |   |   |   |
* Poti                    |   |   |   | x |   |   |   |   |   |   |   |   |   |   |
* Neo Ring/LED animat.    |   |   |   |   |   |   |   |   |   |   | x |   |   |   |
* Speaker off             |   |   |   |   |   |   |   |   |   |   |   | x |   |   |
* Shutdown                |   |   |   |   |   |   |   |   |   |   |   |   | x |   |
* headphone jack detection|   |   |   |   |   |   |   |   |   |   |   |   |   | x |
* special start shortcut  |   |   |   |   |   |   | x |   |   |   |   |   |   |   |
* bat voltage measurement |   |   |   |   |   | x |   |   |   |   |   |   |   |   |
* #################################################################################
*/
// ######################################################################
// ####### variant and feature configuration ############################
// ######################################################################
/* Select the right PCB by uncommenting one of the following lines
* Bitte die passende Platine durch entfernen der Kommentare in einer der folgenden Zeilen auswählen
*/
#define TonUINO_Classic
//#define TonUINO_Every
//#define TonUINO_Every_4808
//#define ALLinONE
//#define ALLinONE_Plus
//#define TonUINO_Esp32 100 // Esp32 Nano
//#define TonUINO_Esp32 200 // Esp32 Wroom 32
#include "gpioHelper.hpp"

#if defined(TonUINO_Classic)
DECL_PCB(1)
#endif
#if defined(TonUINO_Every)
DECL_PCB(2)
#endif
#if defined(TonUINO_Every_4808)
DECL_PCB(3)
#endif
#if defined(ALLinONE)
DECL_PCB(4)
#endif
#if defined(ALLinONE_Plus)
DECL_PCB(5)
#endif
#if defined(TonUINO_Esp32)
DECL_PCB(6)
#endif
static_assert(SUM_PCB == 1 , "Please uncomment exactly one of the PCB lines (TonUINO_Classic, TonUINO_Every, etc.). Bitte genau eine der Zeilen zur Definition einer Platine einkommentieren (TonUINO_Classic, TonUINO_Every, etc.).");

// ######################################################################

/* uncomment one of the below lines to enable special button support
* um die Tasten zu konfigurieren, bitte eine der nächsten Zeilen auskommentieren
* default: THREEBUTTONS for classic/every
*          FIVEBUTTONS  for AiO and AiO+
*/
//#define THREEBUTTONS
#define FIVEBUTTONS
//#define BUTTONS3X3

// ######################################################################

/* If using Nano Every with connected DfPlayer Rx/Tx to D0/D1 uncomment the following lines
* Wenn der Nano Every verwendet wird und Rx/Tx vom DfPlayer mit D0/D1 verbunden ist, den Kommentare der folgenden Zeile entfernen
*/
//#define DFPlayerUsesHardwareSerial

// ######################################################################

/* uncomment the below line to enable serial input as additional command source
* um den Serial Monitor als zusätzliche Kommandoquelle zu haben bitte in der nächste Zeile den Kommentar entfernen
* -7:             -8: up         -9: upLong
* -4: allLong     -5: pause      -6: pauseLong
* -1: up/downLong -2: down       -3: downLong
* number n > 0: Springe im Voice Menü zum n-ten Eintrag und selektiere ihn
*/
//#define SerialInputAsCommand

// ######################################################################

/* uncomment one of the below lines to support a special chip on the DfMiniMp3 player
* um einen speziellen Chip auf dem DfMiniMp3 Player zu ünterstützen bitte in eine der nächste Zeilen den Kommentar entfernen
*
* GD3200B:     bad behavior of getFolderTrackCount() - ignores the parameter folder
*              bad behavior of callback OnPlayFinished - it is also called on advertise tracks
* MH2024K16SS: no checksums
*              bad behavior of callback OnPlayFinished - it is also called on advertise tracks
* LISP3:       bad behavior of callback OnPlayFinished - it is also called on advertise tracks
* MP3-TF-16P V3.0 with MH2024K24SS:
*              very slow
*              bad behavior of callback OnPlayFinished - it is also called on advertise tracks
* LKP Player:  no ACK for requests (use Mp3ChipIncongruousNoAck for them)
*/
//#define DFMiniMp3_T_CHIP_GD3200B
//#define DFMiniMp3_T_CHIP_MH2024K16SS
//#define DFMiniMp3_T_CHIP_LISP3
#define DFMiniMp3_T_CHIP_MH2024K24SS_MP3_TF_16P_V3_0
//#define DFMiniMp3_T_CHIP_Mp3ChipIncongruousNoAck

// ######################################################################

/* uncomment the below line to disable shutdown via button (long press play/pause)
* um ein Shutdown via Taste (long press Play/Pause) zu unterdrücken bitte in der nächste Zeile den Kommentar entfernen
*/
//#define DISABLE_SHUTDOWN_VIA_BUTTON

// ######################################################################

/* uncomment the below line to enable the rotary encoder for volume setting
* um den Drehgeber zu unterstützen bitte in der nächste Zeile den Kommentar entfernen
*/
//#define ROTARY_ENCODER
/* uncomment the below line to enable the rotary encoder also for next and previous (only one click in one second)
* um den Drehgeber auch für vor und zurück zu unterstützen bitte in der nächste Zeile den Kommentar entfernen
*/
//#define ROTARY_ENCODER_LONGPRESS
#ifdef ROTARY_ENCODER
#ifdef ALLinONE_Plus
// if using Rotary Encoder Buchse
//inline constexpr uint8_t   rotaryEncoderClkPin    = 31; // PE1
//inline constexpr uint8_t   rotaryEncoderDtPin     = 32; // PE2
// if using Opt Leiste (Male)
inline constexpr uint8_t   rotaryEncoderClkPin    = 36; // PF2
inline constexpr uint8_t   rotaryEncoderDtPin     = 37; // PF3
#elif TonUINO_Esp32 == 200
inline constexpr uint8_t   rotaryEncoderClkPin    = 27; // (D27)
inline constexpr uint8_t   rotaryEncoderDtPin     = 14; // (D14)
#else
inline constexpr uint8_t   rotaryEncoderClkPin    = A3; // A3
inline constexpr uint8_t   rotaryEncoderDtPin     = A4; // A4
#endif // ALLinONE_Plus
inline constexpr uint8_t   rotaryEncoderDebounce  = 75; // ms
inline constexpr bool      rotaryEncoderPullUp    = false;
#endif // ROTARY_ENCODER

// ######################################################################

/* uncomment the below line to enable the poti for volume setting
* um den Poti zu unterstützen bitte in der nächste Zeile den Kommentar entfernen
*/
//#define POTI
#ifdef POTI
#ifdef ALLinONE_Plus
inline constexpr uint8_t   potiPin    = A14; // AiO+ PF4
#elif TonUINO_Esp32 == 200
inline constexpr uint8_t   potiPin    = 27 ; // (D27)
#else
inline constexpr uint8_t   potiPin    = A3 ; // AiO/Classic A3
#endif // ALLinONE_Plus
#endif // POTI

// ######################################################################

/* uncomment the below line to enable the neo ring
* To have more features (show volume setting) uncomment also NEO_RING_EXT
* um den Neo Ring zu unterstützen bitte in der nächste Zeile den Kommentar entfernen
* um weitere Features einzuschalten, auch den Kommentar für NEO_RING_EXT entfernen
*/
//#define NEO_RING
//#define NEO_RING_EXT
//#define NEO_RING_2
#ifdef NEO_RING
#ifdef ALLinONE_Plus
inline constexpr uint8_t neoPixelRingPin = 10; // PB2 on AiOplus (Erweiterungsleiste (Female))
#elif TonUINO_Esp32 == 200
inline constexpr uint8_t neoPixelRingPin =  2; // GPIO02 (D2) on ESP32 Wroom 32
#else
inline constexpr uint8_t neoPixelRingPin = D5; // D5 on AiO/Classic
#endif // ALLinONE_Plus
inline constexpr uint8_t neoPixelNumber  = 24; // Total Number of Pixels
#ifdef NEO_RING_2
#ifdef ALLinONE_Plus
inline constexpr uint8_t neoPixelRingPin2= 14; // PC0 on AiOplus (Erweiterungsleiste (Female))
#else
inline constexpr uint8_t neoPixelRingPin2= D2; // D2 on AiO/Classic (only Every)
#endif // ALLinONE_Plus
inline constexpr uint8_t neoPixelNumber2 = 24; // Total Number of Pixels
#endif // NEO_RING_2
#endif // NEO_RING

// ######################################################################

/* uncomment the below line to enable the Speaker on/off for Classic to suppress noise
* on startup and shutdown (automatically enabled on AiO and AiOplus)
* um den Lautsprecher ein/aus Schalter für die Classic Variante zu unterstützen bitte
* in der nächste Zeile den Kommentar entfernen (zur Unterdrückung der Ein- und Ausschaltgeräusche)
* (automatisch eingeschaltet für AiO und AiOplus)
*/
//#define SPKONOFF
#ifdef SPKONOFF
#if not defined(ALLinONE_Plus) and not defined(ALLinONE) and not (TonUINO_Esp32 == 200)
inline constexpr uint8_t       ampEnablePin     = D6;
inline constexpr levelType     ampEnablePinType = levelType::activeHigh;
#elif (TonUINO_Esp32 == 200)
inline constexpr uint8_t       ampEnablePin     = 15; // (D15)
inline constexpr levelType     ampEnablePinType = levelType::activeLow;
#endif
#endif // SPKONOFF

// ######################################################################

/* uncomment the below line to enable the Headphone Jack detection (automatically enabled on AiOplus)
* um die Kopfhörer Erkennung einzuschalten bitte in der nächste Zeile den Kommentar entfernen
* (automatisch eingeschaltet für AiOplus)
*/
//#define HPJACKDETECT
#ifdef HPJACKDETECT
#if not defined(ALLinONE_Plus)  and not (TonUINO_Esp32 == 200)
inline constexpr uint8_t       dfPlayer_noHeadphoneJackDetect     = D8;
inline constexpr levelType     dfPlayer_noHeadphoneJackDetectType = levelType::activeLow;
#elif (TonUINO_Esp32 == 200)
inline constexpr uint8_t        dfPlayer_noHeadphoneJackDetect     = 34; // (D34)
inline constexpr levelType      dfPlayer_noHeadphoneJackDetectType = levelType::activeLow;
#endif
#endif // HPJACKDETECT

// ######################################################################

/* uncomment the below line to ignore the RFID if it is already playing
* um die selbe RFID zu ignorieren, wenn die bereits spielt, in der nächste
* Zeile den Kommentar entfernen
*/
//#define DONT_ACCEPT_SAME_RFID_TWICE
/* uncomment the below line to resume playback if the RFID that started the
* playback is detected again
* um die Wiedergabe fortzusetzen, wenn die selbe RFID erkannt wird, die bereits
* abgespielt wird, in der nächste Zeile den Kommentar entfernen
*/
//#define RESUME_ON_SAME_RFID
/* uncomment the below line to replay the last card or short cut if pressed play/pause
* in Idle state
* um die letzte Karte oder den letzten Short Cut wieder abzuspielen, wenn die Play/Pause Taste
* im Idle State gedrückt wird, in der nächste Zeile den Kommentar entfernen
*/
//#define REPLAY_ON_PLAY_BUTTON

// ######################################################################

/* uncomment the below line(s) to enable the quiz, memory teapot game
* um das Quiz, Memory oder Teekesselchen Spiel zu aktivieren, in der nächste Zeile(n) den Kommentar entfernen
*/
//#define QUIZ_GAME
//#define MEMORY_GAME
//#define TEAPOT_GAME

// ######################################################################

/* uncomment the below line to store the last played card in EEPROM
* um die letzte Karte im EEPROM zu speichern, in der nächste Zeile den Kommentar entfernen
*/
//#define STORE_LAST_CARD

// ######################################################################

/* uncomment the below line to enable special shortcut on startup via GPIO
* um den spezial Shortcut beim Start via GPIO zu aktivieren, in der nächste Zeile den Kommentar entfernen
*/
//#define SPECIAL_START_SHORTCUT
#ifdef SPECIAL_START_SHORTCUT
#ifdef ALLinONE_Plus
inline constexpr uint8_t   specialStartShortcutPin     = 33; // PE3
#elif (TonUINO_Esp32 == 200)
inline constexpr uint8_t   specialStartShortcutPin     = 12; // D12
#else
inline constexpr uint8_t   specialStartShortcutPin     = A6; // A6 on AiO/Classic
#endif // ALLinONE_Plus
inline constexpr levelType specialStartShortcutPinType = levelType::activeHigh;
inline constexpr uint8_t   specialStartShortcutFolder  = 1;
inline constexpr uint8_t   specialStartShortcutTrack   = 1;
#endif // SPECIAL_START_SHORTCUT

// ######################################################################

/* uncomment the below line to enable support for BT module
* um die Unterstützung des BT Modules zu aktivieren, in der nächste Zeile den Kommentar entfernen
*/
//#define BT_MODULE
#ifdef BT_MODULE
#ifdef DFPlayerUsesHardwareSerial
inline constexpr uint8_t   btModuleOnPin               =  D2; // D2
inline constexpr uint8_t   btModulePairingPin          =  D3; // D3
#else
inline constexpr uint8_t   btModuleOnPin               =  D6; // D6
inline constexpr uint8_t   btModulePairingPin          =  D8; // D8
#endif
inline constexpr levelType btModuleOnPinType           = levelType::activeHigh;
inline constexpr levelType btModulePairingPinType      = levelType::activeHigh;
inline constexpr unsigned long btModulePairingPulse    = 500;
#endif // BT_MODULE

// ######################################################################

/* uncomment the below line to enable battery voltage measurement (not for ALLinONE, not recommended for TonUINO_Classic)
* um die Batterie Spannungsmessung zu aktivieren, in der nächste Zeile den Kommentar entfernen
* (nicht für ALLinONE, nicht empfohlen für TonUINO_Classic)
*/
//#define BAT_VOLTAGE_MEASUREMENT
#ifdef BAT_VOLTAGE_MEASUREMENT
#if not defined(ALLinONE_Plus) and not defined(ALLinONE) and not (TonUINO_Esp32 == 200)
inline constexpr uint8_t voltageMeasurementPin         = A5;
#elif (TonUINO_Esp32 == 200)
inline constexpr uint8_t voltageMeasurementPin         = 35; // (D35)
#endif // ALLinONE_Plus
#ifdef ALLinONE_Plus
inline constexpr float   voltageMeasurementCorrection  = 2.075; // Spannungsteiler 100k/100k
#endif
#ifdef TonUINO_Classic
inline constexpr float   voltageMeasurementCorrection  = 1.960; // Spannungsteiler 100k/100k
#endif
#ifdef TonUINO_Every
inline constexpr float   voltageMeasurementCorrection  = 2.007; // Spannungsteiler 100k/100k
#endif
#ifdef TonUINO_Every_4808
inline constexpr float   voltageMeasurementCorrection  = 2.007; // Spannungsteiler 100k/100k
#endif
#ifdef TonUINO_Esp32
inline constexpr float   voltageMeasurementCorrection  = 0.710; // Spannungsteiler 100k/100k
#endif
// for Li-Ion
inline constexpr float   batVoltageLow                 = 2.95;
inline constexpr float   batVoltageEmpty               = 2.90;
// for Li-PO
//inline constexpr float   batVoltageLow                 = 3.40;
//inline constexpr float   batVoltageEmpty               = 3.20;
#endif // BAT_VOLTAGE_MEASUREMENT

// ######################################################################

/* uncomment the below lines if you use Pololu Powerswitch or Traeger Platine for shutdown
* wenn der Pololu Powerswitch oder die Traeger Platine für das Shutdown verwendet wird, in den nächsten Zeile den Kommentar entfernen
*/
//#define USE_POLOLU_SHUTDOWN
//#define USE_TRAEGER_PLATINE_SHUTDOWN

// ######################################################################

/* uncomment one of the below lines if you want to change the antenna gain of the MFRC522 module
* wenn die Antennenverstärkung des MFRC522 Modules verändert werden soll, in der nächsten Zeilen einen Kommentar entfernen
*/
//#define MRFC522_RX_GAIN RxGain_18dB
//#define MRFC522_RX_GAIN RxGain_23dB
//#define MRFC522_RX_GAIN RxGain_33dB // default
//#define MRFC522_RX_GAIN RxGain_38dB
//#define MRFC522_RX_GAIN RxGain_43dB
//#define MRFC522_RX_GAIN RxGain_48dB
//#define MRFC522_RX_GAIN RxGain_min  // 18dB
//#define MRFC522_RX_GAIN RxGain_avg  // 33dB
//#define MRFC522_RX_GAIN RxGain_max  // 48dB

// ######################################################################

/* uncomment the below lines if you want to have the Jukebox modification card
* wenn du die Jukebox haben willst, in den nächsten Zeile den Kommentar entfernen
*/
//#define MODIFICATION_CARD_JUKEBOX
#ifdef MODIFICATION_CARD_JUKEBOX
inline constexpr uint8_t jukebox_max_cards  = 10;
#endif

// ######################################################################

/* uncomment the below lines if you want to have the Pause after Track modification card
* wenn du die Pause nach jedem Track Modifikationskarte haben willst, in den nächsten Zeile den Kommentar entfernen
*/
//#define MODIFICATION_CARD_PAUSE_AFTER_TRACK
// ######################################################################
/* Enable this definition to activate animated LED button support via the LedManager.
*
* LED behavior:
* - Startup:        All LEDs blink one after another.
* - Awaiting input: All LEDs blink synchronously.
* - Playing:        All LEDs stay on continuously.
* - Paused:         Only the Play/Pause LED blinks.
* - Shutdown:       All LEDs are turned off.
* - On a valid button press, all LEDs blink once by toggling their current state.
*
* Use a series resistor (e.g. 1KΩ) per LED to limit current.
*
* ----------------------------------------------------------------------
*
* Nachfolgenden Kommentar entfernen, um animierte LED-Tasten über den LedManager zu nutzen.
*
* LED-Verhalten:
* - Beim Start:          Alle LEDs blinken nacheinander.
* - Wartet auf Eingabe:  Alle LEDs blinken synchron.
* - Wiedergabe läuft:    Alle LEDs leuchten dauerhaft.
* - Wiedergabe pausiert: Nur die Play/Pause-LED blinkt.
* - Abschaltung:         Alle LEDs werden ausgeschalten.
* - Bei einem gültigen Tastendruck blinken alle LEDs einmal, indem ihr aktueller Zustand invertiert wird.
*
* Verwende einen Widerstand (z.B. 1KΩ) in Reihe zu jeder LED zur Strombegrenzung.
*/
//#define USE_LED_BUTTONS
#ifdef USE_LED_BUTTONS
inline constexpr uint8_t led_play_pin = A5;
inline constexpr uint8_t led_up_pin   = D6;
inline constexpr uint8_t led_down_pin = D5;
inline constexpr unsigned long led_update_interval = 800; // ms
inline constexpr unsigned long led_short_blink     = 400; // ms
#endif // USE_LED_BUTTONS
//#define POWER_HOLD_READY
#ifdef POWER_HOLD_READY
inline constexpr uint8_t power_hold_ready_pin        = D2;
inline constexpr levelType power_hold_ready_pin_type = levelType::activeHigh;
#endif
//#define FOLDER_QUEUE_HOERBUCH

...
#endif /* SRC_CONSTANTS_HPP\_ */

Edit Boerge: Formatierung bereinigt

Die Konfiguration ist soweit in Ordnung. Sie entspricht der Minimalkonfiguration um den Tonuino ohne Extrafunktionen zu betreiben. Normalerweise sollten da auch auf dem Nano 328P keine Speicherprobleme auftreten.

Wie Thomas schon schrieb: Das ist die Minimalkonfiguration und macht eigentlich keine Speicherprobleme.
Anhand der Bilder Deiner Nanos meine ich zu erkennen, dass es 2 unterschiedliche Modelle sind (mit unterschiedlichen USB-Buchsen bestückt). Da könnte die Ursache liegen, indem der eine davon nicht den Spezifikationen entspricht.

Eigentlich wollte ich auch sehen, mit welchen DF-Player Du arbeitest.
Eingestellt hast Du einen Player mit MH2024K24SS Chip.
Dieser Chip ist leider als ziemlich langsam bekannt, d.h. in einigen Fällen sendet das Programm des TonUINO die Befehle schneller als der Chip sie verarbeiten kann. Um das zu vermeiden sind zwar schon Wartezeiten im Programm eingebaut, die aber noch nicht ausreichend lang zu sein scheinen.

Diese Wartezeit kannst Du einfach in der constants.hpp verändern:

#if defined(DFMiniMp3_T_CHIP_MH2024K24SS_MP3_TF_16P_V3_0)
inline constexpr unsigned long dfPlayer_timeUntilStarts = 2500;

Das müssten bei Deiner Programmversion die Zeilen 795 / 796 sein.

Aktuell ist hier die Wartezeit auf 2,5 Sekunden (= 2500 Millisekunden) eingestellt.
Du kannst die Wartezeit bedenkenlos auf 3500 Millisekunden anheben und schauen, ob immer noch ein „missing OnPlayFinished“ auftritt.
Sollte die Änderung helfen, aber Dein TonUINO erscheint etwas träge, kannst Du die Zeit wieder schrittweise verkürzen bis ein akzeptabler Zustand erreicht ist.

Hallo,

so ich versuche mal meine Hardware irgendwie zusammen zu fassen.

Also als Nano habe ich einmal mit USB Mini und einen mit USB C. Beide mit V3 und ATmega 328.

Bei den USB Mini kann ich die Software per Webseite aufspielen aber nicht mit der ArduinoIDE, da kommt dann der Fehler mit dem Arbeitsspeicher.

Bei dem USB C kann ich es nicht per Webseite aufspielen, da ist ein Timeout nach 400 ms. Dafür geht es mit der ArduinoIDE.

An DF-Player habe ich in meiner Grabbelkiste zwei Versionen. Einmal den MH2024K-24SS und dann einen AC26E010721.

Langsam verzweifele ich an der Hardware und alles. Im Moment wäre bei mir ein Punkt, wo ich am liebsten alles in eine Kiste werfen würde und es begraben, was schade wäre.

Gruß Sabrina

Nein, nicht verzweifeln. Es gibt immer eine Lösung.
Zum Hochladen der Software in der IDE auf das Board was da rumzickt probiere mal folgendes aus. Für den Nano werden hier zwei Typen aufgeführt. Eine Version mit der Ergänzug old Bootlader und eine ohne. Probiere mal beide aus. Eine von beiden sollte funktionieren.
Was den DF-Player angeht, mach mal ein Foto auf dem man die Bezeichnung des größeren Chips lesen kann. Ich denke mal, dass einer von MH-ET- Live ist, und der Andere von JL. Der JL sollte mit der Konfiguration des Chipsatzes Incongruous no acknowledge gut funktionieren. Du machst aber auch nichts kaputt, wenn du auch mal die anderen Typkonfigurationen ausprobierst.

Guten Morgen.

Hier sind die Bilder zu den beiden Chips.

So und nun zum Versuch mit der Software auf dem zickigen zu bekommen.

Das ging nur mit dem old bootloader.

Gruß Sabrina