start of sanitycheck-header

This commit is contained in:
2022-08-21 11:28:58 +02:00
parent a6f5b4ef65
commit 4ce550c668
5 changed files with 41 additions and 26 deletions

View File

@@ -4,9 +4,7 @@
#define Q(x) #x
#define QUOTE(x) Q(x)
#ifndef PCB_REV
#error "You must define PCB_REV"
#elif PCB_REV == 2
#if PCB_REV == 2
#define GPIO_BUTTON D7
#define GPIO_LED D8
#define GPIO_TRIGGER D6
@@ -16,7 +14,7 @@
#define GPIO_LED D6
#define GPIO_TRIGGER D4
#define GPIO_PUMP D3
#elif PCB_REV >= 4
#elif PCB_REV == 4
#define GPIO_BUTTON D4
#define GPIO_LED D3
#define GPIO_TRIGGER D6
@@ -39,17 +37,4 @@
#define ATOMIC_FS_UPDATE
#ifndef ADMIN_PASSWORD
#error "You need to define ADMIN_PASSWORD for OTA-Update"
#endif
#ifndef WIFI_PASSWORD
#error "You must define an WIFI_PASSWORD for OTA-Update"
#endif
#ifndef WIFI_SSID
#error "You must define an WIFI_SSID for OTA-Update"
#endif
#ifndef WIFI_AP_PASSWORD
#error "You must define an WIFI_AP_PASSWORD for Standalone AP-Mode"
#endif
#endif

View File

@@ -34,8 +34,8 @@
#ifdef FEATURE_ENABLE_WIFI_CLIENT
#include <ESP8266WiFiMulti.h>
const char *ssid = QUOTE(WIFI_SSID);
const char *password = QUOTE(WIFI_PASSWORD);
const char *ssid = QUOTE(WIFI_SSID_CLIENT);
const char *password = QUOTE(WIFI_PASSWORD_CLIENT);
const uint32_t connectTimeoutMs = 5000;
ESP8266WiFiMulti wifiMulti;

View File

@@ -0,0 +1,30 @@
#ifndef _SANITYCHECK_H_
#define _SANITYCHECK_H_
#ifndef PCB_REV
#error "You must define PCB_REV"
#else
#if PCB_REV < 1 || PCB_REV > 4
#error "Unsupported PCB-Revision"
#endif
#endif
#ifndef ADMIN_PASSWORD
#error "You need to define ADMIN_PASSWORD for OTA-Update"
#endif
#ifdef FEATURE_ENABLE_WIFI_CLIENT
#ifndef WIFI_PASSWORD_CLIENT
#error "You must define an WIFI_PASSWORD for Client-Mode"
#endif
#ifndef WIFI_SSID_CLIENT
#error "You must define an WIFI_SSID for Client-Mode"
#endif
#endif
#ifndef WIFI_AP_PASSWORD
#error "You must define an WIFI_AP_PASSWORD for Standalone AP-Mode"
#endif
#endif //_SANITYCHECK_H_