From 31523756233d57e47ad12c45f58d792044d7e56d Mon Sep 17 00:00:00 2001 From: Nicu Hodos Date: Sat, 18 May 2024 20:41:55 +0200 Subject: [PATCH] pin definitions in a dedicated file --- gateway/include/huzzah.h | 5 ----- gateway/include/pins.h | 12 ++++++++++++ gateway/include/pro-mini.h | 4 ---- gateway/src/gateway.cpp | 1 + 4 files changed, 13 insertions(+), 9 deletions(-) create mode 100644 gateway/include/pins.h diff --git a/gateway/include/huzzah.h b/gateway/include/huzzah.h index 03b855e..3290d17 100644 --- a/gateway/include/huzzah.h +++ b/gateway/include/huzzah.h @@ -1,10 +1,5 @@ #include -#define SEND_PIN 14 -#define RECEIVE_PIN 12 -#define RED_LED LED_BUILTIN -#define BLUE_LED 2 - using namespace std; Scheduler ts; diff --git a/gateway/include/pins.h b/gateway/include/pins.h new file mode 100644 index 0000000..728511f --- /dev/null +++ b/gateway/include/pins.h @@ -0,0 +1,12 @@ +#pragma once + +#if defined(ESP8266) +#define SEND_PIN 14 +#define RECEIVE_PIN 12 +#define RED_LED LED_BUILTIN +#define BLUE_LED 2 +#else +#define RESET_PIN 10 +#define SEND_PIN 11 +#define RECEIVE_PIN 2 +#endif diff --git a/gateway/include/pro-mini.h b/gateway/include/pro-mini.h index fed8722..b43e076 100644 --- a/gateway/include/pro-mini.h +++ b/gateway/include/pro-mini.h @@ -1,9 +1,5 @@ #include "output.h" -#define RESET_PIN 10 -#define SEND_PIN 11 -#define RECEIVE_PIN 2 - namespace Board { void setup() { diff --git a/gateway/src/gateway.cpp b/gateway/src/gateway.cpp index cdafa1d..f112496 100644 --- a/gateway/src/gateway.cpp +++ b/gateway/src/gateway.cpp @@ -1,6 +1,7 @@ #include #include #include +#include "pins.h" #include "Dht.h" #include "Protocol_1.h" #include "Protocol_2.h"