Skip to content

Commit

Permalink
create merged firmware for flasher
Browse files Browse the repository at this point in the history
  • Loading branch information
Foroxon committed Mar 27, 2024
1 parent adbae10 commit fd2c4f8
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 17 deletions.
43 changes: 40 additions & 3 deletions .github/workflows/upload-pages/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,31 @@ inputs:
beta_build:
description: 'Beta build number'
default: ''
bootloader_path:
description: 'Path to the bootloader bin'
default: '${{ github.workspace }}/src/firmware/build/esp32.esp32.esp32/firmware.ino.bootloader.bin'
partition_table_path:
description: 'Path to the partition bin'
default: '${{ github.workspace }}/src/firmware/build/esp32.esp32.esp32/firmware.ino.partitions.bin'

runs:
using: 'composite'
steps:
- name: Copy bin to flesher
if: ${{ inputs.binary_path != '' }}
shell: bash
run: |
cp -f ${{ inputs.binary_path }} ${{ github.workspace }}/flasher/bins/jaam.bin
esptool --chip esp32 merge_bin \
-o ${{ github.workspace }}/jaam-merged.bin \
--flash_mode dio \
--flash_freq 80m \
--flash_size 4MB \
0x1000 ${{ inputs.bootloader_path }} \
0x8000 ${{ inputs.partition_table_path }} \
0xe000 ${{ github.workspace }}/flasher/bins/jaam.boot.bin \
0x10000 ${{ inputs.binary_path }}
cp -f ${{ github.workspace }}/jaam-merged.bin ${{ github.workspace }}/flasher/bins/jaam.bin
- name: Change version in flasher
if: ${{ inputs.binary_path != '' }}
shell: bash
Expand All @@ -34,7 +51,17 @@ runs:
if: ${{ inputs.beta_binary_path != '' }}
shell: bash
run: |
cp -f ${{ inputs.beta_binary_path }} ${{ github.workspace }}/flasher/bins/jaam_beta.bin
esptool --chip esp32 merge_bin \
-o ${{ github.workspace }}/jaam-beta-merged.bin \
--flash_mode dio \
--flash_freq 80m \
--flash_size 4MB \
0x1000 ${{ inputs.bootloader_path }} \
0x8000 ${{ inputs.partition_table_path }} \
0xe000 ${{ github.workspace }}/flasher/bins/jaam.boot.bin \
0x10000 ${{ inputs.beta_binary_path }}
cp -f ${{ github.workspace }}/jaam-beta-merged.bin ${{ github.workspace }}/flasher/bins/jaam_beta.bin
- name: Change beta version in flasher
if: ${{ inputs.beta_binary_path != '' }}
shell: bash
Expand All @@ -45,7 +72,17 @@ runs:
if: ${{ inputs.lite_binary_path != '' }}
shell: bash
run: |
cp -f ${{ inputs.lite_binary_path }} ${{ github.workspace }}/flasher/bins/jaam_lite.bin
esptool --chip esp32 merge_bin \
-o ${{ github.workspace }}/jaam-lite-merged.bin \
--flash_mode dio \
--flash_freq 80m \
--flash_size 4MB \
0x1000 ${{ inputs.bootloader_path }} \
0x8000 ${{ inputs.partition_table_path }} \
0xe000 ${{ github.workspace }}/flasher/bins/jaam.boot.bin \
0x10000 ${{ inputs.lite_binary_path }}
cp -f ${{ github.workspace }}/jaam-lite-merged.bin ${{ github.workspace }}/flasher/bins/jaam_lite.bin
- name: Change lite version in flasher
if: ${{ inputs.lite_binary_path != '' }}
shell: bash
Expand Down
Binary file removed flasher/bins/jaam.bootloader.bin
Binary file not shown.
Binary file removed flasher/bins/jaam.partitions.bin
Binary file not shown.
5 changes: 1 addition & 4 deletions flasher/manifest-beta.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@
"chipFamily": "ESP32",
"improv": false,
"parts": [
{ "path": "bins/jaam.bootloader.bin", "offset": 4096 },
{ "path": "bins/jaam.partitions.bin", "offset": 32768 },
{ "path": "bins/jaam.boot.bin", "offset": 57344 },
{ "path": "bins/jaam_beta.bin", "offset": 65536 }
{ "path": "bins/jaam_beta.bin", "offset": 0 }
]
}
]
Expand Down
5 changes: 1 addition & 4 deletions flasher/manifest-lite.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@
"chipFamily": "ESP32",
"improv": false,
"parts": [
{ "path": "bins/jaam.bootloader.bin", "offset": 4096 },
{ "path": "bins/jaam.partitions.bin", "offset": 32768 },
{ "path": "bins/jaam.boot.bin", "offset": 57344 },
{ "path": "bins/jaam_lite.bin", "offset": 65536 }
{ "path": "bins/jaam_lite.bin", "offset": 0 }
]
}
]
Expand Down
5 changes: 1 addition & 4 deletions flasher/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@
"chipFamily": "ESP32",
"improv": false,
"parts": [
{ "path": "bins/jaam.bootloader.bin", "offset": 4096 },
{ "path": "bins/jaam.partitions.bin", "offset": 32768 },
{ "path": "bins/jaam.boot.bin", "offset": 57344 },
{ "path": "bins/jaam.bin", "offset": 65536 }
{ "path": "bins/jaam.bin", "offset": 0 }
]
}
]
Expand Down
4 changes: 2 additions & 2 deletions src/firmware/firmware.ino
Original file line number Diff line number Diff line change
Expand Up @@ -2850,7 +2850,7 @@ String floatToString(float value, int precision = 1) {
return String(result);
}

String addCheckbox(const char* name, int checkboxIndex, bool isChecked, const char* label, char* onChanges = NULL, bool disabled = false) {
String addCheckbox(const char* name, int checkboxIndex, bool isChecked, const char* label, const char* onChanges = NULL, bool disabled = false) {
String html;
html += "<div class='form-group form-check'>";
html += "<input name='";
Expand Down Expand Up @@ -2944,7 +2944,7 @@ String addSliderFloat(const char* name, int sliderIndex, const char* label, floa
return html;
}

String addSelectBox(const char* name, int selectIndex, const char* label, int setting, char* options[], int optionsCount, int (*valueTransform)(int) = NULL, bool disabled = false, int ignoreOptions[] = NULL, char* onChanges = NULL) {
String addSelectBox(const char* name, int selectIndex, const char* label, int setting, char* options[], int optionsCount, int (*valueTransform)(int) = NULL, bool disabled = false, int ignoreOptions[] = NULL, const char* onChanges = NULL) {
String html;
html += label;
html += "<select name='";
Expand Down

0 comments on commit fd2c4f8

Please sign in to comment.