Pacman warning fix (#2298)

* fix missing NULL initializers
* fix mispelled OnKeyboad
* set header version to 1
This commit is contained in:
gullradriel 2024-10-14 17:40:29 +02:00 committed by GitHub
parent 023cee2c3c
commit a223bd1f21
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 11 additions and 5 deletions

View File

@ -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;
}

View File

@ -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__*/

View File

@ -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