DisplayAPP_ticker
Diff: DisplayApp.cpp
- Revision:
- 3:693902c86ca0
- Parent:
- 2:b7ffe5216cd7
- Child:
- 4:3c46efbe6d21
--- a/DisplayApp.cpp Fri Sep 16 10:26:16 2016 +0000 +++ b/DisplayApp.cpp Thu May 18 06:50:51 2017 +0000 @@ -68,7 +68,9 @@ if ((pos_x != pos_x_wk) || (pos_y != pos_wk)) { pos_x = pos_x_wk; pos_y = pos_wk; - event.call(); + if (event) { + event.call(); + } } } else { pos_seq = POS_SEQ_INIT; @@ -82,11 +84,9 @@ } } -/* static */void DisplayApp::display_app_process_static(void const * arg) { - ((DisplayApp *)arg)->display_app_process(); -} - -DisplayApp::DisplayApp(osPriority tsk_pri, osPriority init_pri, uint32_t stack_size) : change_pri(tsk_pri), displayThread(DisplayApp::display_app_process_static, (void *)this, init_pri, stack_size) { +DisplayApp::DisplayApp(osPriority tsk_pri, osPriority init_pri, uint32_t stack_size) : change_pri(tsk_pri), displayThread(init_pri, stack_size) { +// displayThread.start(this, &DisplayApp::display_app_process); + displayThread.start(callback(this, &DisplayApp::display_app_process)); } void DisplayApp::SendHeader(uint32_t size) { @@ -198,6 +198,10 @@ return wk_idx; }; +void DisplayApp::SetCallback(Callback<void()> func) { + event = func; +} + int DisplayApp::SendJpeg(uint8_t * buf, uint32_t size) { if (pPcApp == NULL) { return 0;