Skip to content

Commit a223bd1

Browse files
authored
Pacman warning fix (#2298)
* fix missing NULL initializers * fix mispelled OnKeyboad * set header version to 1
1 parent 023cee2 commit a223bd1

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

firmware/application/apps/ui_standalone_view.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ bool StandaloneView::on_touch(const TouchEvent event) {
178178

179179
bool StandaloneView::on_keyboard(const KeyboardEvent event) {
180180
if (get_application_information()->header_version > 1) {
181-
return get_application_information()->OnKeyboad((uint8_t)event);
181+
return get_application_information()->OnKeyboard((uint8_t)event);
182182
}
183183
return false;
184184
}

firmware/common/standalone_app.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ struct standalone_application_information_t {
9898
void (*OnFocus)();
9999
bool (*OnKeyEvent)(uint8_t key);
100100
bool (*OnEncoder)(int32_t delta);
101-
bool (*OnKeyboad)(uint8_t key);
101+
bool (*OnKeyboard)(uint8_t key);
102102
};
103103

104104
#endif /*__UI_STANDALONE_APP_H__*/

firmware/standalone/pacman/main.cpp

+9-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const standalone_application_api_t* _api;
2727

2828
extern "C" {
2929
__attribute__((section(".standalone_application_information"), used)) standalone_application_information_t _standalone_application_information = {
30-
/*.header_version = */ CURRENT_STANDALONE_APPLICATION_API_VERSION,
30+
/*.header_version = */ 1,
3131

3232
/*.app_name = */ "Pac-Man",
3333
/*.bitmap_data = */ {
@@ -70,12 +70,18 @@ __attribute__((section(".standalone_application_information"), used)) standalone
7070
/*.initialize_app = */ initialize,
7171
/*.on_event = */ on_event,
7272
/*.shutdown = */ shutdown,
73-
};
73+
/*PaintViewMirror */ NULL,
74+
/*OnTouchEvent */ NULL,
75+
/*OnFocus */ NULL,
76+
/*OnKeyEvent */ NULL,
77+
/*OnEncoder */ NULL,
78+
/*OnKeyboard */ NULL};
7479
}
7580

7681
/* Implementing abort() eliminates requirement for _getpid(), _kill(), _exit(). */
7782
extern "C" void abort() {
78-
while (true);
83+
while (true)
84+
;
7985
}
8086

8187
// replace memory allocations to use heap from chibios

0 commit comments

Comments
 (0)