Skip to content

Commit

Permalink
Updated agenda app
Browse files Browse the repository at this point in the history
  • Loading branch information
hnzlmnn committed Jun 3, 2024
1 parent 3ca63b3 commit efd4b0a
Show file tree
Hide file tree
Showing 15 changed files with 560 additions and 58 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/cd-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: >
gh release upload "${{ github.event.release.tag_name }}"
build/TROOPERS23.bin
build/TROOPERS23.elf
build/TROOPERS24.bin
build/TROOPERS24.elf
- name: Dispatch OTA hook
uses: peter-evans/repository-dispatch@v2
Expand All @@ -43,11 +43,11 @@ jobs:
event-type: firmware-release
client-payload: >
{
"device_id": "troopers23",
"device_name": "TROOPERS23",
"device_id": "troopers24",
"device_name": "TROOPERS24",
"tag": "${{ github.event.release.tag_name }}",
"channel": "${{ env.RELEASE_CHANNEL }}",
"fw_main": "TROOPERS23.bin"
"fw_main": "TROOPERS24.bin"
}
- name: Generate release build report
Expand All @@ -60,7 +60,7 @@ jobs:
previous_tag=$(git tag --sort '-refname' | grep -A1 "$tag" | tail -1)
tag_compare_url=$(sed "s!{base}!$previous_tag!; s!{head}!$tag!" <<< $compare_url_template)
build_size_main=$(du build/TROOPERS23.bin | awk '{ print $1 }')
build_size_main=$(du build/TROOPERS24.bin | awk '{ print $1 }')
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
Expand All @@ -72,7 +72,7 @@ jobs:
**Source:** [${repo}@\`${tag}\`](/${repo}/tree/${tag})
## Build details
**Size of \`TROOPERS23.bin\`:** $build_size_main kB
**Size of \`TROOPERS24.bin\`:** $build_size_main kB
\`\`\`console
\$ du -h build/*.bin build/*.elf build/*/*.bin build/*/*.elf
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ jobs:
with:
name: build
path: |
build/TROOPERS23.bin
build/TROOPERS23.elf
build/TROOPERS24.bin
build/TROOPERS24.elf
build/bootloader/bootloader.bin
build/bootloader/bootloader.elf
Expand All @@ -52,7 +52,7 @@ jobs:
head_compare_url: ${{ github.event.compare }}
new_commits_json: ${{ toJSON(github.event.commits) }}
run: |
build_size_main=$(du build/TROOPERS23.bin | awk '{ print $1 }')
build_size_main=$(du build/TROOPERS24.bin | awk '{ print $1 }')
ref_compare_url=$(sed "s/{base}/$base_branch/; s/{head}/$commit_hash/" <<< $compare_url_template)
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
Expand All @@ -62,7 +62,7 @@ jobs:
**Source:** ${{ github.ref_type }} \`$current_ref\` -> [${{ github.repository }}@\`${commit_hash:0:7}\`](${{ github.event.head_commit.url }})
**Size of \`TROOPERS23.bin\`:** $build_size_main kB
**Size of \`TROOPERS24.bin\`:** $build_size_main kB
\`\`\`console
\$ du -h build/*.bin build/*/*.bin
Expand Down
5 changes: 3 additions & 2 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.5)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)

set(PROJECT_NAME "TROOPERS23")
set(PROJECT_VER "1.1.1")
set(PROJECT_NAME "TROOPERS24")
set(PROJECT_VER "1.0.0")

project(${PROJECT_NAME})
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# TROOPERS23 ESP32 firmware: Launcher
# TROOPERS24 ESP32 firmware: Launcher

This repository contains the ESP32 part of the firmware for the TROOPERS23 badge. This firmware allows for device testing, setup, OTA updates and of course launching apps.
This repository contains the ESP32 part of the firmware for the TROOPERS24 badge. This firmware allows for device testing, setup, OTA updates and of course launching apps.

## ESP-IDF and submodules

Expand Down
2 changes: 1 addition & 1 deletion backtrace.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from elftools.elf.elffile import ELFFile


elf = ELFFile(open("build/TROOPERS23.elf", 'rb'))
elf = ELFFile(open("build/TROOPERS24.elf", 'rb'))
symtab = elf.get_section_by_name('.symtab')

for a in x:
Expand Down
1 change: 1 addition & 0 deletions main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ idf_component_register(
${project_dir}/resources/icons/sao.png
${project_dir}/resources/icons/calendar.png
${project_dir}/resources/icons/clock.png
${project_dir}/resources/icons/bookmark.png
${project_dir}/resources/id/id_shield.png
${project_dir}/resources/id/id_ernw.png
${project_dir}/resources/id/id_fucss.png
Expand Down
4 changes: 2 additions & 2 deletions main/factory_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ bool test_sdcard_init(uint32_t* rc) {
return false;
}

char* test_str = "TROOPERS23 TEST";
char* test_str = "TROOPERS24 TEST";
int test_str_len = 15;

fwrite(test_str, 1, test_str_len, test_fd);
fclose(test_fd);

ESP_LOGI(TAG, "Wrote file, trying to read. You should see \"TROOPERS23 TEST\" in the next line");
ESP_LOGI(TAG, "Wrote file, trying to read. You should see \"TROOPERS24 TEST\" in the next line");

test_fd = fopen("/sd/factory_test", "r");
if (test_fd == NULL) {
Expand Down
48 changes: 39 additions & 9 deletions main/file_browser.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,22 @@ static void file_browser_open_file(xQueueHandle button_queue, const char* filena
return;
}

static void file_browser_delete_file(file_browser_menu_args_t* menuArgs) {
pax_buf_t* pax_buffer = get_pax_buffer();
const pax_font_t* font = pax_font_saira_regular;
pax_noclip(pax_buffer);
pax_background(pax_buffer, 0xFFFFFF);

if (menuArgs->type == 'f') {
remove(menuArgs->path);
} else {
pax_draw_text(pax_buffer, 0xFFFF0000, font, 18, 0, 0, "Currently cannot delete directory\n\nPress A or B to go back");
display_flush();
ESP_LOGE(TAG, "Currently cannot delete directory");
wait_for_button();
}
}

void file_browser(xQueueHandle button_queue, const char* initial_path) {
pax_buf_t* pax_buffer = get_pax_buffer();
display_boot_screen("Please wait...");
Expand Down Expand Up @@ -225,6 +241,7 @@ void file_browser(xQueueHandle button_queue, const char* initial_path) {
bool renderbg = true;
bool exit = false;
file_browser_menu_args_t* menuArgs = NULL;
bool delete = false;

while (1) {
keyboard_input_message_t buttonMessage = {0};
Expand All @@ -250,11 +267,17 @@ void file_browser(xQueueHandle button_queue, const char* initial_path) {
}
break;
case BUTTON_ACCEPT:
case BUTTON_SELECT:
if (value) {
menuArgs = menu_get_callback_args(menu, menu_get_position(menu));
}
break;
case BUTTON_SELECT:
case JOYSTICK_PUSH:
if (value && menu_get_position(menu) > 0) {
menuArgs = menu_get_callback_args(menu, menu_get_position(menu));
delete = true;
}
break;
case BUTTON_START:
if (value) exit = true;
break;
Expand All @@ -267,7 +290,7 @@ void file_browser(xQueueHandle button_queue, const char* initial_path) {
pax_background(pax_buffer, 0xFFFFFF);
pax_noclip(pax_buffer);
const pax_font_t* font = pax_font_saira_regular;
pax_draw_text(pax_buffer, 0xFF000000, font, 18, 5, 240 - 19, "🅰 install 🅱 back");
pax_draw_text(pax_buffer, 0xFF000000, font, 18, 5, 240 - 19, "🅰 install 🅱 back 🅴 delete");
renderbg = false;
}

Expand All @@ -278,16 +301,23 @@ void file_browser(xQueueHandle button_queue, const char* initial_path) {
}

if (menuArgs != NULL) {
if (menuArgs->type == 'd') {
strcpy(path, menuArgs->path);
if (delete) {
ESP_LOGD(TAG, "File selected: %c -> %s\n", menuArgs->type, menuArgs->path);
file_browser_delete_file(menuArgs);
break;
} else {
printf("File selected: %s\n", menuArgs->path);
file_browser_open_file(button_queue, menuArgs->path, menuArgs->label);
if (menuArgs->type == 'd') {
strcpy(path, menuArgs->path);
break;
} else {
printf("File selected: %s\n", menuArgs->path);
file_browser_open_file(button_queue, menuArgs->path, menuArgs->label);
}
menuArgs = NULL;
delete = false;
render = true;
renderbg = true;
}
menuArgs = NULL;
render = true;
renderbg = true;
}

if (exit) {
Expand Down
3 changes: 1 addition & 2 deletions main/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,7 @@ _Noreturn void app_main(void) {
stop();
}

// TODO: do we still need this?
// factory_test();
// factory_test();

/* Start AppFS */
res = appfs_init();
Expand Down
Loading

0 comments on commit efd4b0a

Please sign in to comment.