From 0caee3146b21cfa829eacdd8eccb2b3008aaa745 Mon Sep 17 00:00:00 2001 From: Kazumasa Mitsunari Date: Tue, 29 May 2018 18:00:09 +0900 Subject: Stop timer when endDraw finished Change-Id: I817dc5147e92ca463bc20c7bb54006315e4f217c Signed-off-by: Kazumasa Mitsunari --- src/app.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/app.cpp b/src/app.cpp index 5021c05..c6e342d 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -124,8 +124,10 @@ void App::timerHandler() { unsigned seq = app_list.currentSequenceNumber(); HMI_SEQ_DEBUG(seq, "Timer expired remove Request"); + app_list.req_dump(); app_list.removeRequest(seq); app_list.next(); + app_list.req_dump(); if (app_list.haveRequest()) { this->process_request(); @@ -407,11 +409,11 @@ void App::layout_commit() void App::set_timer(){ HMI_SEQ_DEBUG(app_list.currentSequenceNumber(), "Timer set activate"); - if (timer_ev_src != nullptr) + if (timer_ev_src == nullptr) { // firsttime set into sd_event int ret = sd_event_add_time(afb_daemon_get_event_loop(), &timer_ev_src, - CLOCK_REALTIME, time(NULL) + TIME_OUT, 0, processTimerHandler, this); + CLOCK_REALTIME, time(NULL) * (1000000UL) + TIME_OUT, 0, processTimerHandler, this); if (ret < 0) { HMI_ERROR("wm", "Could't set timer"); @@ -420,7 +422,7 @@ void App::set_timer(){ else { // update timer limitation after second time - sd_event_source_set_time(timer_ev_src, time(NULL) + TIME_OUT); + sd_event_source_set_time(timer_ev_src, time(NULL) * (1000000UL) + TIME_OUT); sd_event_source_set_enabled(timer_ev_src, SD_EVENT_ONESHOT); } } @@ -990,6 +992,8 @@ void App::api_enddraw(char const *appid, char const *drawing_name) //this->stop_timer(); this->do_enddraw(current_seq); + this->stop_timer(); + app_list.removeRequest(current_seq); HMI_SEQ_INFO(current_seq, "Finish request"); app_list.next(); -- cgit 1.2.3-korg