// This file contains the DCC and LED definitions.
//
// It was automatically generated by the program ProgGenerator Ver. 3.5.0C1      by Hardi
// File creation: 03/22/26 14:37:53
// (Attention: The display in the Arduino IDE is not updated if Options/External Editor is disabled)

#ifndef __LEDS_AUTOPROG_H__
#define __LEDS_AUTOPROG_H__

#ifndef CONFIG_ONLY
#ifndef ARDUINO_RASPBERRY_PI_PICO
#ifndef FASTLED_ESP32_I2S
#define FASTLED_INTERNAL       // Disable version number message in FastLED library (looks like an error)
#endif
#include <FastLED.h>           // The FastLED library must be installed in addition if you got the error message "..fatal error: FastLED.h: No such file or directory"
                               // Arduino IDE: Sketch / Include library / Manage libraries                    Deutsche IDE: Sketch / Bibliothek einbinden / Bibliothek verwalten
                               //              Type "FastLED" in the "Filter your search..." field                          "FastLED" in das "Grenzen Sie ihre Suche ein" Feld eingeben
                               //              Select the entry and click "Install"                                         Gefundenen Eintrag auswaehlen und "Install" anklicken
#else
#include <PicoFastLED.h>       // Juergens minimum version or FastLED for Raspberry Pico
#endif
#endif // CONFIG_ONLY

#include <MobaLedLib.h>

#define START_MSG "LEDs_AutoProg Ver 3: AM328 3.5.0C1 03.22.26 14:37"

#define TWO_BUTTONS_PER_ADDRESS 1      // Two buttons (Red/Green) are used (DCC/LNet/CAN)
#ifdef NUM_LEDS
  #warning "'NUM_LEDS' definition in the main program is replaced by the included 'LEDs_AutoProg.h' with 20"
  #undef NUM_LEDS
#endif

#define NUM_LEDS 20                    // Number of LEDs (Maximal 256 RGB LEDs could be used)

#define LEDS_PER_CHANNEL ",20"

#define USE_PROTOCOL_DCC

#define RECEIVE_LED_COLOR_PER_RS232

#define GEN_BUTTON_RELEASE
#define GEN_BUTTON_RELEASE_COM GEN_OFF
#define USE_EXT_ADDR
#define USE_RS232_OR_SPI_AS_INPUT      // Use the RS232 or SPI Input to read DCC/SX commands from the second Arduino and from the PC (The SPI is only used if enabled with USE_SPI_COM)
#define ADDR_OFFSET 0

#define ADDR_MSK  0x3FFF  // 14 Bits are used for the Address

#define S_ONOFF   (uint16_t)0
#define B_RED     (uint16_t)(1<<14)
#define B_GREEN   (uint16_t)(2<<14)
#define O_RET_MSG (uint16_t)(3<<14)    // Return messages (Rueckmelder)
#define B_TAST    B_RED


typedef struct
    {
    uint16_t AddrAndTyp; // Addr range: 0..16383. The upper two bytes are used for the type
    uint8_t  InCnt;
    } __attribute__ ((packed)) Ext_Addr_T;

// Definition of external adresses
#ifdef CONFIG_ONLY
const Ext_Addr_T Ext_Addr[] __attribute__ ((section (".MLLAddressConfig"))) =
#else
const PROGMEM Ext_Addr_T Ext_Addr[] =
#endif
         { // Addr & Typ    InCnt
           { 100  + B_RED,     1 },      // Excel row 13
         };


// Input channel defines for local inputs and expert users
#define INCH_DCC_100_RED        0      // Excel row 13



#define TOTAL_SWITCHES_A  0                                        // Number of used inputs for analog keyboard
#define TOTAL_SWITCHES_B  0                                        // Number of used inputs for keyboard 1
#define TOTAL_SWITCHES_C  0                                        // Number of used inputs for keyboard 2
#define TOTAL_SWITCHES_D  0                                        // Number of used inputs for main board switches
#define TOTAL_VARIABLES   1                                        // Number of used variables
/*********************/
#define SETUP_FASTLED()                                                      \
/*********************/                                                      \
  CLEDController& controller0 = FastLED.addLeds<NEOPIXEL,  6>(leds+  0, 20); \
                                                                             \
  controller0.clearLeds(256);                                                \
  FastLED.setDither(DISABLE_DITHER);       // avoid sending slightly modified brightness values
/*End*/

// ----- dynamic extensions section begin -----
#define MLL_EXTENSIONS_ACTIVE
#include <MLLExtension.h>

// Extension ab!
#include <ab!.h>
// Extension HLMakro
#include <HLMakro.h>
// Extension HLMakro2
#include <HLMakro2.h>
// Extension HLtest
#include <HLtest.h>
// Extension HL_test
#include <HL_test.h>
// Extension HL_Test1
#include <HL_Test1.h>
// Extension HL_test7
#include <HL_test7.h>
// Extension HL_TestMacro
#include <HL_TestMacro.h>
// Extension HL_Testmacro2
#include <HL_Testmacro2.h>
// Extension HL_TestMacro_a
#include <HL_TestMacro_a.h>
// ----- dynamic Extensions section end -----


//*******************************************************************
// *** Configuration array which defines the behavior of the LEDs ***
MobaLedLib_Configuration()
  {
  RGB_Heartbeat(0)                                                                                            /* LED auf dem Mainboard                                                                                                                                                                       */
  // Activation: Binary #ServoAnim(2,0,500,20,220,2500,2500,0,0,0,0,1,0,0,0,1)                                /* Excel row 13                                                                                                                                                                                */
  Bin_InCh_to_TmpVar(0, 1)                                                                                    /*     "                                                                                                                                                                                       */
  #define ENABLE_STORE_STATUS()                                                                               /*     "                                                                                                                                                                                       */
  APatternT1(1,28,SI_LocalVar,3,0,128,0,PM_NORMAL,500,20,1,2,60,1,2,100,1,2,140,1,2,180,1,2,220,1,3,180,1,4,140,1,4,100,1,4,60,1,4,20,1,5  ,0,0,0,0,0,63,128,0,0,0,63) /*     "                                                                                                                              */
  HL_TestMacro_a(2, SI_1, 1 Sek)                                                                              /* Excel row 14                                                                                                                                                                                */
  HL_TestMacro_a(3, SI_1, 2 Sek)                                                                              /* Excel row 15                                                                                                                                                                                */

  EndCfg // End of the configuration
  };
//*******************************************************************

#ifndef COPYLED_OFF
#define COPYLED_OFF 0
#endif

#ifndef COPYLED_OFF_ONCE
#define COPYLED_OFF_ONCE 1
#endif

//---------------------------------------------
void Set_Start_Values(MobaLedLib_C &MobaLedLib)
//---------------------------------------------
{
}


// No macros used which are stored to the EEPROM => Disable the ENABLE_STORE_STATUS flag in case it was set in the excel sheet
#ifdef ENABLE_STORE_STATUS
  #undef ENABLE_STORE_STATUS
#endif

#ifndef CONFIG_ONLY
// ----- dynamic extensions section begin -----
#include <MLLExtension.h>











// Extension P_ScheduleMLX
#include <P_ScheduleMLX.h>


// ----- dynamic Extensions section end -----

#endif // CONFIG_ONLY





#endif // __LEDS_AUTOPROG_H__
