Skip to content

Commit

Permalink
Pacman warning fix (#2298)
Browse files Browse the repository at this point in the history
* fix missing NULL initializers
* fix mispelled OnKeyboad
* set header version to 1
  • Loading branch information
gullradriel authored Oct 14, 2024
1 parent 023cee2 commit a223bd1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion firmware/application/apps/ui_standalone_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion firmware/common/standalone_app.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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__*/
12 changes: 9 additions & 3 deletions firmware/standalone/pacman/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 = */ {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a223bd1

Please sign in to comment.