#ifndef devices_config_h
#define devices_config_h
/**/


// ***************************************  BOARDS  CONFIGURATION  ***************************************

#if DEVICE_ID == 21
  #define ESPNOW_ENABLED              1 // 1-enable ESPnow, 0 or nothing - NO ESPnow capabilities

  #define SENSOR_TYPE                 3 // 0 = "env", 1 = "motion", 2 =  "env+mot", 3 = "battery"
  #define HOSTNAME                    "esp32021"
  #define DEVICE_NAME                 "TRV5 Lidia"  // 15 characters maximum
  #define BOARD_TYPE                  4   // 1 = ESP32-S, 2 = ESP32-S2, 3 = ESP32-S3, 4 = ESP32-C3
  #define FW_UPGRADE_GPIO             0   // comment out if not in use - don't use "0" here unless you mean GPIO=0 - cannot be 8 or 9 on new boards if I2C used
  #define USE_MAX17048                1   // use "0" to disable
  #define USE_SHT31                   0   // use "0" to disable
  #define USE_TSL2561                 0   // use "0" to disable
  #define SLEEP_TIME_S                1 * 3600 // seconds - 6 hours

  #define CHARGING_GPIO               6  // wire RED MCU,   wire YELLOW connector,    LED RED,    CHRG PIN7 on TP4056
  #define POWER_GPIO                  5  // wire BLACK MCU, wire WHITE  connector,    LED GREEN,  STDB PIN6 on TP4056
  // charging resistor: 5k1
  
  #pragma message "compilation for: esp32021-TRV5-Lidia"
// ---------------------------------------------------------------------------------------------------

#elif DEVICE_ID == 22
  #define ESPNOW_ENABLED              1 // 1-enable ESPnow, 0 or nothing - NO ESPnow capabilities

  #define SENSOR_TYPE                 3 // 0 = "env", 1 = "motion", 2 =  "env+mot", 3 = "battery"
  #define HOSTNAME                    "esp32022"
  #define DEVICE_NAME                 "TRV6 Kids"  // 15 characters maximum
  #define BOARD_TYPE                  4   // 1 = ESP32-S, 2 = ESP32-S2, 3 = ESP32-S3, 4 = ESP32-C3
  #define FW_UPGRADE_GPIO             0   // comment out if not in use - don't use "0" here unless you mean GPIO=0 - cannot be 8 or 9 on new boards if I2C used
  #define USE_MAX17048                1   // use "0" to disable
  #define USE_SHT31                   0   // use "0" to disable
  #define USE_TSL2561                 0   // use "0" to disable
  #define SLEEP_TIME_S                1 * 3600 // seconds - 6 hours

  #define CHARGING_GPIO               6  // wire RED MCU,   wire YELLOW connector,    LED RED,    CHRG PIN7 on TP4056
  #define POWER_GPIO                  5  // wire BLACK MCU, wire WHITE  connector,    LED GREEN,  STDB PIN6 on TP4056
  // charging resistor: 5k1
  
  #pragma message "compilation for: esp32022-TRV6-Kids"
// ---------------------------------------------------------------------------------------------------

#elif DEVICE_ID == 23
  #define ESPNOW_ENABLED              1 // 1-enable ESPnow, 0 or nothing - NO ESPnow capabilities

  #define SENSOR_TYPE                 3 // 0 = "env", 1 = "motion", 2 =  "env+mot", 3 = "battery"
  #define HOSTNAME                    "esp32023"
  #define DEVICE_NAME                 "TRV2 Toilet b."  // 15 characters maximum
  #define BOARD_TYPE                  4   // 1 = ESP32-S, 2 = ESP32-S2, 3 = ESP32-S3, 4 = ESP32-C3
  #define FW_UPGRADE_GPIO             0   // comment out if not in use - don't use "0" here unless you mean GPIO=0 - cannot be 8 or 9 on new boards if I2C used
  #define USE_MAX17048                1   // use "0" to disable
  #define USE_SHT31                   0   // use "0" to disable
  #define USE_TSL2561                 0   // use "0" to disable
  #define SLEEP_TIME_S                1 * 3600 // seconds - 6 hours


  #define CHARGING_GPIO               6  // wire RED MCU,   wire YELLOW connector,    LED RED,    CHRG PIN7 on TP4056
  #define POWER_GPIO                  5  // wire BLACK MCU, wire WHITE  connector,    LED GREEN,  STDB PIN6 on TP4056
  // charging resistor: 5k1

  #pragma message "compilation for: esp32023-TRV2-Toilet-Bedroom"
// ---------------------------------------------------------------------------------------------------

#elif DEVICE_ID == 26
  #define ESPNOW_ENABLED              1 // 1-enable ESPnow, 0 or nothing - NO ESPnow capabilities

  #define SENSOR_TYPE                 3 // 0 = "env", 1 = "motion", 2 =  "env+mot", 3 = "battery"
  #define HOSTNAME                    "esp32026"
  #define DEVICE_NAME                 "TRV4 Printers"  // 15 characters maximum
  #define BOARD_TYPE                  4   // 1 = ESP32-S, 2 = ESP32-S2, 3 = ESP32-S3, 4 = ESP32-C3
  #define FW_UPGRADE_GPIO             0   // comment out if not in use - don't use "0" here unless you mean GPIO=0 - cannot be 8 or 9 on new boards if I2C used
  #define USE_MAX17048                1   // use "0" to disable
  #define USE_SHT31                   0   // use "0" to disable
  #define USE_TSL2561                 0   // use "0" to disable
  #define SLEEP_TIME_S                1 * 3600 // seconds - 6 hours

  #define CHARGING_GPIO               6  // wire RED MCU,   wire YELLOW connector,    LED RED,    CHRG PIN7 on TP4056
  #define POWER_GPIO                  5  // wire BLACK MCU, wire WHITE  connector,    LED GREEN,  STDB PIN6 on TP4056
  // charging resistor: 5k1
  
  #pragma message "compilation for: esp32026-TRV4-Printers"
// ---------------------------------------------------------------------------------------------------

#elif DEVICE_ID == 28
  #define ESPNOW_ENABLED              1 // 1-enable ESPnow, 0 or nothing - NO ESPnow capabilities

  #define SENSOR_TYPE                 2 // 0 = "env", 1 = "motion", 2 =  "env+mot"
  #define HOSTNAME                    "esp32028"
  #define DEVICE_NAME                 "Garage"  // 15 characters maximum
  #define BOARD_TYPE                  2   // 1 = ESP32-S, 2 = ESP32-S2, 3 = ESP32-S3
  #define CHARGING_GPIO               39  // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define POWER_GPIO                  38  // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define ACT_BLUE_LED_GPIO           6   // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define ERROR_RED_LED_GPIO          5   // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define FW_UPGRADE_GPIO             4   // comment out if not in use - don't use "0" here unless you mean GPIO=0 - cannot be 8 or 9 on new boards if I2C used
  #define ENABLE_3V_GPIO              3   // comment out if not in use - don't use "0" here unless you mean GPIO=0 - mandatory for I2C devices on new boards
  #define USE_MAX17048                1   // use "0" to disable
  #define USE_SHT31                   1   // use "0" to disable
  #define USE_TSL2561                 1   // use "0" to disable
  #define SLEEP_TIME_S                180 // seconds - 180

  #define MOTION_ENABLED              1   // 1 to enable, 0 to disable
  #if (MOTION_ENABLED == 1)
    #define NUMBER_OF_MOTION_SENSORS  2 // number of PIR sensors
    uint8_t motion_sensors_gpio[NUMBER_OF_MOTION_SENSORS] =    // put here GPIO for each PIR, active HIGH (no pull down resistor needed for SR602)
    {
      7,15
    };
  #endif

  #pragma message "compilation for: esp32028-Garage"
// ---------------------------------------------------------------------------------------------------

#elif DEVICE_ID == 31
  #define ESPNOW_ENABLED              1 // 1-enable ESPnow, 0 or nothing - NO ESPnow capabilities

  #define SENSOR_TYPE                 2 // 0 = "env", 1 = "motion", 2 =  "env+mot"
  #define HOSTNAME                    "esp32031"
  #define DEVICE_NAME                 "Printers"  // 15 characters maximum
  #define BOARD_TYPE                  2   // 1 = ESP32-S, 2 = ESP32-S2, 3 = ESP32-S3
  #define CHARGING_GPIO               39  // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define POWER_GPIO                  38  // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define ACT_BLUE_LED_GPIO           6   // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define ERROR_RED_LED_GPIO          5   // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define FW_UPGRADE_GPIO             4   // comment out if not in use - don't use "0" here unless you mean GPIO=0 - cannot be 8 or 9 on new boards if I2C used
  #define ENABLE_3V_GPIO              3   // comment out if not in use - don't use "0" here unless you mean GPIO=0 - mandatory for I2C devices on new boards
  #define USE_MAX17048                1   // use "0" to disable
  #define USE_SHT31                   1   // use "0" to disable
  #define USE_TSL2561                 1   // use "0" to disable
  #define SLEEP_TIME_S                180 // seconds - 180

  #define MOTION_ENABLED              1   // 1 to enable, 0 to disable
  #if (MOTION_ENABLED == 1)
    #define NUMBER_OF_MOTION_SENSORS  1 // number of PIR sensors
    uint8_t motion_sensors_gpio[NUMBER_OF_MOTION_SENSORS] =    // put here GPIO for each PIR, active HIGH (no pull down resistor needed for SR602)
    {
      7
    };
  #endif

  #pragma message "compilation for: esp32031-Printers room"
// ---------------------------------------------------------------------------------------------------

#elif DEVICE_ID == 32
  #define ESPNOW_ENABLED              1 // 1-enable ESPnow, 0 or nothing - NO ESPnow capabilities

  #define SENSOR_TYPE                 1 // 0 = "env", 1 = "motion", 2 =  "env+mot"
  #define HOSTNAME                    "esp32032"
  #define DEVICE_NAME                 "Bedroom mot."  // 15 characters maximum
  #define BOARD_TYPE                  2   // 1 = ESP32-S, 2 = ESP32-S2, 3 = ESP32-S3
  #define ACT_BLUE_LED_GPIO           6   // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define ERROR_RED_LED_GPIO          5   // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define FW_UPGRADE_GPIO             4   // comment out if not in use - don't use "0" here unless you mean GPIO=0 - cannot be 8 or 9 on new boards if I2C used
  #define ENABLE_3V_GPIO              3   // comment out if not in use - don't use "0" here unless you mean GPIO=0 - mandatory for I2C devices on new boards
  #define USE_MAX17048                1   // use "0" to disable
  #define USE_SHT31                   0   // use "0" to disable
  #define USE_TSL2561                 0   // use "0" to disable
  #define SLEEP_TIME_S                180 // seconds - 180

  #define MOTION_ENABLED              1   // 1 to enable, 0 to disable
  #if (MOTION_ENABLED == 1)
    #define NUMBER_OF_MOTION_SENSORS  1 // number of PIR sensors
    uint8_t motion_sensors_gpio[NUMBER_OF_MOTION_SENSORS] =    // put here GPIO for each PIR, active HIGH (no pull down resistor needed for SR602)
    {
      2
    };
  #endif
  #pragma message "compilation for: esp32032-bedroom motion"
// ---------------------------------------------------------------------------------------------------

#elif DEVICE_ID == 33
  #define ESPNOW_ENABLED              1 // 1-enable ESPnow, 0 or nothing - NO ESPnow capabilities

  #define SENSOR_TYPE                 2 // 0 = "env", 1 = "motion", 2 =  "env+mot"
  #define HOSTNAME                    "esp32033"
  #define DEVICE_NAME                 "Living"  // 15 characters maximum
  #define BOARD_TYPE                  2   // 1 = ESP32-S, 2 = ESP32-S2, 3 = ESP32-S3
  #define CHARGING_GPIO               39  // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define POWER_GPIO                  38  // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define ACT_BLUE_LED_GPIO           6   // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define ERROR_RED_LED_GPIO          5   // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define FW_UPGRADE_GPIO             4   // comment out if not in use - don't use "0" here unless you mean GPIO=0 - cannot be 8 or 9 on new boards if I2C used
  #define ENABLE_3V_GPIO              3   // comment out if not in use - don't use "0" here unless you mean GPIO=0 - mandatory for I2C devices on new boards
  #define USE_MAX17048                1   // use "0" to disable
  #define USE_SHT31                   1   // use "0" to disable
  #define USE_TSL2561                 1   // use "0" to disable
  #define SLEEP_TIME_S                180 // seconds - 180

  #define MOTION_ENABLED              1   // 1 to enable, 0 to disable
  #if (MOTION_ENABLED == 1)
    #define NUMBER_OF_MOTION_SENSORS  1 // number of PIR sensors
    uint8_t motion_sensors_gpio[NUMBER_OF_MOTION_SENSORS] =    // put here GPIO for each PIR, active HIGH (no pull down resistor needed for SR602)
    {
      7
    };
  #endif

  #pragma message "compilation for: esp32033-Living room"
// ---------------------------------------------------------------------------------------------------

#elif DEVICE_ID == 35
  #define ESPNOW_ENABLED              1 // 1-enable ESPnow, 0 or nothing - NO ESPnow capabilities

  #define SENSOR_TYPE                 2 // 0 = "env", 1 = "motion", 2 =  "env+mot"
  #define HOSTNAME                    "esp32035"
  #define DEVICE_NAME                 "Tailor"  // 15 characters maximum
  #define BOARD_TYPE                  2   // 1 = ESP32-S, 2 = ESP32-S2, 3 = ESP32-S3
  #define CHARGING_GPIO               39  // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define POWER_GPIO                  38  // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define ACT_BLUE_LED_GPIO           6   // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define ERROR_RED_LED_GPIO          5   // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define FW_UPGRADE_GPIO             4   // comment out if not in use - don't use "0" here unless you mean GPIO=0 - cannot be 8 or 9 on new boards if I2C used
  #define ENABLE_3V_GPIO              3   // comment out if not in use - don't use "0" here unless you mean GPIO=0 - mandatory for I2C devices on new boards
  #define USE_MAX17048                1   // use "0" to disable
  #define USE_SHT31                   1   // use "0" to disable
  #define USE_TSL2561                 1   // use "0" to disable
  #define SLEEP_TIME_S                180 // seconds - 180

  #define MOTION_ENABLED              1   // 1 to enable, 0 to disable
  #if (MOTION_ENABLED == 1)
    #define NUMBER_OF_MOTION_SENSORS  1 // number of PIR sensors
    uint8_t motion_sensors_gpio[NUMBER_OF_MOTION_SENSORS] =    // put here GPIO for each PIR, active HIGH (no pull down resistor needed for SR602)
    {
      7
    };
  #endif

  #pragma message "compilation for: esp32035-Tailor"
// ---------------------------------------------------------------------------------------------------

#elif DEVICE_ID == 36
  #define ESPNOW_ENABLED              1 // 1-enable ESPnow, 0 or nothing - NO ESPnow capabilities

  #define SENSOR_TYPE                 2 // 0 = "env", 1 = "motion", 2 =  "env+mot"
  #define HOSTNAME                    "esp32036"
  #define DEVICE_NAME                 "Milena"  // 15 characters maximum
  #define BOARD_TYPE                  2   // 1 = ESP32-S, 2 = ESP32-S2, 3 = ESP32-S3
  #define CHARGING_GPIO               39  // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define POWER_GPIO                  38  // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define ACT_BLUE_LED_GPIO           6   // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define ERROR_RED_LED_GPIO          5   // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define FW_UPGRADE_GPIO             2   // comment out if not in use - don't use "0" here unless you mean GPIO=0 - cannot be 8 or 9 on new boards if I2C used
  #define ENABLE_3V_GPIO              3   // comment out if not in use - don't use "0" here unless you mean GPIO=0 - mandatory for I2C devices on new boards
  #define USE_MAX17048                1   // use "0" to disable
  #define USE_SHT31                   1   // use "0" to disable
  #define USE_TSL2561                 1   // use "0" to disable
  #define SLEEP_TIME_S                120 // seconds - 180

  #define MOTION_ENABLED              1   // 1 to enable, 0 to disable
  #if (MOTION_ENABLED == 1)
    #define NUMBER_OF_MOTION_SENSORS  1 // number of PIR sensors
    uint8_t motion_sensors_gpio[NUMBER_OF_MOTION_SENSORS] =    // put here GPIO for each PIR, active HIGH (no pull down resistor needed for SR602)
    {
      7
    };
  #endif

  #pragma message "compilation for: esp32036-Lidia"
// ---------------------------------------------------------------------------------------------------


#elif DEVICE_ID == 37
  #define ESPNOW_ENABLED              1 // 1-enable ESPnow, 0 or nothing - NO ESPnow capabilities

  #define SENSOR_TYPE                 3 // 0 = "env", 1 = "motion", 2 =  "env+mot", 3 = "battery"
  #define HOSTNAME                    "esp32037"
  #define DEVICE_NAME                 "TRV1 Bedroom"  // 15 characters maximum
  #define BOARD_TYPE                  4   // 1 = ESP32-S, 2 = ESP32-S2, 3 = ESP32-S3, 4 = ESP32-C3
  #define FW_UPGRADE_GPIO             0   // comment out if not in use - don't use "0" here unless you mean GPIO=0 - cannot be 8 or 9 on new boards if I2C used
  #define USE_MAX17048                1   // use "0" to disable
  #define USE_SHT31                   0   // use "0" to disable
  #define USE_TSL2561                 0   // use "0" to disable
  #define SLEEP_TIME_S                1 * 3600 // seconds - 6 hours

  #define CHARGING_GPIO               6  // wire RED MCU,   wire YELLOW connector,    LED RED,    CHRG PIN7 on TP4056
  #define POWER_GPIO                  5  // wire BLACK MCU, wire WHITE  connector,    LED GREEN,  STDB PIN6 on TP4056
  // charging resistor: 5k1

  #pragma message "compilation for: esp32037-TRV1-Bedroom"
// ---------------------------------------------------------------------------------------------------


#elif DEVICE_ID == 38
  #define ESPNOW_ENABLED              1 // 1-enable ESPnow, 0 or nothing - NO ESPnow capabilities

  #define SENSOR_TYPE                 2 // 0 = "env", 1 = "motion", 2 =  "env+mot"
  #define HOSTNAME                    "esp32038"
  #define DEVICE_NAME                 "Toilet bedroom"  // 15 characters maximum
  #define BOARD_TYPE                  2   // 1 = ESP32-S, 2 = ESP32-S2, 3 = ESP32-S3
  #define CHARGING_GPIO               39  // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define POWER_GPIO                  38  // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define ACT_BLUE_LED_GPIO           6   // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define ERROR_RED_LED_GPIO          5   // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define FW_UPGRADE_GPIO             2   // comment out if not in use - don't use "0" here unless you mean GPIO=0 - cannot be 8 or 9 on new boards if I2C used
  #define ENABLE_3V_GPIO              3   // comment out if not in use - don't use "0" here unless you mean GPIO=0 - mandatory for I2C devices on new boards
  #define USE_MAX17048                1   // use "0" to disable
  #define USE_SHT31                   1   // use "0" to disable
  #define USE_TSL2561                 1   // use "0" to disable
  #define SLEEP_TIME_S                180 // seconds - 180

  #define MOTION_ENABLED              1   // 1 to enable, 0 to disable
  #if (MOTION_ENABLED == 1)
    #define NUMBER_OF_MOTION_SENSORS  1 // number of PIR sensors
    uint8_t motion_sensors_gpio[NUMBER_OF_MOTION_SENSORS] =    // put here GPIO for each PIR, active HIGH (no pull down resistor needed for SR602)
    {
      7
    };
  #endif

  #pragma message "compilation for: esp32038-Toilet bedroom"
// ---------------------------------------------------------------------------------------------------

#elif DEVICE_ID == 39
  #define ESPNOW_ENABLED              1 // 1-enable ESPnow, 0 or nothing - NO ESPnow capabilities

  #define SENSOR_TYPE                 1 // 0 = "env", 1 = "motion", 2 =  "env+mot"
  #define HOSTNAME                    "esp32039"
  #define DEVICE_NAME                 "Garage front m."  // 15 characters maximum
  #define BOARD_TYPE                  2   // 1 = ESP32-S, 2 = ESP32-S2, 3 = ESP32-S3
  #define CHARGING_GPIO               39  // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define POWER_GPIO                  38  // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define ACT_BLUE_LED_GPIO           6   // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define ERROR_RED_LED_GPIO          5   // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define FW_UPGRADE_GPIO             4   // comment out if not in use - don't use "0" here unless you mean GPIO=0 - cannot be 8 or 9 on new boards if I2C used
  #define ENABLE_3V_GPIO              3   // comment out if not in use - don't use "0" here unless you mean GPIO=0 - mandatory for I2C devices on new boards
  #define USE_MAX17048                1   // use "0" to disable
  #define USE_SHT31                   0   // use "0" to disable
  #define USE_TSL2561                 0   // use "0" to disable
  #define SLEEP_TIME_S                300 // seconds - 180

  #define MOTION_ENABLED              1   // 1 to enable, 0 to disable
  #if (MOTION_ENABLED == 1)
    #define NUMBER_OF_MOTION_SENSORS  1 // number of PIR sensors
    uint8_t motion_sensors_gpio[NUMBER_OF_MOTION_SENSORS] =    // put here GPIO for each PIR, active HIGH (no pull down resistor needed for SR602)
    {
      7
    };
  #endif
  #pragma message "compilation for: esp32039-Garage front m."
// ---------------------------------------------------------------------------------------------------

#elif DEVICE_ID == 41                 
  #define ESPNOW_ENABLED              1 // 1-enable ESPnow, 0 or nothing - NO ESPnow capabilities

  #define SENSOR_TYPE                 0 // 0 = "env", 1 = "motion", 2 =  "env+mot"
  #define HOSTNAME                    "esp32041"
  #define DEVICE_NAME                 "Thermocouple 1"  // 15 characters maximum
  #define BOARD_TYPE                  1   // 1 = ESP32-S, 2 = ESP32-S2, 3 = ESP32-S3
  #define FW_UPGRADE_GPIO             4   // comment out if not in use - don't use "0" here unless you mean GPIO=0 - cannot be 8 or 9 on new boards if I2C used
  #define SLEEP_TIME_S                15  // seconds - 
  #define ACT_BLUE_LED_GPIO           27   // comment out if not in use - don't use "0" here unless you mean GPIO=0
  // #define ERROR_RED_LED_GPIO          27   // comment out if not in use - don't use "0" here unless you mean GPIO=0


  #define USE_MAX17048                1   // use "0" to disable
  #define CUSTOM_SDA_GPIO             21
  #define CUSTOM_SCL_GPIO             22
  #define CHARGING_GPIO               23  // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define POWER_GPIO                  17  // comment out if not in use - don't use "0" here unless you mean GPIO=0
   

  #define ENABLE_3V_GPIO              32   // comment out if not in use - don't use "0" here unless you mean GPIO=0 - mandatory for I2C devices on new boards

  #define USE_MAX31855                1   // tested ONLY with ESP32S
  #define USE_MAX31855_DELAY_MS       200 // to avoid nan or 0
  #define MISO_GPIO                   19
  #define CLK_GPIO                    18
  #define CS_GPIO                     25 


  #pragma message "compilation for: esp32041-thermocouple01"
// ---------------------------------------------------------------------------------------------------


#elif DEVICE_ID == 42                 
  #define ESPNOW_ENABLED              1 // 1-enable ESPnow, 0 or nothing - NO ESPnow capabilities

  #define SENSOR_TYPE                 4 // 0 = "env", 1 = "motion", 2 =  "env+mot", 3 = battery, 4 = "push_b"
  #define HOSTNAME                    "esp32042"
  #define DEVICE_NAME                 "Button x6 desk"  // 15 characters maximum
  #define BOARD_TYPE                  2   // 1 = ESP32-S, 2 = ESP32-S2, 3 = ESP32-S3
  #define FW_UPGRADE_GPIO             8   // fake GPIO=1 was not working without pulling it down - changed to 8
  #define SLEEP_TIME_S                3600  // seconds - 
  #define ACT_BLUE_LED_GPIO           38   // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define ERROR_RED_LED_GPIO          37   // comment out if not in use - don't use "0" here unless you mean GPIO=0
  
  #define PUSH_BUTTONS                1   // PULL GPIO DOWN, ACTIVE HIGH as it is programmed like this in the hibernate()
  #define NUMBER_OF_BUTTONS           5   // 6
  uint8_t button_gpio[NUMBER_OF_BUTTONS] =  // put here the GPIO of push buttons
  {
    3,4,5,6,7         //,8    
  }; 
  uint8_t button_pressed = 0;               // 0 means: not pressed
                                            // 1 means: button_gpio[0] pressed, 2 means: button_gpio[1]
                                            // count from 1 not from 0 as 0 means not pressed
  // ADC usage
  #define USE_ADC                       1     // 1 - use, 0 -  don't use - it can be used for many purposes - not only battery measurements
  #if (USE_ADC ==1)
    #define BATTERY_FROM_ADC            1     //  to indicate MAX17048 is not in use but ADC, make 0 if ADC is used for other purpose (non battery)
    #define ADC_GPIO                    10    //  int: GPIO for ADC
    #define ADC_DIVIDER                 6.60f //4.255/0.678  float: adjust ADC - multiplication/resistors divider factor
    #define ADC_ATTEN                   0     //  int: 0, 2, 6, 11 db
    #define ADC_CALIBRATION             1.02f // difference between measured Volts and real volts on ADC_GPIO
  #endif
  // ADC usage END

  #pragma message "compilation for: esp32042-pushb_6x_desk"
// ---------------------------------------------------------------------------------------------------


#elif DEVICE_ID == 43                 
  #define ESPNOW_ENABLED              1 // 1-enable ESPnow, 0 or nothing - NO ESPnow capabilities

  #define SENSOR_TYPE                 0 // 0 = "env", 1 = "motion", 2 =  "env+mot"
  #define HOSTNAME                    "esp32043"
  #define DEVICE_NAME                 "Swimming pool"  // 15 characters maximum
  #define BOARD_TYPE                  2   // 1 = ESP32-S, 2 = ESP32-S2, 3 = ESP32-S3
  #define FW_UPGRADE_GPIO             1   // comment out if not in use - don't use "0" here unless you mean GPIO=0 - cannot be 8 or 9 on new boards if I2C used
  #define SLEEP_TIME_S                300  // seconds - 
  // #define ENABLE_3V_GPIO              8   // comment out if not in use - don't use "0" here unless you mean GPIO=0 - mandatory for I2C devices on new boards
  #define ACT_BLUE_LED_GPIO           37
  #define ERROR_RED_LED_GPIO          35

  #define USE_DALLAS_18B20            1
  #define OW_PIN                      10 // GPIO where the DS18B20 is connected to, OW=OneWire
  #define PARASITE_POWER              false //parasite power(2-wire) or direct (3-wire)
  #define COMMON_RES                  (DSTherm::RES_12_BIT) //9-12 bits resolution
  #define CONFIG_DS18S20_EXT_RES
  #define CALIBRATE_TEMPERATURE       0 
  // 28:AD:16:75:D0:1:3C:1  -> DS18B20

  #define USE_ST7735_160_80_ALI       1
  #define SCREEN_ROTATION             1
  #define LCD_LED_GPIO                6
  #define LCD_3V_GPIO                 8
  #define LCD_SCREEN_TIME_S           3
  #define POWER_SAVINGS_WIFI          1   // use 0 if not in use (WiFi)
  #define POWER_SAVINGS_CPU           1   // use 0 if not in use (PU freq)
  #define POWER_SAVINGS_CPU_TAIL_EXTRA_MS  450 // extra ending time due to slow CPU

  // ADC usage
  #define USE_ADC                       1     // 1 - use, 0 -  don't use - it can be used for many purposes - not only battery measurements
  #if (USE_ADC ==1)
    #define BATTERY_FROM_ADC            1     //  to indicate MAX17048 is not in use but ADC, make 0 if ADC is used for other purpose (non battery)
    #define ADC_GPIO                    9    //  int: GPIO for ADC
    #define ADC_DIVIDER                 (6.60f/1.017f) //  float: adjust ADC - multiplication/resistors divider factor
    #define ADC_ATTEN                   0     //  int: 0, 2, 6, 11 db
    #define ADC_CALIBRATION             1.02f // 1 // 0.793f // difference between measured Volts and real volts on ADC_GPIO
  #endif
  // ADC usage END  
  
  #pragma message "compilation for: esp32043"
// ---------------------------------------------------------------------------------------------------


#elif DEVICE_ID == 44
  #define ESPNOW_ENABLED              1 // 1-enable ESPnow, 0 or nothing - NO ESPnow capabilities

  #define SENSOR_TYPE                 1 // 0 = "env", 1 = "motion", 2 =  "env+mot"
  #define HOSTNAME                    "esp32044"
  #define DEVICE_NAME                 "Toilet down m."  // 15 characters maximum
  #define BOARD_TYPE                  2   // 1 = ESP32-S, 2 = ESP32-S2, 3 = ESP32-S3
  // #define CHARGING_GPIO               39  // comment out if not in use - don't use "0" here unless you mean GPIO=0
  // #define POWER_GPIO                  38  // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define ACT_BLUE_LED_GPIO           6   // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define ERROR_RED_LED_GPIO          5   // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define FW_UPGRADE_GPIO             2   // comment out if not in use - don't use "0" here unless you mean GPIO=0 - cannot be 8 or 9 on new boards if I2C used
  #define ENABLE_3V_GPIO              3   // comment out if not in use - don't use "0" here unless you mean GPIO=0 - mandatory for I2C devices on new boards
  #define USE_MAX17048                1   // use "0" to disable
  #define USE_SHT31                   0   // use "0" to disable
  #define USE_TSL2561                 0   // use "0" to disable
  #define SLEEP_TIME_S                3600 // seconds - 180

  #define MOTION_ENABLED              1   // 1 to enable, 0 to disable
  #if (MOTION_ENABLED == 1)
    #define NUMBER_OF_MOTION_SENSORS  1 // number of PIR sensors
    uint8_t motion_sensors_gpio[NUMBER_OF_MOTION_SENSORS] =    // put here GPIO for each PIR, active HIGH (no pull down resistor needed for SR602)
    {
      1
    };
  #endif
  #pragma message "compilation for: esp32044-Toilet down m."
// ---------------------------------------------------------------------------------------------------

#elif DEVICE_ID == 45
  #define ESPNOW_ENABLED              1 // 1-enable ESPnow, 0 or nothing - NO ESPnow capabilities
  #define SENSOR_TYPE                 0 // 0 = "env", 1 = "motion", 2 =  "env+mot"
  #define HOSTNAME                    "esp32045"  
  #define DEVICE_NAME                 "Toilet up 2"  // 15 characters maximum
  #define BOARD_TYPE                  3   // 1 = ESP32-S, 2 = ESP32-S2, 3 = ESP32-S3 // wemosS3mini
  #define FW_UPGRADE_GPIO             17   // comment out if not in use - don't use "0" here unless you mean GPIO=0 - cannot be 8 or 9 on new boards if I2C used
  #define ENABLE_3V_GPIO              3   // comment out if not in use - don't use "0" here unless you mean GPIO=0 - mandatory for I2C devices on new boards
  #define USE_MAX17048                0   // use "0" to disable
  #define USE_SHT31                   1   // use "0" to disable
  #define USE_TSL2561                 0   // use "0" to disable
  #define SLEEP_TIME_S                180   // seconds - 180

  #define CUSTOM_SDA_GPIO             1
  #define CUSTOM_SCL_GPIO             2

  #pragma message "compilation for: esp32045-toiletup2"
// ---------------------------------------------------------------------------------------------------


#elif DEVICE_ID == 46
  #define ESPNOW_ENABLED              1 // 1-enable ESPnow, 0 or nothing - NO ESPnow capabilities

  #define SENSOR_TYPE                 3 // 0 = "env", 1 = "motion", 2 =  "env+mot", 3 = "battery"
  #define HOSTNAME                    "esp32046"
  #define DEVICE_NAME                 "Garden LED L."  // 15 characters maximum
  #define BOARD_TYPE                  4   // 1 = ESP32-S, 2 = ESP32-S2, 3 = ESP32-S3, 4 = ESP32-C3
  #define FW_UPGRADE_GPIO             0   // comment out if not in use - don't use "0" here unless you mean GPIO=0 - cannot be 8 or 9 on new boards if I2C used
  #define USE_MAX17048                1   // use "0" to disable
  #define USE_SHT31                   0   // use "0" to disable
  #define USE_TSL2561                 0   // use "0" to disable
  #define SLEEP_TIME_S                900 // seconds - 6 hours

  #define CHARGING_GPIO               1  // wire RED MCU,   wire YELLOW connector,    LED RED,    CHRG PIN7 on TP4056
  #define POWER_GPIO                  2  // wire BLACK MCU, wire WHITE  connector,    LED GREEN,  STDB PIN6 on TP4056
  // charging resistor: 5k1
  
  #pragma message "compilation for: esp32046-garden LED l."
// ---------------------------------------------------------------------------------------------------


#elif DEVICE_ID == 47                 // WeAct Studio ESP32 C3 module
  #define ESPNOW_ENABLED              1 // 1-enable ESPnow, 0 or nothing - NO ESPnow capabilities

  #define SENSOR_TYPE                 2 // 0 = "env", 1 = "motion", 2 =  "env+mot", 3 = "battery"
  #define HOSTNAME                    "esp32047"
  #define DEVICE_NAME                 "Toilet down"  // 15 characters maximum
  #define BOARD_TYPE                  4   // 1 = ESP32-S, 2 = ESP32-S2, 3 = ESP32-S3, 4 = ESP32-C3

  #define ACT_BLUE_LED_GPIO           7   // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define ERROR_RED_LED_GPIO          10

  #define FW_UPGRADE_GPIO             0   // comment out if not in use - don't use "0" here unless you mean GPIO=0 - cannot be 8 or 9 on new boards if I2C used

  #define MINIMUM_VOLTS               3.4 // if measurement enabled - needed for weact module

  #define USE_MAX17048                0   // use "0" to disable
  #define USE_SHT31                   1   // use "0" to disable
  #define USE_TSL2561                 1   // use "0" to disable
  #define SLEEP_TIME_S                900   // seconds - 6 hours

  #define USE_ADC                     1     // 1 - use, 0 -  don't use - it can be used for many purposes - not only battery measurements
  #if (USE_ADC == 1)
    #define BATTERY_FROM_ADC          1     //  to indicate MAX17048 is not in use but ADC, make 0 if ADC is used for other purpose (non battery)
    #define ADC_GPIO                  3     //  int: GPIO for ADC
    #define ADC_DIVIDER               4.06f //resistors divider factor
    #define ADC_ATTEN                 11     //  int: 0 - check ranges in measure-volts-adc.h
    #define ADC_CALIBRATION           1.0f  // difference between measured Volts and real volts on ADC_GPIO - multiplicator
  #endif

  #define MOTION_ENABLED              1   // 1 to enable, 0 to disable
  #if (MOTION_ENABLED == 1)
    #define NUMBER_OF_MOTION_SENSORS  1 // number of PIR sensors
    uint8_t motion_sensors_gpio[NUMBER_OF_MOTION_SENSORS] =    // put here GPIO for each PIR, active HIGH (no pull down resistor needed for SR602)
    {
      5
    };
  #endif  

  #pragma message "compilation for: esp32047-Toilet down"
// ---------------------------------------------------------------------------------------------------


#elif DEVICE_ID == 49
  #define ESPNOW_ENABLED              1 // 1-enable ESPnow, 0 or nothing - NO ESPnow capabilities

  #define SENSOR_TYPE                 2 // 0 = "env", 1 = "motion", 2 =  "env+mot"
  #define HOSTNAME                    "esp32049"
  #define DEVICE_NAME                 "Kitchen"  // 15 characters maximum
  #define BOARD_TYPE                  2   // 1 = ESP32-S, 2 = ESP32-S2, 3 = ESP32-S3
  #define CHARGING_GPIO               39  // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define POWER_GPIO                  38  // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define ACT_BLUE_LED_GPIO           6   // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define ERROR_RED_LED_GPIO          5   // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define FW_UPGRADE_GPIO             4   // comment out if not in use - don't use "0" here unless you mean GPIO=0 - cannot be 8 or 9 on new boards if I2C used
  #define ENABLE_3V_GPIO              3   // comment out if not in use - don't use "0" here unless you mean GPIO=0 - mandatory for I2C devices on new boards
  #define USE_MAX17048                1   // use "0" to disable
  #define USE_SHT31                   1   // use "0" to disable
  #define USE_TSL2561                 1   // use "0" to disable
  #define SLEEP_TIME_S                180 // seconds - 180

  #define MOTION_ENABLED              1   // 1 to enable, 0 to disable
  #if (MOTION_ENABLED == 1)
    #define NUMBER_OF_MOTION_SENSORS  1 // number of PIR sensors
    uint8_t motion_sensors_gpio[NUMBER_OF_MOTION_SENSORS] =    // put here GPIO for each PIR, active HIGH (no pull down resistor needed for SR602)
    {
      1
    };
  #endif

  #pragma message "compilation for: esp32049-Kitchen"
// ---------------------------------------------------------------------------------------------------



#elif DEVICE_ID == 50
  #define ESPNOW_ENABLED              1 // 1-enable ESPnow, 0 or nothing - NO ESPnow capabilities

  #define SENSOR_TYPE                 3 // 0 = "env", 1 = "motion", 2 =  "env+mot", 3 = "battery"
  #define HOSTNAME                    "esp32050"
  #define DEVICE_NAME                 "Garden LED R."  // 15 characters maximum
  #define BOARD_TYPE                  4   // 1 = ESP32-S, 2 = ESP32-S2, 3 = ESP32-S3, 4 = ESP32-C3
  #define FW_UPGRADE_GPIO             0   // comment out if not in use - don't use "0" here unless you mean GPIO=0 - cannot be 8 or 9 on new boards if I2C used
  #define USE_MAX17048                1   // use "0" to disable
  #define USE_SHT31                   0   // use "0" to disable
  #define USE_TSL2561                 0   // use "0" to disable
  #define SLEEP_TIME_S                900 // seconds - 6 hours

  #define CHARGING_GPIO               1  // wire RED MCU,   wire YELLOW connector,    LED RED,    CHRG PIN7 on TP4056
  #define POWER_GPIO                  2  // wire BLACK MCU, wire WHITE  connector,    LED GREEN,  STDB PIN6 on TP4056
  // charging resistor: 5k1
  
  #pragma message "compilation for: esp32050-garden LED r."
// ---------------------------------------------------------------------------------------------------



#elif DEVICE_ID == 51
  #define ESPNOW_ENABLED              1 // 1-enable ESPnow, 0 or nothing - NO ESPnow capabilities
  #define SENSOR_TYPE                 0 // 0 = "env", 1 = "motion", 2 =  "env+mot"
  #define HOSTNAME                    "esp32051"
  #define DEVICE_NAME                 "Solar Front 1"  // 15 characters maximum
  #define BOARD_TYPE                  2   // 1 = ESP32-S, 2 = ESP32-S2, 3 = ESP32-S3
  #define CHARGING_GPIO               38  // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define POWER_GPIO                  39  // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define ACT_BLUE_LED_GPIO           6   // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define ERROR_RED_LED_GPIO          5   // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define FW_UPGRADE_GPIO             2   // comment out if not in use - don't use "0" here unless you mean GPIO=0 - cannot be 8 or 9 on new boards if I2C used
  // #define MOTION_SENSOR_GPIO          1   // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define ENABLE_3V_GPIO              3   // comment out if not in use - don't use "0" here unless you mean GPIO=0 - mandatory for I2C devices on new boards
  #define USE_MAX17048                1   // use "0" to disable
  #define USE_SHT31                   0   // use "0" to disable
  #define USE_TSL2561                 1   // use "0" to disable
  #define SLEEP_TIME_S                180   // seconds - 180

  // for INA260
  #define USE_INA260                  1   // current/volts/power measurement
  #define INA_260_MEAS_COUNT          INA260_COUNT_1024 // INA260_COUNT_1 // INA260_COUNT_1024 //  INA260_COUNT_64
  #define INA_260_MEAS_TIME           INA260_TIME_8_244_ms //INA260_TIME_140_us // INA260_TIME_8_244_ms // INA260_TIME_1_1_ms //INA260_TIME_8_244_ms


  // #define CALIBRATE_TEMPERATURE       0   // fine tuning, positive if sensor shows too low, negative if sensor shows too high
  // #define CALIBRATE_HUMIDITY          0   // fine tuning, positive if sensor shows too low, negative if sensor shows too high

  // // for LoRa
  // #define LORA_ENABLED                0 // 1-enable LoRa, 0 or nothing - NO LoRa capabilities
  // #define LORA_GPIO_ENABLE_3V         19   // comment out if not in use - don't use "0" here unless you mean GPIO=0 - mandatory for I2C devices on new boards
  // #define LORA_GPIO_MISO              20  // - BLUE
  // #define LORA_GPIO_MOSI              17  // - GREEN
  // #define LORA_GPIO_CLOCK             18  // - BROWN
  // #define LORA_GPIO_SS                14  // - YELLOW, SS/NSS/CS:
  // #define LORA_GPIO_RST               15  // - ORANGE
  // #define LORA_GPIO_DIO0              16  // - VIOLET

  #pragma message "compilation for: esp32051-Solar Front 1"
// ---------------------------------------------------------------------------------------------------


#elif DEVICE_ID == 55
  #define ESPNOW_ENABLED              1 // 1-enable ESPnow, 0 or nothing - NO ESPnow capabilities

  #define SENSOR_TYPE                 3 // 0 = "env", 1 = "motion", 2 =  "env+mot", 3 = "battery"
  #define HOSTNAME                    "esp32055"
  #define DEVICE_NAME                 "TRV3 Toilet up"  // 15 characters maximum
  #define BOARD_TYPE                  4   // 1 = ESP32-S, 2 = ESP32-S2, 3 = ESP32-S3, 4 = ESP32-C3
  #define FW_UPGRADE_GPIO             0   // comment out if not in use - don't use "0" here unless you mean GPIO=0 - cannot be 8 or 9 on new boards if I2C used
  #define USE_MAX17048                1   // use "0" to disable
  #define USE_SHT31                   0   // use "0" to disable
  #define USE_TSL2561                 0   // use "0" to disable
  #define SLEEP_TIME_S                1 * 3600 // seconds - 6 hours

  #define CHARGING_GPIO               6  // wire RED MCU,   wire YELLOW connector,    LED RED,    CHRG PIN7 on TP4056
  #define POWER_GPIO                  5  // wire BLACK MCU, wire WHITE  connector,    LED GREEN,  STDB PIN6 on TP4056
  // charging resistor: 5k1

  #pragma message "compilation for: esp32055-TRV3-toilet-up"
// ---------------------------------------------------------------------------------------------------


#elif DEVICE_ID == 56
  #define ESPNOW_ENABLED              1 // 1-enable ESPnow, 0 or nothing - NO ESPnow capabilities

  #define SENSOR_TYPE                 3 // 0 = "env", 1 = "motion", 2 =  "env+mot", 3 = "battery"
  #define HOSTNAME                    "esp32056"
  #define DEVICE_NAME                 "TRV7 Tailor"  // 15 characters maximum
  #define BOARD_TYPE                  4   // 1 = ESP32-S, 2 = ESP32-S2, 3 = ESP32-S3, 4 = ESP32-C3
  #define FW_UPGRADE_GPIO             0   // comment out if not in use - don't use "0" here unless you mean GPIO=0 - cannot be 8 or 9 on new boards if I2C used
  #define USE_MAX17048                1   // use "0" to disable
  #define USE_SHT31                   0   // use "0" to disable
  #define USE_TSL2561                 0   // use "0" to disable
  #define SLEEP_TIME_S                1 * 3600 // seconds - 6 hours

  #define CHARGING_GPIO               6  // wire RED MCU,   wire YELLOW connector,    LED RED,    CHRG PIN7 on TP4056
  #define POWER_GPIO                  5  // wire BLACK MCU, wire WHITE  connector,    LED GREEN,  STDB PIN6 on TP4056
  // charging resistor: 5k1
  
  #pragma message "compilation for: esp32056-TRV7-tailor"
// ---------------------------------------------------------------------------------------------------


#elif DEVICE_ID == 100
  #define ESPNOW_ENABLED              1 // 1-enable ESPnow, 0 or nothing - NO ESPnow capabilities
  
  #define SENSOR_TYPE                 2 // 0 = "env", 1 = "motion", 2 =  "env+mot"
  #define HOSTNAME                    "esp32100"
  #define DEVICE_NAME                 "Office"  // 15 characters maximum
  #define BOARD_TYPE                  2   // 1 = ESP32-S, 2 = ESP32-S2, 3 = ESP32-S3
  #define CHARGING_GPIO               39  // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define POWER_GPIO                  38  // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define ACT_BLUE_LED_GPIO           6   // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define ERROR_RED_LED_GPIO          5   // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define FW_UPGRADE_GPIO             4   // comment out if not in use - don't use "0" here unless you mean GPIO=0 - cannot be 8 or 9 on new boards if I2C used
  #define ENABLE_3V_GPIO              3   // comment out if not in use - don't use "0" here unless you mean GPIO=0 - mandatory for I2C devices on new boards
  #define USE_MAX17048                1   // use "0" to disable
  #define USE_SHT31                   1   // use "0" to disable
  #define USE_TSL2561                 1   // use "0" to disable
  #define SLEEP_TIME_S                180 // seconds - 180

  #define MOTION_ENABLED              1   // 1 to enable, 0 to disable
  #if (MOTION_ENABLED == 1)
    #define NUMBER_OF_MOTION_SENSORS  2 // number of PIR sensors
    uint8_t motion_sensors_gpio[NUMBER_OF_MOTION_SENSORS] =    // put here GPIO for each PIR, active HIGH (no pull down resistor needed for SR602)
    {
      7,15
    };
  #endif

  #pragma message "compilation for: esp32100-Office"
// ---------------------------------------------------------------------------------------------------

#elif DEVICE_ID == 101
  // measured current: 38.45uA without PIR (switch OFF)
  #define ESPNOW_ENABLED              1 // 1-enable ESPnow, 0 or nothing - NO ESPnow capabilities

  #define SENSOR_TYPE                 2 // 0 = "env", 1 = "motion", 2 =  "env+mot"
  #define HOSTNAME                    "esp32101"
  #define DEVICE_NAME                 "Dining"  // 15 characters maximum
  #define BOARD_TYPE                  2   // 1 = ESP32-S, 2 = ESP32-S2, 3 = ESP32-S3
  #define CHARGING_GPIO               39  // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define POWER_GPIO                  38  // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define ACT_BLUE_LED_GPIO           6   // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define ERROR_RED_LED_GPIO          5   // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define FW_UPGRADE_GPIO             4   // comment out if not in use - don't use "0" here unless you mean GPIO=0 - cannot be 8 or 9 on new boards if I2C used
  #define ENABLE_3V_GPIO              3   // comment out if not in use - don't use "0" here unless you mean GPIO=0 - mandatory for I2C devices on new boards
  #define USE_MAX17048                1   // use "0" to disable
  #define USE_SHT31                   1   // use "0" to disable
  #define USE_TSL2561                 1   // use "0" to disable
  #define SLEEP_TIME_S                180 // seconds - 180

  #define MOTION_ENABLED              1   // 1 to enable, 0 to disable
  #if (MOTION_ENABLED == 1)
    #define NUMBER_OF_MOTION_SENSORS  1 // number of PIR sensors
    uint8_t motion_sensors_gpio[NUMBER_OF_MOTION_SENSORS] =    // put here GPIO for each PIR, active HIGH (no pull down resistor needed for SR602)
    {
      7
    };
  #endif

  #pragma message "compilation for: esp32101-Dining"
// ---------------------------------------------------------------------------------------------------

#elif DEVICE_ID == 102
  #define ESPNOW_ENABLED              1 // 1-enable ESPnow, 0 or nothing - NO ESPnow capabilities

  #define SENSOR_TYPE                 2 // 0 = "env", 1 = "motion", 2 =  "env+mot"
  #define HOSTNAME                    "esp32102"
  #define DEVICE_NAME                 "Toilet up"  // 15 characters maximum
  #define BOARD_TYPE                  2   // 1 = ESP32-S, 2 = ESP32-S2, 3 = ESP32-S3
  #define CHARGING_GPIO               39  // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define POWER_GPIO                  38  // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define ACT_BLUE_LED_GPIO           6   // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define ERROR_RED_LED_GPIO          5   // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define FW_UPGRADE_GPIO             2   // comment out if not in use - don't use "0" here unless you mean GPIO=0 - cannot be 8 or 9 on new boards if I2C used
  #define ENABLE_3V_GPIO              3   // comment out if not in use - don't use "0" here unless you mean GPIO=0 - mandatory for I2C devices on new boards
  #define USE_MAX17048                1   // use "0" to disable
  #define USE_SHT31                   1   // use "0" to disable
  #define USE_TSL2561                 1   // use "0" to disable
  #define SLEEP_TIME_S                180 // seconds - 180

  #define MOTION_ENABLED              1   // 1 to enable, 0 to disable
  #if (MOTION_ENABLED == 1)
    #define NUMBER_OF_MOTION_SENSORS  1 // number of PIR sensors
    uint8_t motion_sensors_gpio[NUMBER_OF_MOTION_SENSORS] =    // put here GPIO for each PIR, active HIGH (no pull down resistor needed for SR602)
    {
      1
    };
  #endif

  #pragma message "compilation for: esp32102-ToiletUp"
// ---------------------------------------------------------------------------------------------------


#elif DEVICE_ID == 104
  #define ESPNOW_ENABLED              1 // 1-enable ESPnow, 0 or nothing - NO ESPnow capabilities

  #define SENSOR_TYPE                 2 // 0 = "env", 1 = "motion", 2 =  "env+mot"
  #define HOSTNAME                    "esp32104"
  #define DEVICE_NAME                 "Kids"  // 15 characters maximum
  #define BOARD_TYPE                  2   // 1 = ESP32-S, 2 = ESP32-S2, 3 = ESP32-S3
  #define CHARGING_GPIO               39  // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define POWER_GPIO                  38  // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define ACT_BLUE_LED_GPIO           6   // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define ERROR_RED_LED_GPIO          5   // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define FW_UPGRADE_GPIO             2   // comment out if not in use - don't use "0" here unless you mean GPIO=0 - cannot be 8 or 9 on new boards if I2C used
  #define ENABLE_3V_GPIO              3   // comment out if not in use - don't use "0" here unless you mean GPIO=0 - mandatory for I2C devices on new boards
  #define USE_MAX17048                1   // use "0" to disable
  #define USE_SHT31                   1   // use "0" to disable
  #define USE_TSL2561                 1   // use "0" to disable
  #define SLEEP_TIME_S                180 // seconds - 180

  #define MOTION_ENABLED              1   // 1 to enable, 0 to disable
  #if (MOTION_ENABLED == 1)
    #define NUMBER_OF_MOTION_SENSORS  1 // number of PIR sensors
    uint8_t motion_sensors_gpio[NUMBER_OF_MOTION_SENSORS] =    // put here GPIO for each PIR, active HIGH (no pull down resistor needed for SR602)
    {
      1
    };
  #endif

  #pragma message "compilation for: esp32104-Milena"
// ---------------------------------------------------------------------------------------------------

#elif DEVICE_ID == 105
  #define ESPNOW_ENABLED              1 // 1-enable ESPnow, 0 or nothing - NO ESPnow capabilities

  #define SENSOR_TYPE                 0 // 0 = "env", 1 = "motion", 2 =  "env+mot"
  #define HOSTNAME                    "esp32105"
  #define DEVICE_NAME                 "Garden"  // 15 characters maximum
  #define BOARD_TYPE                  2   // 1 = ESP32-S, 2 = ESP32-S2, 3 = ESP32-S3
  #define CHARGING_GPIO               39  // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define POWER_GPIO                  38  // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define ACT_BLUE_LED_GPIO           6   // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define ERROR_RED_LED_GPIO          5   // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define FW_UPGRADE_GPIO             4   // comment out if not in use - don't use "0" here unless you mean GPIO=0 - cannot be 8 or 9 on new boards if I2C used
  #define ENABLE_3V_GPIO              3   // comment out if not in use - don't use "0" here unless you mean GPIO=0 - mandatory for I2C devices on new boards
  #define USE_MAX17048                1   // use "0" to disable
  #define USE_SHT31                   1   // use "0" to disable
  #define USE_TSL2561                 1   // use "0" to disable
  #define SLEEP_TIME_S                180 // seconds - 180

  #define CALIBRATE_TEMPERATURE       0   // fine tuning, positive if sensor shows too low, negative if sensor shows too high
  #define CALIBRATE_HUMIDITY          -5   // fine tuning, positive if sensor shows too low, negative if sensor shows too high


  #pragma message "compilation for: esp32105-Garden"
// ---------------------------------------------------------------------------------------------------


// ************************************* C L I E N T S ***********************************************


#elif DEVICE_ID == 83
  #define ESPNOW_ENABLED              1 // 1-enable ESPnow, 0 or nothing - NO ESPnow capabilities

  #define SENSOR_TYPE                 2 // 0 = "env", 1 = "motion", 2 =  "env+mot", 3 = "battery"
  #define HOSTNAME                    "esp32083"
  #define DEVICE_NAME                 "weact_testC3"  // 15 characters maximum
  #define BOARD_TYPE                  4   // 1 = ESP32-S, 2 = ESP32-S2, 3 = ESP32-S3, 4 = ESP32-C3

  // // built-in LED on GPIO8 works fine as active (inverted), but DOES NOT work during upgrade and CP, don't use PWM here
  // #define ACT_BLUE_LED_GPIO           8   // comment out if not in use - don't use "0" here unless you mean GPIO=0
  // #define ACT_BLUE_LED_GPIO_USE_PWM   0
  // #define ACT_BLUE_LED_INVERTED       1

  // // any other GPIO works fine during upgrade and CP
  // #define ERROR_RED_LED_GPIO          1   // comment out if not in use - don't use "0" here unless you mean GPIO=0
  // #define ERROR_RED_LED_GPIO_USE_PWM  1

    // best option: ext LED as blue:
  #define ACT_BLUE_LED_GPIO           7   // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define ERROR_RED_LED_GPIO          10

  // only GPIO 0-5 work as RTC!
  #define FW_UPGRADE_GPIO             0   // comment out if not in use - don't use "0" here unless you mean GPIO=0 - cannot be 8 or 9 on new boards if I2C used
  // #define FW_UPGRADE_GPIO_ACTIVE      1   // 1=HIGH, 0=LOW (default is HIGH if not defined here)  - cannot be LOW if Motion or PUSH button in use

  // #define ENABLE_3V_GPIO              1  // it actually not needed
  #define MINIMUM_VOLTS               3.4 // if measurement enabled - needed for weact module

  // default for C3 is SDA=8 SCL=9 and so far it is ok
  // #define CUSTOM_SDA_GPIO   
  // #define CUSTOM_SCL_GPIO      

  #define USE_MAX17048                0   // use "0" to disable
  #define USE_SHT31                   1   // use "0" to disable
  #define USE_TSL2561                 1   // use "0" to disable
  #define SLEEP_TIME_S                300   // seconds - 6 hours

  // ADC usage
  #define USE_ADC                     1     // 1 - use, 0 -  don't use - it can be used for many purposes - not only battery measurements
  #if (USE_ADC == 1)
    #define BATTERY_FROM_ADC          1     //  to indicate MAX17048 is not in use but ADC, make 0 if ADC is used for other purpose (non battery)
    #define ADC_GPIO                  3     //  int: GPIO for ADC
    #define ADC_DIVIDER               4.06f //resistors divider factor
    #define ADC_ATTEN                 11     //  int: 0 - check ranges in measure-volts-adc.h
    #define ADC_CALIBRATION           1.0f  // difference between measured Volts and real volts on ADC_GPIO - multiplicator
  #endif
  // ADC usage END

  #define MOTION_ENABLED              1   // 1 to enable, 0 to disable
  #if (MOTION_ENABLED == 1)
    #define NUMBER_OF_MOTION_SENSORS  1 // number of PIR sensors
    uint8_t motion_sensors_gpio[NUMBER_OF_MOTION_SENSORS] =    // put here GPIO for each PIR, active HIGH (no pull down resistor needed for SR602)
    {
      5
    };
  #endif  

  #pragma message "compilation for: esp32083-WeAct Studio ESP32 C3"
// ---------------------------------------------------------------------------------------------------


#elif DEVICE_ID == 95                 // wemosS3mini with RX/TX
  #define ESPNOW_ENABLED              1 // 1-enable ESPnow, 0 or nothing - NO ESPnow capabilities
  #define SENSOR_TYPE                 0 // 0 = "env", 1 = "motion", 2 =  "env+mot"
  #define HOSTNAME                    "esp32095"
  #define DEVICE_NAME                 "wemosS3mini"  // 15 characters maximum
  #define BOARD_TYPE                  3   // 1 = ESP32-S, 2 = ESP32-S2, 3 = ESP32-S3
  #define FW_UPGRADE_GPIO             17   // comment out if not in use - don't use "0" here unless you mean GPIO=0 - cannot be 8 or 9 on new boards if I2C used
  #define SLEEP_TIME_S                10   // seconds - 180

  #pragma message "compilation for: esp32095-test"
// ---------------------------------------------------------------------------------------------------

#elif DEVICE_ID == 96                 // wemosS3mini with CDC/USB
  #define ESPNOW_ENABLED              1 // 1-enable ESPnow, 0 or nothing - NO ESPnow capabilities
  #define SENSOR_TYPE                 0 // 0 = "env", 1 = "motion", 2 =  "env+mot"
  #define HOSTNAME                    "esp32096"
  #define DEVICE_NAME                 "wemosS3miniUSB"  // 15 characters maximum
  #define BOARD_TYPE                  3   // 1 = ESP32-S, 2 = ESP32-S2, 3 = ESP32-S3
  #define FW_UPGRADE_GPIO             0   // on every S3, GPIO0 is pulled up internally
  #define FW_UPGRADE_GPIO_ACTIVE      0   // so LOW will not trigger upgrade
  #define SLEEP_TIME_S                5   // seconds - 180

  #pragma message "compilation for: esp32096-test"
// ---------------------------------------------------------------------------------------------------


#elif DEVICE_ID == 94
  #define ESPNOW_ENABLED              1 // 1-enable ESPnow, 0 or nothing - NO ESPnow capabilities

  #define SENSOR_TYPE                 0 // 0 = "env", 1 = "motion", 2 =  "env+mot", 3 = "battery"
  #define HOSTNAME                    "esp32094"
  #define DEVICE_NAME                 "C3_test"  // 15 characters maximum
  #define BOARD_TYPE                  4   // 1 = ESP32-S, 2 = ESP32-S2, 3 = ESP32-S3, 4 = ESP32-C3
  #define FW_UPGRADE_GPIO             0   // comment out if not in use - don't use "0" here unless you mean GPIO=0 - cannot be 8 or 9 on new boards if I2C used
  #define USE_MAX17048                1   // use "0" to disable
  #define USE_SHT31                   1   // use "0" to disable
  #define USE_TSL2561                 0   // use "0" to disable
  #define SLEEP_TIME_S                10 // seconds - 6 hours

  #define ENABLE_3V_GPIO              7 
  #define CHARGING_GPIO               6  // wire RED MCU,   wire YELLOW connector,    LED RED,    CHRG PIN7 on TP4056
  #define POWER_GPIO                  5  // wire BLACK MCU, wire WHITE  connector,    LED GREEN,  STDB PIN6 on TP4056
  // charging resistor: 5k1

  // #define ACT_BLUE_LED_GPIO           8
  #define CUSTOM_SDA_GPIO             18
  #define CUSTOM_SCL_GPIO             19
  
  #pragma message "compilation for: esp32094-C3_test"
// ---------------------------------------------------------------------------------------------------


#elif DEVICE_ID == 93                 // S3 bare board with CDC USB OTG
  #define ESPNOW_ENABLED              1 // 1-enable ESPnow, 0 or nothing - NO ESPnow capabilities
  #define SENSOR_TYPE                 0 // 0 = "env", 1 = "motion", 2 =  "env+mot", 3 = battery, 4 = "push_b"
  #define HOSTNAME                    "esp32093"
  #define DEVICE_NAME                 "s3093cdc"  // 15 characters maximum
  #define BOARD_TYPE                  3     // 1 = ESP32-S, 2 = ESP32-S2, 3 = ESP32-S3
  #define FW_UPGRADE_GPIO             2     // comment out if not in use - don't use "0" here unless you mean GPIO=0 - cannot be 8 or 9 on new boards if I2C used
  #define SLEEP_TIME_S                10    // seconds - 
  #define DONE_GPIO                   9
  #define CUSTOM_SDA_GPIO             1
  #define CUSTOM_SCL_GPIO             4

  // #define PPK2_GPIO                   17    // comment out if not used - GPIO to test power and timings using PPK2 - for C3 GPIO 33 is out of range

  #pragma message "compilation for: esp32093"
// ---------------------------------------------------------------------------------------------------


// my black PCB
#elif DEVICE_ID == 82
  #define ESPNOW_ENABLED              1 // 1-enable ESPnow, 0 or nothing - NO ESPnow capabilities

  #define SENSOR_TYPE                 0 // 0 = "env", 1 = "motion", 2 =  "env+mot"
  #define HOSTNAME                    "esp32082"
  #define DEVICE_NAME                 "82S2test"  // 15 characters maximum
  #define BOARD_TYPE                  2   // 1 = ESP32-S, 2 = ESP32-S2, 3 = ESP32-S3, 4 - C3
  // #define CHARGING_GPIO               39  // comment out if not in use - don't use "0" here unless you mean GPIO=0
  // #define POWER_GPIO                  38  // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define ACT_BLUE_LED_GPIO           6   // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define ACT_BLUE_LED_GPIO_USE_PWM   1
  #define ERROR_RED_LED_GPIO          5   // comment out if not in use - don't use "0" here unless you mean GPIO=0
  #define ERROR_RED_LED_GPIO_USE_PWM  1

  #define FW_UPGRADE_GPIO             4   // comment out if not in use - don't use "0" here unless you mean GPIO=0 - cannot be 8 or 9 on new boards if I2C used
  // #define FW_UPGRADE_GPIO_ACTIVE      0
  
  #define ENABLE_3V_GPIO              3   // comment out if not in use - don't use "0" here unless you mean GPIO=0 - mandatory for I2C devices on new boards
  #define USE_MAX17048                1   // use "0" to disable
  #define USE_SHT31                   0   // use "0" to disable
  #define USE_TSL2561                 1   // use "0" to disable
  #define SLEEP_TIME_S                15 // seconds - 180

  #define CALIBRATE_TEMPERATURE       0   // fine tuning, positive if sensor shows too low, negative if sensor shows too high
  #define CALIBRATE_HUMIDITY          0   // fine tuning, positive if sensor shows too low, negative if sensor shows too high

  #define MOTION_ENABLED              0   // 1 to enable, 0 to disable
  #if (MOTION_ENABLED == 1)
    #define NUMBER_OF_MOTION_SENSORS  1 // number of PIR sensors
    uint8_t motion_sensors_gpio[NUMBER_OF_MOTION_SENSORS] =    // put here GPIO for each PIR, active HIGH (no pull down resistor needed for SR602)
    {
      4
    };
  #endif

  // #define DONE_GPIO                   7

  #pragma message "compilation for: esp32082-82S2test"

// ---------------------------------------------------------------------------------------------------



#else
  #error "Wrong DEVICE_ID chosen"
#endif

// =============================================== common parameters =============================================== 
#if (PUSH_BUTTONS == 1) and (BOARD_TYPE == 4)
  #error "push buttons board not yet defined for ESP32-C3"
#endif

// only 1 temperature sensor
#if ((USE_MAX31855 == 1) and (USE_SHT31 == 1)) or ((USE_MAX31855 == 1) and (USE_DALLAS_18B20 == 1)) or ((USE_DALLAS_18B20 == 1) and (USE_SHT31 == 1))
  #error "only 1 temperature sensor can be defined - choose USE_SHT31 or USE_MAX31855 or USE_DALLAS_18B20"
#endif

// only 1 way of measuring battery
#if ((BATTERY_FROM_ADC == 1) and (USE_MAX17048 == 1))
  #error "only 1 battery sensor can be defined - BATTERY_FROM_ADC USE_SHT31 or USE_MAX17048" 
#endif

#ifdef ACT_BLUE_LED_GPIO
  // check if PWM is defined, i.e. = 0
  #ifndef ACT_BLUE_LED_GPIO_USE_PWM
    #define ACT_BLUE_LED_GPIO_USE_PWM   1
  #endif 
  #ifndef ACT_BLUE_LED_INVERTED
    #define ACT_BLUE_LED_INVERTED 0
  #endif
#endif

#ifdef ERROR_RED_LED_GPIO
  // check if PWM is defined, i.e. = 0
  #ifndef ERROR_RED_LED_GPIO_USE_PWM
    #define ERROR_RED_LED_GPIO_USE_PWM  1
  #endif 
  #ifndef ERROR_RED_LED_INVERTED
    #define ERROR_RED_LED_INVERTED 0
  #endif
#endif

#if (defined ACT_BLUE_LED_GPIO) and (defined ERROR_RED_LED_GPIO)
  #if (ACT_BLUE_LED_GPIO == ERROR_RED_LED_GPIO)
    #error "DON'T use the same GPIO for ACT_BLUE_LED_GPIO and ERROR_RED_LED_GPIO as they cancel each other inside program!"
  #endif
#endif

#ifndef MINIMUM_VOLTS
   #define MINIMUM_VOLTS               3.3 // device is going to forced sleep to conserve battery
#endif 

#ifndef COOLING_SLEEP_DURATION_S
    #define COOLING_SLEEP_DURATION_S    30  // seconds - 30
#endif
// common parameters END

// assigning MODEL and checking if proper board is selected
#ifndef BOARD_TYPE
  #error BOARD_TYPE not defined
#else
  #if (BOARD_TYPE == 1)
    #define MODEL "ESP32"
    #define ESP32_BOOT_TIME           470//350      // since power ON to GPIO ON, ms
    #define ESP32_TAIL_TIME           15      // since GPIO OFF to power OFF, ms
    #define ESP32_BOOT_TIME_EXTRA     20     // +180ms from power ON or hard reset    #ifdef PRINT_COMPILER_MESSAGES
    #ifdef PRINT_COMPILER_MESSAGES
      #pragma message "chosen BOARD_TYPE = ESP32"
    #endif
    // automatic adjustment of ADC_BITS
    #define ADC_BITS                  12  

  #elif (BOARD_TYPE == 2)
    #define MODEL "ESP32S2"
    #define ESP32_BOOT_TIME           35      // since power ON to GPIO ON, ms
    #define ESP32_TAIL_TIME           30      // since GPIO OFF to power OFF, ms
    #define ESP32_BOOT_TIME_EXTRA     180     // +180ms from power ON or hard reset
    #ifdef PRINT_COMPILER_MESSAGES
      #pragma message "chosen BOARD_TYPE = ESP32S2"
    #endif
    // automatic adjustment of ADC_BITS
    #define ADC_BITS                  13  

  #elif (BOARD_TYPE == 3)             //   measured with GPIO on S3 bare module
    #define MODEL "ESP32S3"
    #define ESP32_BOOT_TIME           50     // since power ON to GPIO ON, ms
    #define ESP32_TAIL_TIME           40     // since saving last time till OFF board
    #define ESP32_BOOT_TIME_EXTRA     200    // +150ms from power ON or hard reset - guestimated
    #ifdef PRINT_COMPILER_MESSAGES
      #pragma message "chosen BOARD_TYPE = ESP32S3"
    #endif
    // automatic adjustment of ADC_BITS
    #define ADC_BITS                  13  

  #elif (BOARD_TYPE == 4)
    #define MODEL "ESP32C3"
    #define ESP32_BOOT_TIME           30      // since power ON to GPIO ON, ms
    #define ESP32_TAIL_TIME           10      // since GPIO OFF to power OFF, ms
    #define ESP32_BOOT_TIME_EXTRA     155     // +150ms from power ON or hard reset
    #ifdef PRINT_COMPILER_MESSAGES
      #pragma message "chosen BOARD_TYPE = ESP32C3"
    #endif
    // automatic adjustment of ADC_BITS
    #define ADC_BITS                  12  

  #else
    #error BOARD_TYPE not defined
  #endif
#endif
// assigning MODEL and checking if proper board is selected END


// SENSOR_TYPE defines what is to be sent to GW and what should wake up sensor device
#if (SENSOR_TYPE == 0)
  #if (MOTION_ENABLED == 1)
    #warning "SENSOR_TYPE=0 (env) should not have MOTION_ENABLED defined - removing it"
    #undef MOTION_ENABLED
  #endif
#endif

// don't allow compiling if not provided MOTION_SENSOR_GPIO
#if (SENSOR_TYPE == 1) or (SENSOR_TYPE == 2)
  #if (MOTION_ENABLED != 1)
    #error "MOTION_ENABLED not defined but sensor type includes motion"
  #endif
#endif

#if (TOUCHPAD_ONLY == 1) and (BOARD_TYPE != 1)
  #error "TOUCHPAD_ONLY works (now) only with ESP32"
#endif

// no motion for push buttons sensor because during cooling time, push buttons would not work
#if (SENSOR_TYPE == 4)
  #if (MOTION_ENABLED == 1)
    #warning "SENSOR_TYPE=4 (buttons) should not have MOTION_ENABLED defined - removing it"
    #undef MOTION_ENABLED
  #endif
#endif

// apply default  FW_UPGRADE_GPIO_ACTIVE = 1 if not defined
#ifndef FW_UPGRADE_GPIO_ACTIVE
  #define FW_UPGRADE_GPIO_ACTIVE 1
  #warning "FW_UPGRADE_GPIO_ACTIVE is not defined in the devices_config.h, using default = HIGH"
#endif 
// apply default  FW_UPGRADE_GPIO_ACTIVE if not defined END

// don't allow compiling if not provided FW_UPGRADE_GPIO 
#ifndef FW_UPGRADE_GPIO
  #error "FW_UPGRADE_GPIO not defined yet OBLIGATORY"
#endif
// don't allow compiling if not provided FW_UPGRADE_GPIO END


#if (BOARD_TYPE == 1)
  #if ( (FW_UPGRADE_GPIO_ACTIVE == 1) and (  (FW_UPGRADE_GPIO == 1) or (FW_UPGRADE_GPIO == 3) or (FW_UPGRADE_GPIO == 5) or (FW_UPGRADE_GPIO == 14) or (FW_UPGRADE_GPIO == 15) or \
  ( (FW_UPGRADE_GPIO >=6) and  (FW_UPGRADE_GPIO <= 11))  ) )
    #error "FW_UPGRADE_GPIO for ESP32 that are HIGH at boot: 1,3,5,6-11,14-15 - FW_UPGRADE_GPIO is one of them and FW_UPGRADE_GPIO_ACTIVE=HIGH"
  #endif 
#endif


// ======================== checking if RTC GPIOs are used for FW_UPGRADE_GPIO - not checking for MOTION and PUSH BUTTONS yet!!! =====================
/*
RTC GPIO for wake up from deep sleep:
ESP32: 0, 2, 4, 12-15, 25-27, 32-39
ESP32-S2: 0-21
ESP32-S3: 0-21
ESP32-C6: 0-7
ESP32-H2: 7-14
*/

// ESP32 and S:
#if (BOARD_TYPE == 1)
  #if ( (FW_UPGRADE_GPIO == 0) or (FW_UPGRADE_GPIO == 2) or (FW_UPGRADE_GPIO == 4) or \
    ((FW_UPGRADE_GPIO >= 12) and (FW_UPGRADE_GPIO <= 15)) or \
    ((FW_UPGRADE_GPIO >= 25) and (FW_UPGRADE_GPIO <= 27)) or \
    ((FW_UPGRADE_GPIO >= 32) and (FW_UPGRADE_GPIO <= 39)) )
      #warning "FW_UPGRADE_GPIO is RTC one - all OK"
  #else
    #error "FW_UPGRADE_GPIO for ESP32 has to be within: 0, 2, 4, 12-15, 25-27, 32-39"
  #endif
#endif

// S2 and S3
#if ((BOARD_TYPE == 2) or (BOARD_TYPE == 3))
  #if ((FW_UPGRADE_GPIO > 21) or (FW_UPGRADE_GPIO < 0))
      #error "FW_UPGRADE_GPIO for ESP32S2/S3 has to be between 0 and 21"
  #else
    // #pragma message "FW_UPGRADE_GPIO is RTC one - all OK"
  #endif
#endif

// C3
#if (BOARD_TYPE == 4)
  #if ((FW_UPGRADE_GPIO > 5) or (FW_UPGRADE_GPIO < 0))
    #error "FW_UPGRADE_GPIO for ESP32C3 has to be between 0 and 5"
  #else
    // #pragma message "FW_UPGRADE_GPIO is RTC one - all OK"
  #endif
#endif
// ======================== checking if RTC GPIOs are used for FW_UPGRADE_GPIO - not checking for MOTION and PUSH BUTTONS yet!!! ===================== END



// boot GPIO: cannot be FW_UPGRADE_GPIO_ACTIVE = 1 - it is always HIGH
// S, S2, S3:
#if (  ((BOARD_TYPE == 1) or (BOARD_TYPE == 2) or (BOARD_TYPE == 3))  and (FW_UPGRADE_GPIO == 0) and (FW_UPGRADE_GPIO_ACTIVE == 1)  )
  #error "Boot GPIO used to wake up - cannot be FW_UPGRADE_GPIO_ACTIVE = 1"
#endif

// C3:
#if ( (BOARD_TYPE == 4) and (FW_UPGRADE_GPIO == 8) and (FW_UPGRADE_GPIO_ACTIVE == 1) )
  #error "Boot GPIO used to wake up - cannot be FW_UPGRADE_GPIO_ACTIVE=1"
#endif
// boot GPIO: cannot be FW_UPGRADE_GPIO_ACTIVE = 1 - it is always HIGH END

// don't allow compiling if FW_UPGRADE_GPIO_ACTIVE = 0, and there are PUSH BUTTONS or MOTION
#if (SENSOR_TYPE == 1) or (SENSOR_TYPE == 2) or (MOTION_ENABLED == 1)
  #if (FW_UPGRADE_GPIO_ACTIVE == 0)
    #error "FW_UPGRADE_GPIO_ACTIVE CANNOT be LOW if MOTION or PUSH BUTTONS are ENABLED (to wake up it must be ALL LOW or ANY HIGH)"
  #endif
#endif
// don't allow compiling if FW_UPGRADE_GPIO_ACTIVE = 0, and there are PUSH BUTTONS or MOTION END

// just warning
#if ((MOTION_ENABLED == 1) or (PUSH_BUTTONS == 1))
  #warning "Make sure FW_UPGRADE_GPIO is not the same as for PUSH_BUTTONS or MOTION"
#endif

#if (USE_INA3221 == 1)
  #if (INA3221_CH1_EN + INA3221_CH2_EN + INA3221_CH3_EN < 1)
    #error "no channel for IN3221 configured - please correct the config"
  #elif (INA3221_CH1_EN + INA3221_CH2_EN + INA3221_CH3_EN > 1)
    #error "only 1 channel defined so far for INA3221 - please correct config"
  #endif
#endif


// ======================== FLAGS used for creating sensors/entities on HA =====================
/*
  uint32_t
  0000  0000  0000  0000  0000  0000  0000  0000
*/
#define FLAG_1_BATTERY_VOLTS          1 << 0   // 1         // 0b1
#define FLAG_2_BATTERY_PERCENT        1 << 1   // 2         // 0b10
#define FLAG_3_BATTERY_CHARGING       1 << 2   // 4         // 0b100...
#define FLAG_4_CHARGING               1 << 3   // 8

#define FLAG_5_TEMPERATURE            1 << 4   // 16
#define FLAG_6_HUMIDITY               1 << 5   // 32
#define FLAG_7_LUX                    1 << 6   // 64
#define FLAG_8_LIGHT_HIGHSENS         1 << 7   // 128
 
#define FLAG_9_BUTTON_PRESSED         1 << 8   // 256
#define FLAG_10_V1                    1 << 9   // 512
#define FLAG_11_I1                    1 << 10  // 1024
#define FLAG_12_P1                    1 << 11  // 2048

#define FLAG_13_V2                    1 << 12  // 4096
#define FLAG_14_I2                    1 << 13  // 8192
#define FLAG_15_P2                    1 << 14  // 16384
#define FLAG_16_V3                    1 << 15  // 32768

#define FLAG_17_I3                    1 << 16  // 65536
#define FLAG_18_P3                    1 << 17  // 131072
#define FLAG_19_MOTION                1 << 18  // 262144
// #define FLAG_20_                      1 << 19  // 524288
// ======================== FLAGS used for creating sensors/entities on HA END =================




#endif  /* devices_config_h */
