Adopting suggestions from @gaelbenoit

- Moving PIN_BUTTON definitions to wManager.h
- Using "TFT_BL" macro instead of the direct int representation in
  NerdMinerV2.ino.cpp
This commit is contained in:
Bruno Terlizzi de Renzo 2023-05-13 17:00:54 +02:00
parent 277ab92a63
commit b6bf69355e
2 changed files with 8 additions and 7 deletions

View File

@ -1,6 +1,4 @@
//Botón configuración
#define PIN_BUTTON_1 0
#define PIN_BUTTON_2 14
#include <Arduino.h> #include <Arduino.h>
#include <WiFi.h> #include <WiFi.h>
@ -40,10 +38,10 @@ unsigned long start = millis();
//void runMonitor(void *name); //void runMonitor(void *name);
void alternate_screen_state() { void alternate_screen_state() {
int screen_state= digitalRead(38); int screen_state= digitalRead(TFT_BL);
//Serial.printf("Screen state is '%s', switching to '%s'", screen_state, !screen_state); //Serial.printf("Screen state is '%s', switching to '%s'", screen_state, !screen_state);
Serial.println("Switching display state"); Serial.println("Switching display state");
digitalWrite(38, !screen_state); digitalWrite(TFT_BL, !screen_state);
} }
void alternate_screen_rotation() { void alternate_screen_rotation() {
@ -158,7 +156,7 @@ void loop() {
oldStatus = newStatus; oldStatus = newStatus;
} }
//Run miner on main core when there is time --Currently on test //Run miner on main core when there is time --Currently on test
// runMiner(); // runMiner();
} }

View File

@ -1,4 +1,7 @@
#define PIN_ENABLE5V 15 //Botón configuración
#define PIN_BUTTON_1 0
#define PIN_BUTTON_2 14
#define PIN_ENABLE5V 15
void init_WifiManager(); void init_WifiManager();
void wifiManagerProcess(); void wifiManagerProcess();