From a223bd1f210eee4a585fe98ddc257a9802989c49 Mon Sep 17 00:00:00 2001 From: gullradriel <3157857+gullradriel@users.noreply.github.com> Date: Mon, 14 Oct 2024 17:40:29 +0200 Subject: [PATCH] Pacman warning fix (#2298) * fix missing NULL initializers * fix mispelled OnKeyboad * set header version to 1 --- firmware/application/apps/ui_standalone_view.cpp | 2 +- firmware/common/standalone_app.hpp | 2 +- firmware/standalone/pacman/main.cpp | 12 +++++++++--- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/firmware/application/apps/ui_standalone_view.cpp b/firmware/application/apps/ui_standalone_view.cpp index d099e16c..5fc1e229 100644 --- a/firmware/application/apps/ui_standalone_view.cpp +++ b/firmware/application/apps/ui_standalone_view.cpp @@ -178,7 +178,7 @@ bool StandaloneView::on_touch(const TouchEvent event) { bool StandaloneView::on_keyboard(const KeyboardEvent event) { if (get_application_information()->header_version > 1) { - return get_application_information()->OnKeyboad((uint8_t)event); + return get_application_information()->OnKeyboard((uint8_t)event); } return false; } diff --git a/firmware/common/standalone_app.hpp b/firmware/common/standalone_app.hpp index b2b455b2..6d8cfe9f 100644 --- a/firmware/common/standalone_app.hpp +++ b/firmware/common/standalone_app.hpp @@ -98,7 +98,7 @@ struct standalone_application_information_t { void (*OnFocus)(); bool (*OnKeyEvent)(uint8_t key); bool (*OnEncoder)(int32_t delta); - bool (*OnKeyboad)(uint8_t key); + bool (*OnKeyboard)(uint8_t key); }; #endif /*__UI_STANDALONE_APP_H__*/ diff --git a/firmware/standalone/pacman/main.cpp b/firmware/standalone/pacman/main.cpp index 4ef787f7..79dfe52b 100644 --- a/firmware/standalone/pacman/main.cpp +++ b/firmware/standalone/pacman/main.cpp @@ -27,7 +27,7 @@ const standalone_application_api_t* _api; extern "C" { __attribute__((section(".standalone_application_information"), used)) standalone_application_information_t _standalone_application_information = { - /*.header_version = */ CURRENT_STANDALONE_APPLICATION_API_VERSION, + /*.header_version = */ 1, /*.app_name = */ "Pac-Man", /*.bitmap_data = */ { @@ -70,12 +70,18 @@ __attribute__((section(".standalone_application_information"), used)) standalone /*.initialize_app = */ initialize, /*.on_event = */ on_event, /*.shutdown = */ shutdown, -}; + /*PaintViewMirror */ NULL, + /*OnTouchEvent */ NULL, + /*OnFocus */ NULL, + /*OnKeyEvent */ NULL, + /*OnEncoder */ NULL, + /*OnKeyboard */ NULL}; } /* Implementing abort() eliminates requirement for _getpid(), _kill(), _exit(). */ extern "C" void abort() { - while (true); + while (true) + ; } // replace memory allocations to use heap from chibios