Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for ESP32-S2 #667

Merged
merged 2 commits into from
Oct 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,14 @@ board_upload.flash_size = 4MB
board_build.partitions = esp32_partition_4M.csv
build_flags = ${common.build_flags}
build_unflags = ${common.unbuild_flags}

[env:lolin_s2_mini]
extra_scripts =
pre:scripts/build_interface.py
scripts/rename_fw.py
board = lolin_s2_mini
platform = espressif32
board_upload.flash_size = 4MB
board_build.partitions = esp32_partition_4M.csv
build_flags = ${common.build_flags}
build_unflags = ${common.unbuild_flags}
5 changes: 4 additions & 1 deletion scripts/rename_fw.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def bin_copy(source, target, env):
bag[var] = m.group(1)

app_version = bag.get('app_version')

platform = "ESP32"

# flash_size = env["PIOENV"].split('_')[1]
Expand All @@ -30,13 +31,15 @@ def bin_copy(source, target, env):

# alternatively take platform from the pio target
# platform = str(target[0]).split(os.path.sep)[2]
chip_target = env.get('PIOENV').upper()

print("app version: "+app_version)
print("chip_target: "+chip_target)
print("platform: "+platform)
# print("flash size: "+flash_size)

# convert . to _ so Windows doesn't complain
variant = "EMS-ESP-" + app_version.replace(".", "_") + "-" + platform
variant = "EMS-ESP-" + app_version.replace(".", "_") + "-" + chip_target

# variant = "EMS-ESP-" + app_version.replace(".", "_") + "-" + platform + "_" + flash_size

Expand Down
2 changes: 2 additions & 0 deletions src/analogsensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@

#ifndef EMSESP_STANDALONE
#include "driver/adc.h"
#ifndef ARDUINO_LOLIN_S2_MINI
#include <esp_bt.h>
#endif
#endif

#include <uuid/log.h>

Expand Down
2 changes: 2 additions & 0 deletions src/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@

#ifndef EMSESP_STANDALONE
#include <esp_wifi.h>
#ifndef ARDUINO_LOLIN_S2_MINI
#include <esp_bt.h>
#endif
#include <ETH.h>
#include <uuid/syslog.h>
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/uart/emsuart_esp32.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#define EMS_MAXBUFFERSIZE 33 // max size of the buffer. EMS packets are max 32 bytes, plus extra for BRK

#ifdef ARDUINO_LOLIN_C3_MINI
#if (defined(ARDUINO_LOLIN_C3_MINI)) || (defined(ARDUINO_LOLIN_S2_MINI))
#define EMSUART_NUM UART_NUM_1 // on C3 mini we're using UART1
#else
#define EMSUART_NUM UART_NUM_2 // on the ESP32 we're using UART2
Expand Down