-
Notifications
You must be signed in to change notification settings - Fork 7
/
ESP32-IO_Extender.ino
45 lines (37 loc) · 1.28 KB
/
ESP32-IO_Extender.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// IO Extender
// Use of an ESP32, such as ESP32-C3 to provide additional peripheral pins
// to another ESP32 with limited free pins, such as ESP-Cam module
// The ESPs communicate using a UART interface.
// The interface only supports peripherals that receive or output a numeric value.
// It is only suitable for low data rate peripherals, it cannot support clocked
// data streams such as a microphone.
// This version of the app is configured to support peripherals for ESP32_MJPEG2SD
// Modify peripherals.cpp to add further peripherals
//
// Compile with partition scheme: Minimal Spiffs ...
//
// s60sc 2022
#include "appGlobals.h"
static bool startedUp = false;
void setup() {
logSetup();
// prep SD card storage and Load saved user configuration
if (startStorage()) loadConfig();
#ifdef DEV_ONLY
devSetup();
#endif
// connect wifi or start config AP if router details not available
startWifi();
startWebServer();
if (strlen(startupFailure)) LOG_ERR("%s", startupFailure);
else {
// start rest of services
prepPeripherals();
startedUp = true;
checkMemory();
LOG_INF("=============== Total tasks: %u ===============\n", uxTaskGetNumberOfTasks());
}
}
void loop() {
if (startedUp) getPeripheralsRequest();
}