mirror of
https://github.com/meshtastic/firmware.git
synced 2026-06-16 15:26:21 +00:00
Compare commits
11 Commits
simradio-pkc
...
esp32-h2
| Author | SHA1 | Date | |
|---|---|---|---|
| 54aa53aba4 | |||
| 68f1c88cbf | |||
| 73af50a0f6 | |||
| a853053a72 | |||
| fea10ccecd | |||
| ca46ebe6bd | |||
| 0f0e704f29 | |||
| 23aaee737a | |||
| 42c46cad41 | |||
| f0b72a4b4b | |||
| 24ca4602b1 |
@@ -23,7 +23,8 @@ extern AmbientLightingThread *ambientLightingThread;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && !defined(CONFIG_IDF_TARGET_ESP32C6)
|
||||
#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && !defined(CONFIG_IDF_TARGET_ESP32C6) && \
|
||||
!defined(CONFIG_IDF_TARGET_ESP32H2)
|
||||
#include <NonBlockingRtttl.h>
|
||||
#else
|
||||
// Noop class for portduino.
|
||||
|
||||
@@ -173,7 +173,7 @@ int32_t SerialModule::runOnce()
|
||||
// Give it a chance to flush out 💩
|
||||
delay(10);
|
||||
}
|
||||
#if defined(CONFIG_IDF_TARGET_ESP32C6)
|
||||
#if defined(CONFIG_IDF_TARGET_ESP32C6) || defined(CONFIG_IDF_TARGET_ESP32H2)
|
||||
if (moduleConfig.serial.rxd && moduleConfig.serial.txd) {
|
||||
Serial1.setRxBufferSize(RX_BUFFER);
|
||||
Serial1.begin(baud, SERIAL_8N1, moduleConfig.serial.rxd, moduleConfig.serial.txd);
|
||||
@@ -277,7 +277,7 @@ int32_t SerialModule::runOnce()
|
||||
}
|
||||
#endif
|
||||
else {
|
||||
#if defined(CONFIG_IDF_TARGET_ESP32C6)
|
||||
#if defined(CONFIG_IDF_TARGET_ESP32C6) || defined(CONFIG_IDF_TARGET_ESP32H2)
|
||||
while (Serial1.available()) {
|
||||
serialPayloadSize = Serial1.readBytes(serialBytes, meshtastic_Constants_DATA_PAYLOAD_LEN);
|
||||
#else
|
||||
@@ -540,8 +540,7 @@ ParsedLine parseLine(const char *line)
|
||||
*/
|
||||
void SerialModule::processWXSerial()
|
||||
{
|
||||
#if SERIAL_PRINT_PORT != 0 && !defined(ARCH_STM32WL) && !defined(CONFIG_IDF_TARGET_ESP32C6)
|
||||
|
||||
#if SERIAL_PRINT_PORT != 0 && !defined(ARCH_STM32WL) && !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32H2)
|
||||
static unsigned int lastAveraged = 0;
|
||||
static unsigned int averageIntervalMillis = 300000; // 5 minutes hard coded.
|
||||
static double dir_sum_sin = 0;
|
||||
|
||||
@@ -165,6 +165,8 @@ void esp32Setup()
|
||||
// #define APP_WATCHDOG_SECS 45
|
||||
#define APP_WATCHDOG_SECS 90
|
||||
|
||||
// esp_task_wdt_init returns an unknown error, so skip it on ESP32H2
|
||||
#ifndef CONFIG_IDF_TARGET_ESP32H2
|
||||
#if ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(3, 0, 0)
|
||||
const esp_task_wdt_config_t wdt_config = {
|
||||
.timeout_ms = APP_WATCHDOG_SECS * 1000,
|
||||
@@ -190,7 +192,7 @@ void esp32Setup()
|
||||
res = esp_task_wdt_add(NULL);
|
||||
}
|
||||
assert(res == ESP_OK);
|
||||
|
||||
#endif
|
||||
#if HAS_32768HZ
|
||||
enableSlowCLK();
|
||||
#endif
|
||||
@@ -199,7 +201,9 @@ void esp32Setup()
|
||||
/// loop code specific to ESP32 targets
|
||||
void esp32Loop()
|
||||
{
|
||||
#ifndef CONFIG_IDF_TARGET_ESP32H2
|
||||
esp_task_wdt_reset(); // service our app level watchdog
|
||||
#endif
|
||||
|
||||
// for debug printing
|
||||
// radio.radioIf.canSleep();
|
||||
@@ -232,9 +236,10 @@ void cpuDeepSleep(uint32_t msecToWake)
|
||||
13,
|
||||
#endif
|
||||
34, 35, 37};
|
||||
|
||||
#ifndef CONFIG_IDF_TARGET_ESP32H2
|
||||
for (int i = 0; i < sizeof(rtcGpios); i++)
|
||||
rtc_gpio_isolate((gpio_num_t)rtcGpios[i]);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// FIXME, disable internal rtc pullups/pulldowns on the non isolated pins. for inputs that we aren't using
|
||||
|
||||
@@ -555,6 +555,8 @@ void enableModemSleep()
|
||||
esp32_config.max_freq_mhz = CONFIG_ESP32S2_DEFAULT_CPU_FREQ_MHZ;
|
||||
#elif CONFIG_IDF_TARGET_ESP32C6
|
||||
esp32_config.max_freq_mhz = CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ;
|
||||
#elif CONFIG_IDF_TARGET_ESP32H2
|
||||
esp32_config.max_freq_mhz = CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ;
|
||||
#elif CONFIG_IDF_TARGET_ESP32C3
|
||||
esp32_config.max_freq_mhz = CONFIG_ESP32C3_DEFAULT_CPU_FREQ_MHZ;
|
||||
#elif CONFIG_IDF_TARGET_ESP32P4
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
[esp32h2_base]
|
||||
extends = esp32_common
|
||||
custom_esp32_kind = esp32h2
|
||||
|
||||
build_flags =
|
||||
${esp32_common.build_flags}
|
||||
-DHAS_WIFI=0
|
||||
-DMESHTASTIC_EXCLUDE_WIFI=1 ; TODO
|
||||
-DMESHTASTIC_EXCLUDE_MQTT=1
|
||||
-DMESHTASTIC_EXCLUDE_PAXCOUNTER=1
|
||||
-DMESHTASTIC_EXCLUDE_WEBSERVER=1
|
||||
|
||||
build_unflags=
|
||||
-DHAS_UDP_MULTICAST=1
|
||||
|
||||
build_src_filter =
|
||||
${esp32_common.build_src_filter} -<mesh/http>
|
||||
|
||||
monitor_speed = 460800
|
||||
monitor_filters = esp32_h2_exception_decoder
|
||||
|
||||
lib_ignore =
|
||||
${esp32_common.lib_ignore}
|
||||
libpax
|
||||
esp32_idf5_https_server
|
||||
esp_http_server
|
||||
@@ -0,0 +1,12 @@
|
||||
[env:waveshare-esp32h2]
|
||||
extends = esp32h2_base
|
||||
board = esp32-h2-devkitm-1
|
||||
board_build.f_flash = 16000000L
|
||||
; Set this back to 'pr' once the CI plumbing is in place.
|
||||
; board_level = pr
|
||||
board_level = extra
|
||||
build_flags =
|
||||
${esp32h2_base.build_flags}
|
||||
-I variants/esp32h2/waveshare-esp32-h2
|
||||
-DARDUINO_USB_CDC_ON_BOOT=1
|
||||
-DARDUINO_USB_MODE=1
|
||||
@@ -0,0 +1,9 @@
|
||||
|
||||
#define HAS_SCREEN 0
|
||||
|
||||
#define SERIAL_PRINT_PORT 1
|
||||
|
||||
#define LORA_SCK 4
|
||||
#define LORA_MISO 3
|
||||
#define LORA_MOSI 2
|
||||
#define LORA_CS 1
|
||||
Reference in New Issue
Block a user