From 6dc7e3dfc532eabd47cdc7ca268cc7088bc27f34 Mon Sep 17 00:00:00 2001 From: Brumi-2021 <86470699+Brumi-2021@users.noreply.github.com> Date: Thu, 15 Aug 2024 19:31:34 +0200 Subject: [PATCH] Needed_changes_to_compile_with_gcc_13.2.1 (#2224) * Needed_changes_to_compile_with_gcc_13.2.1 * re-activate_length_binary_size_protect --- firmware/application/event_m0.cpp | 2 ++ firmware/tools/export_external_apps.py | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/firmware/application/event_m0.cpp b/firmware/application/event_m0.cpp index 2f9478709..82f0e6bde 100644 --- a/firmware/application/event_m0.cpp +++ b/firmware/application/event_m0.cpp @@ -281,6 +281,7 @@ void EventDispatcher::emulateTouch(ui::TouchEvent event) { while (injected_touch_event != nullptr) { chThdSleepMilliseconds(5); } + injected_touch_event = nullptr; // to clean event_mo.cpp, compile warning error : "storing the address of local variable 'event' in 'this_4(D)->injected_touch_event' [-Wdangling-pointer=]" } void EventDispatcher::emulateKeyboard(ui::KeyboardEvent event) { @@ -288,6 +289,7 @@ void EventDispatcher::emulateKeyboard(ui::KeyboardEvent event) { while (injected_keyboard_event != nullptr) { chThdSleepMilliseconds(5); } + injected_keyboard_event = nullptr; // to clean event_mo.cpp, compile warning error : "storing the address of local variable 'event' in 'this_4(D)->injected_keyboard_event' [-Wdangling-pointer=]" } void EventDispatcher::on_keyboard_event(ui::KeyboardEvent event) { diff --git a/firmware/tools/export_external_apps.py b/firmware/tools/export_external_apps.py index b187eddb7..f0216a6d3 100755 --- a/firmware/tools/export_external_apps.py +++ b/firmware/tools/export_external_apps.py @@ -55,8 +55,12 @@ def write_image(data, path): def patch_image(path, image_data, search_address, replace_address): if (len(image_data) % 4) != 0: - print("file size not divideable by 4") - sys.exit(-1) + #sys.exit(-1) + print("\n External App image file:", path, ", size not divideable by 4 :", len(image_data)) + j=0 + while (len(image_data) % 4) != 0: + image_data += b'\x00' ; j+=1 + print("file size:", len(image_data)," after padded:",j, "bytes") external_application_image = bytearray()