mirror of
https://github.com/OpenEPaperLink/OpenEPaperLink.git
synced 2026-03-21 11:06:49 +01:00
Nano AP fully power Control support
The idea to switch to an array based power Control was discarded for now
This commit is contained in:
@@ -85,7 +85,7 @@ build_unflags =
|
||||
build_flags =
|
||||
-D BUILD_ENV_NAME=$PIOENV
|
||||
-D BUILD_TIME=$UNIX_TIME
|
||||
-D OPENEPAPERLINK_MINI_AP_PCB
|
||||
-D OPENEPAPERLINK_NANO_AP_PCB
|
||||
-D ARDUINO_USB_MODE=0
|
||||
-D CONFIG_SPIRAM_USE_MALLOC=1
|
||||
-D CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC=y
|
||||
@@ -100,10 +100,10 @@ build_flags =
|
||||
-D FLASHER_AP_MOSI=39
|
||||
-D FLASHER_AP_MISO=33
|
||||
-D FLASHER_AP_RESET=37
|
||||
-D FLASHER_AP_POWER=-1 ;18
|
||||
;-D FLASHER_AP_POWER2=21
|
||||
;-D FLASHER_AP_POWER3=16
|
||||
;-D FLASHER_AP_POWER4=17
|
||||
-D FLASHER_AP_POWER=18
|
||||
-D FLASHER_AP_POWER2=21
|
||||
-D FLASHER_AP_POWER3=16
|
||||
-D FLASHER_AP_POWER4=17
|
||||
-D FLASHER_AP_TXD=35
|
||||
-D FLASHER_AP_RXD=36
|
||||
-D FLASHER_AP_TEST=34
|
||||
|
||||
@@ -51,7 +51,7 @@ void setup() {
|
||||
showColorPattern(CRGB::Aqua, CRGB::Green, CRGB::Blue);
|
||||
#endif
|
||||
|
||||
#ifdef OPENEPAPERLINK_MINI_AP_PCB
|
||||
#if defined(OPENEPAPERLINK_MINI_AP_PCB) || defined(OPENEPAPERLINK_NANO_AP_PCB)
|
||||
APEnterEarlyReset();
|
||||
// this allows us to view the booting process. After the device showing up, you have 3 seconds to open a terminal on the COM port
|
||||
vTaskDelay(3000 / portTICK_PERIOD_MS);
|
||||
|
||||
@@ -22,6 +22,25 @@ void simpleAPPower(bool state) {
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef OPENEPAPERLINK_NANO_AP_PCB
|
||||
void simpleAPPower(bool state) {
|
||||
if (FLASHER_AP_POWER >= 0 && FLASHER_AP_POWER2 >= 0 && FLASHER_AP_POWER3 >= 0 && FLASHER_AP_POWER4 >= 0) {
|
||||
pinMode(FLASHER_AP_POWER, INPUT);
|
||||
pinMode(FLASHER_AP_POWER2, INPUT);
|
||||
pinMode(FLASHER_AP_POWER3, INPUT);
|
||||
pinMode(FLASHER_AP_POWER4, INPUT);
|
||||
digitalWrite(FLASHER_AP_POWER, state);
|
||||
digitalWrite(FLASHER_AP_POWER2, state);
|
||||
digitalWrite(FLASHER_AP_POWER3, state);
|
||||
digitalWrite(FLASHER_AP_POWER4, state);
|
||||
pinMode(FLASHER_AP_POWER, OUTPUT);
|
||||
pinMode(FLASHER_AP_POWER2, OUTPUT);
|
||||
pinMode(FLASHER_AP_POWER3, OUTPUT);
|
||||
pinMode(FLASHER_AP_POWER4, OUTPUT);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// On the OpenEPaperLink board, there is no in-rush current limiting. The tags that can be connected to the board can have significant capacity, which,
|
||||
// when drained if the board applies power, will cause the 3v3 rail to sag enough to reset the ESP32. This is obviously not great. To prevent this from happening,
|
||||
// we ramp up/down the voltage with PWM. Ramping down really is unnecessary, as the board has a resistor to dump the charge into.
|
||||
@@ -57,4 +76,9 @@ void rampTagPower(uint8_t pin, bool up) {
|
||||
delay(500);
|
||||
simpleAPPower(up);
|
||||
#endif
|
||||
#ifdef OPENEPAPERLINK_NANO_AP_PCB
|
||||
simpleAPPower(false);
|
||||
delay(500);
|
||||
simpleAPPower(up);
|
||||
#endif
|
||||
}
|
||||
@@ -228,15 +228,16 @@ void init_web() {
|
||||
|
||||
WiFiManager wm;
|
||||
bool res;
|
||||
#ifdef OPENEPAPERLINK_MINI_AP_PCB
|
||||
#if defined(OPENEPAPERLINK_MINI_AP_PCB) || defined(OPENEPAPERLINK_NANO_AP_PCB)
|
||||
WiFi.setTxPower(WIFI_POWER_15dBm);
|
||||
#endif
|
||||
wm.setWiFiAutoReconnect(true);
|
||||
res = wm.autoConnect("OpenEPaperLink Setup");
|
||||
if (!res) {
|
||||
Serial.println("Failed to connect");
|
||||
ESP.restart();
|
||||
}
|
||||
#ifdef OPENEPAPERLINK_MINI_AP_PCB
|
||||
#if defined(OPENEPAPERLINK_MINI_AP_PCB) || defined(OPENEPAPERLINK_NANO_AP_PCB)
|
||||
WiFi.setTxPower(WIFI_POWER_19_5dBm);
|
||||
#endif
|
||||
Serial.print("Connected! IP address: ");
|
||||
|
||||
Reference in New Issue
Block a user