mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
* new target env: Xiao S3 WIO repeater
This commit is contained in:
parent
07ad40cac0
commit
88f21d9aa4
5 changed files with 56 additions and 14 deletions
|
|
@ -8,10 +8,24 @@
|
|||
#include <rom/rtc.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
class ESP32Board : public mesh::MainBoard { // abstract class
|
||||
class ESP32Board : public mesh::MainBoard {
|
||||
protected:
|
||||
uint8_t startup_reason;
|
||||
|
||||
public:
|
||||
void begin() {
|
||||
// for future use, sub-classes SHOULD call this from their begin()
|
||||
startup_reason = BD_STARTUP_NORMAL;
|
||||
}
|
||||
|
||||
uint8_t getStartupReason() const override { return startup_reason; }
|
||||
|
||||
uint16_t getBattMilliVolts() override {
|
||||
return 0; // not supported
|
||||
}
|
||||
|
||||
const char* getManufacturerName() const override {
|
||||
return "Generic ESP32";
|
||||
}
|
||||
|
||||
void reboot() override {
|
||||
|
|
|
|||
|
|
@ -22,10 +22,8 @@
|
|||
#include <driver/rtc_io.h>
|
||||
|
||||
class HeltecV3Board : public ESP32Board {
|
||||
uint8_t startup_reason;
|
||||
public:
|
||||
void begin() {
|
||||
startup_reason = BD_STARTUP_NORMAL;
|
||||
ESP32Board::begin();
|
||||
|
||||
esp_reset_reason_t reason = esp_reset_reason();
|
||||
|
|
@ -46,8 +44,6 @@ public:
|
|||
pinMode(PIN_ADC_CTRL, OUTPUT);
|
||||
}
|
||||
|
||||
uint8_t getStartupReason() const { return startup_reason; }
|
||||
|
||||
void enterDeepSleep(uint32_t secs, int pin_wake_btn = -1) {
|
||||
esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_ON);
|
||||
|
||||
|
|
|
|||
|
|
@ -12,10 +12,8 @@
|
|||
#include <driver/uart.h>
|
||||
|
||||
class XiaoC3Board : public ESP32Board {
|
||||
uint8_t startup_reason;
|
||||
public:
|
||||
void begin() {
|
||||
startup_reason = BD_STARTUP_NORMAL;
|
||||
ESP32Board::begin();
|
||||
|
||||
esp_reset_reason_t reason = esp_reset_reason();
|
||||
|
|
@ -47,8 +45,6 @@ public:
|
|||
#endif
|
||||
}
|
||||
|
||||
uint8_t getStartupReason() const { return startup_reason; }
|
||||
|
||||
void enterDeepSleep(uint32_t secs, int8_t wake_pin = -1) {
|
||||
gpio_set_direction(gpio_num_t(P_LORA_DIO_1), GPIO_MODE_INPUT);
|
||||
if (wake_pin >= 0) {
|
||||
|
|
@ -111,7 +107,7 @@ public:
|
|||
|
||||
return ((5.78 * raw) / 1024.0) * 1000;
|
||||
#else
|
||||
return 0;
|
||||
return 0; // not supported
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue