Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
v2.2.0 release
  • Loading branch information
nplan committed May 28, 2023
2 parents 21c93d9 + 8bcfa69 commit 0ccfbf1
Show file tree
Hide file tree
Showing 254 changed files with 772,382 additions and 30,211 deletions.
10 changes: 7 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
"yaml.schemas": {
"https://squidfunk.github.io/mkdocs-material/schema.json": "mkdocs.yml"
}
"yaml.schemas": {
"https://squidfunk.github.io/mkdocs-material/schema.json": "mkdocs.yml"
},
"[python]": {
"editor.defaultFormatter": "ms-python.autopep8"
},
"python.formatting.provider": "none"
}
2 changes: 2 additions & 0 deletions Firmware/HomeButtonsArduino/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@
logs
sdkconfig.debug
sdkconfig.release
sdkconfig.mini_debug
sdkconfig.mini_release
32 changes: 31 additions & 1 deletion Firmware/HomeButtonsArduino/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ upload_port = /dev/cu.usbmodem01
monitor_port = /dev/cu.usbmodem101
monitor_speed = 115200
monitor_filters = esp32_exception_decoder, colorize
extra_scripts = pre:pre_script.py
extra_scripts =
pre:pre_script.py
post:post_script.py
lib_deps =
knolleary/PubSubClient@2.8
bblanchon/ArduinoJson@6.20.0
Expand Down Expand Up @@ -51,3 +53,31 @@ build_flags =
-DARDUINO_ESP32S2_DEV
-DCORE_DEBUG_LEVEL=5
-DLOGGER_DEFAULT_LOG_LEVEL=ESP_LOG_DEBUG

[env:mini_release]
upload_port = /dev/cu.usbserial-02919B1A
monitor_port = /dev/cu.usbserial-02919B1A
build_flags =
-std=gnu++17
-Wno-unknown-pragmas
-DARDUINO_ESP32S2_DEV
-DCORE_DEBUG_LEVEL=1
-DLOGGER_DEFAULT_LOG_LEVEL=ESP_LOG_INFO
-DHOME_BUTTONS_MINI

[env:mini_debug]
upload_port = /dev/cu.usbserial-02919B1A
monitor_port = /dev/cu.usbserial-02919B1A
build_type = debug
debug_tool = cmsis-dap
debug_server =
/opt/homebrew/Cellar/open-ocd/0.12.0/bin/openocd
-f
esp32s2_cmsisdap.cfg
build_flags =
-std=gnu++17
-Wno-unknown-pragmas
-DARDUINO_ESP32S2_DEV
-DCORE_DEBUG_LEVEL=5
-DLOGGER_DEFAULT_LOG_LEVEL=ESP_LOG_DEBUG
-DHOME_BUTTONS_MINI
36 changes: 36 additions & 0 deletions Firmware/HomeButtonsArduino/post_script.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import os
import zipfile

Import("env")

partition_gen_path = "components/partition_table/gen_esp32part.py"

files_to_zip = ["firmware.bin", "bootloader.bin", "partitions.bin", "ota_data_initial.bin", "partitions.csv"]
zip_filename = "firmware.zip"


def create_zip(files, output_filename):
with zipfile.ZipFile(output_filename, 'w') as zipf:
for file in files:
zipf.write(file, arcname=os.path.basename(file))
print(f"{output_filename} created successfully.")


def create_partitions_csv():
print("Creating partitions.csv...")
package_dir = env.PioPlatform().get_package_dir("framework-espidf")
path = os.path.join(package_dir, partition_gen_path)
part_bin_path = os.path.join(env.subst("$BUILD_DIR"), "partitions.bin")
part_csv_path = os.path.join(env.subst("$BUILD_DIR"), "partitions.csv")
env.Execute(f"python {path} {part_bin_path} {part_csv_path}")
print(f"{part_csv_path} created successfully.")


def post_build(source, target, env):
print("#### POST BUILD ####")
create_partitions_csv()
files = [os.path.join(env.subst("$BUILD_DIR"), file) for file in files_to_zip]
create_zip(files, os.path.join(env.subst("$BUILD_DIR"), zip_filename))

print("#### POST SCRIPT ####")
env.AddPostAction("buildprog", post_build)
19 changes: 13 additions & 6 deletions Firmware/HomeButtonsArduino/pre_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,21 @@

import os

sdkconfig_files = ["sdkconfig.release", "sdkconfig.debug", "sdkconfig.mini_release", "sdkconfig.mini_debug"]

def delete_sdkconfig_files():
try:
os.remove("sdkconfig.release")
os.remove("sdkconfig.debug")
print("Deleted sdkconfig.release and sdkconfig.debug files")
except:
pass
print("Deleting sdkconfig files...")

for file in sdkconfig_files:
if os.path.isfile(file):
try:
os.remove(file)
except:
print("Failed to delete {}".format(file))
else:
print("Deleted {}".format(file))


print("#### PRE SCRIPT ####")
delete_sdkconfig_files()
print("#### PRE SCRIPT DONE ####")
9 changes: 1 addition & 8 deletions Firmware/HomeButtonsArduino/sdkconfig.debug.defaults
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
CONFIG_AUTOSTART_ARDUINO=y
CONFIG_FREERTOS_HZ=1000
CONFIG_MBEDTLS_PSK_MODES=y
CONFIG_MBEDTLS_KEY_EXCHANGE_PSK=y

CONFIG_COMPILER_OPTIMIZATION_NONE=y

CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=6
CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=12
CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM=12
CONFIG_ESPTOOLPY_FLASHMODE_DIO=y

CONFIG_BOOTLOADER_LOG_LEVEL_DEBUG=y
CONFIG_LOG_DEFAULT_LEVEL_INFO=y
Expand Down
1 change: 0 additions & 1 deletion Firmware/HomeButtonsArduino/sdkconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ CONFIG_FREERTOS_HZ=1000
CONFIG_MBEDTLS_PSK_MODES=y
CONFIG_MBEDTLS_KEY_EXCHANGE_PSK=y

CONFIG_ESPTOOLPY_FLASHMODE_DIO=y
CONFIG_ESPTOOLPY_FLASHFREQ_80M=y
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
CONFIG_ESP32S2_DEFAULT_CPU_FREQ_240=y
Expand Down
7 changes: 7 additions & 0 deletions Firmware/HomeButtonsArduino/sdkconfig.mini_debug.defaults
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CONFIG_COMPILER_OPTIMIZATION_NONE=y

CONFIG_ESPTOOLPY_FLASHMODE_QIO=y

CONFIG_BOOTLOADER_LOG_LEVEL_DEBUG=y
CONFIG_LOG_DEFAULT_LEVEL_INFO=y
CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL_DEBUG=y
7 changes: 7 additions & 0 deletions Firmware/HomeButtonsArduino/sdkconfig.mini_release.defaults
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CONFIG_COMPILER_OPTIMIZATION_PERF=y

CONFIG_ESPTOOLPY_FLASHMODE_QIO=y

CONFIG_BOOTLOADER_LOG_LEVEL_ERROR=y
CONFIG_LOG_DEFAULT_LEVEL_ERROR=y
CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL_ERROR=y
9 changes: 1 addition & 8 deletions Firmware/HomeButtonsArduino/sdkconfig.release.defaults
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
CONFIG_AUTOSTART_ARDUINO=y
CONFIG_FREERTOS_HZ=1000
CONFIG_MBEDTLS_PSK_MODES=y
CONFIG_MBEDTLS_KEY_EXCHANGE_PSK=y

CONFIG_COMPILER_OPTIMIZATION_PERF=y

CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=6
CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=12
CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM=12
CONFIG_ESPTOOLPY_FLASHMODE_DIO=y

CONFIG_BOOTLOADER_LOG_LEVEL_ERROR=y
CONFIG_LOG_DEFAULT_LEVEL_ERROR=y
Expand Down
Loading

0 comments on commit 0ccfbf1

Please sign in to comment.