# File: include_dir\Lib_Config.h

Green shading in the line number column means the source is part of the translation unit, red means it is conditionally excluded. Highlighted line numbers link to the translation unit page. Highlighted macros link to the macro page.

           1: /*
           2:  MobaLedLib: LED library for model railways
           3:  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           4:
           5:  Copyright (C) 2018 - 2021  Hardi Stengelin: https://forum.mobaledlib.de
           6:
           7:  This library is free software; you can redistribute it and/or
           8:  modify it under the terms of the GNU Lesser General Public
           9:  License as published by the Free Software Foundation; either
          10:  version 2.1 of the License, or (at your option) any later version.
          11:
          12:  This library is distributed in the hope that it will be useful,
          13:  but WITHOUT ANY WARRANTY; without even the implied warranty of
          14:  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
          15:  Lesser General Public License for more details.
          16:
          17:  You should have received a copy of the GNU Lesser General Public
          18:  License along with this library; if not, write to the Free Software
          19:  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
          20:  -------------------------------------------------------------------------------------------------------------
          21:
          22:  Lib_Config.h
          23:  ~~~~~~~~~~~~
          24:
          25:  This file contains configuration variables to change the bahavior of the MobaLedLib.
          26:
          27: */
          28: #ifndef __LIB_CONFIG_H__
          29: #define __LIB_CONFIG_H__
          30:
          31: #include <Arduino.h>
          32:
          33: // *** Defines to enable certain functions of the library ***
          34:
          35: //#define _TEST_BUTTONS                 // Enable this to use three buttons connected to the Arduino pins for testing (04.08.18: FLASH: 1390, RAM 18 without DEBUG_PRINT_BUTTONS())
          36:
          37: //#define _PRINT_DEBUG_MESSAGES         // Enable this line to print debug messages to the PC (USB)
          38:
          39: //#define _DUMP_CONFIG                    // Enable this line to print the configuration memory on startup
          40:
          41: //#define _FAST_TIMES                   // Enable this for debugging with fast timing for the houses
          42:
          43: //#define _HOUSE_STATISTIC              // Calculate the average number of active lights in the houses
          44:
          45:
          46: //#define _USE_LOCAL_TX                   // The variables t4w, tw and t10 are calculated in each function instead of calculating them once in Int_Update()
          47:                                         // Saves 3 Bytes RAM, but uses 42 bytes FLASH
          48:
          49: #define _USE_SEP_CONST                  // Use a separate Const() function instead of the Pattern function. This saves
          50:                                         // 5 byte RAM and 10 Byte FLASH per line, but the separate function needs 144 bytes
          51:                                         // FLASH for the program code ;-(
          52:                                         // If more than 14 Const() lines are used and if not enough RAM is available this
          53:                                         // line could be enabled.
          54:                                         // On the other hand the separate Const() function ist faster 7us / 17us.
          55:                                         // 18.11.18:  Enabled because of the saved RAM
          56:
          57: //#define _NEW_ROOM_COL // Saves 162 Byte FLASH and 43 Bytes RAM
          58:
          59: #define _NEW_INITIALIZE                 // allows to restore input state after constructor before first initialize run
          60:
          61:
          62: // Memory usage tests / optimisation                  Flash  Ram   Attention _PRINT_DEBUG_MESSAGES must be disabled
          63: #define _USE_COUNTER        1           // 28.10.18:    592    0
          64: #define _USE_HOUSE          1           // 28.10.18:   2924   18?
          65: #define _USE_SET_COLTAB     1           // 09.12.18:
          66: #define _USE_SET_TVTAB      1           // 10.01.20:    176    4
          67: #define _USE_DEF_NEON       1           // 12.01.20:     96  -31 ?
          68: #define _USE_PATTERN        1           // 28.10.18:   2096    0
          69: #define _USE_FIRE           1           // 28.10.18:    594    0
          70: #define _USE_HSV_GROUP      1           // 28.10.18:     62    0
          71: #define _USE_LOCAL_VAR      1           // 07.11.18:     ??
          72: #define _USE_USE_GLOBALVAR  1           // 26.11.18:    124    2
          73: #define _USE_INCH_TO_VAR    1           // 25.11.18:     ??
          74: #define _USE_LOGIC          1           // 28.10.18:    172    0
          75: #define _USE_RANDOM         1           // 28.10.18:    292    0
          76: #define _USE_RANMUX         1           // 28.10.18:    364    0
          77: #define _USE_WELDING        1           // 28.10.18:    430    0
          78: #define _USE_COPYLED        1           // 28.10.18:    116    0
          79: #define _USE_SCHEDULE       1           // 28.10.18:    264    0
          80: #define _USE_STORE_STATUS   1           // 22.04.20:    138    5                                              // 19.05.20: Juergen
          81: #define _USE_INCH_TRIGGER   1           // 08.06.20:    -12    0
          82: #define _USE_CANDLE         1           // 10.06.20:    352    2                                              // 09.06.20:
          83: #define _USE_EXT_PROC       1           // 26.09.21:     48    4                                              // 26.09.21: Juergen
          84:                                         //             8800    Sum
          85:
          86: #define _USE_COPY_N_LEDS    1           // 18.09.23:
          87: // Hardware pin definitions
          88:
          89: // Only used if _TEST_BUTTONS is enabled:
          90: const uint8_t Buttons[] = { 7, 8, 9 }; // Up to 6 button pins (_TEST_BUTTONS must be defined)
          91: #define LED_LEFT_PIN      3            // Yellow LED above the Left button
          92: #define LED_MID_PIN       4            // White LED above the middle button
          93: #define LED_RIGHT_PIN     5            // Blue LED above the Right button
          94: #define RES_INP_PIN       15
          95:
          96:
          97:
          98:
          99: #ifdef _FAST_TIMES  // Fast times for tests
         100:   #ifndef HOUSE_MIN_T
         101:     #define HOUSE_MIN_T     1            // Minimal time [s] to the next event (1..255)
         102:   #endif
         103:   #ifndef HOUSE_MAX_T
         104:     #define HOUSE_MAX_T     5            // Maximal random time [s]              "
         105:   #endif
         106: #else // Normal times
         107:   #ifndef HOUSE_MIN_T
         108:     #define HOUSE_MIN_T     50           // Minimal time [s] to the next event (1..255)
         109:   #endif
         110:   #ifndef HOUSE_MAX_T
         111:     #define HOUSE_MAX_T     150          // Maximal random time [s]              "
         112:   #endif
         113: #endif
         114:
         115: #ifdef _HOUSE_STATISTIC
         116:   #undef HOUSE_MIN_T
         117:   #undef HOUSE_MAX_T
         118:   #define HOUSE_MIN_T     1            // Minimal time [s] to the next event (1..255)
         119:   #define HOUSE_MAX_T     1            // Maximal random time [s]              "
         120: #endif
         121:
         122: #define GAS_MIN_T         2            // Minimal time [s] to the next event (1..255)
         123: #define GAS_MAX_T         5            // Maximal random time [s]                 "
         124:
         125: #endif // __LIB_CONFIG_H__
         126: