summaryrefslogtreecommitdiff
path: root/cesar/cp/sta/core
diff options
context:
space:
mode:
authorlaranjeiro2009-03-16 17:33:01 +0000
committerlaranjeiro2009-03-16 17:33:01 +0000
commit4ceab307edf82fd3cf4bd6a3d0777bf068985b99 (patch)
tree4d0b1ed52f58cff662ce2a8ed92f758b3a0c4387 /cesar/cp/sta/core
parent63f29b8f2da439b719d11785580e491147bb5324 (diff)
Cesar: (See #161).
* cp/cco/action : Remove the alarm timer for the handover. * cp/sta/action : Remove the alarm timer for the handover. * cp: Added the alarm handover context. * cp/sta/core: Fix the core_alarm_handlver function to cancel the timer before calling the handler. git-svn-id: svn+ssh://pessac/svn/cesar/trunk@4226 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'cesar/cp/sta/core')
-rw-r--r--cesar/cp/sta/core/src/core.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/cesar/cp/sta/core/src/core.c b/cesar/cp/sta/core/src/core.c
index 1b9262ab94..92be195d8f 100644
--- a/cesar/cp/sta/core/src/core.c
+++ b/cesar/cp/sta/core/src/core.c
@@ -402,7 +402,17 @@ cp_sta_core_alarm_handler(cyg_handle_t alarm, cyg_addrword_t data)
dbg_assert(data);
sta_core_alarm = (cp_sta_core_timed_event_def_t *)data;
- dbg_assert(sta_core_alarm->cp_ctx);
+ dbg_assert (sta_core_alarm->cp_ctx);
+ dbg_assert (sta_core_alarm->alarm_handle);
+
+ if (!sta_core_alarm->cyclic_alarm
+ && ((sta_core_alarm->event_flag == CP_STA_CORE_EVENT_FLAG_FSM)
+ || (sta_core_alarm->event_flag == CP_STA_CORE_EVENT_FLAG_GARBAGE)))
+ {
+ cyg_alarm_delete(sta_core_alarm->alarm_handle);
+ // resetting alarm handle (useful for detection by external garbage collector)
+ sta_core_alarm->alarm_handle = (cyg_handle_t)0;
+ }
// depending on elapsed timer, signal sta core wait-event loop
// with relevant core event
@@ -421,15 +431,6 @@ cp_sta_core_alarm_handler(cyg_handle_t alarm, cyg_addrword_t data)
dbg_assert (0);
break;
}
-
- if (!sta_core_alarm->cyclic_alarm
- && ((sta_core_alarm->event_flag == CP_STA_CORE_EVENT_FLAG_FSM)
- || (sta_core_alarm->event_flag == CP_STA_CORE_EVENT_FLAG_GARBAGE)))
- {
- cyg_alarm_delete(sta_core_alarm->alarm_handle);
- // resetting alarm handle (useful for detection by external garbage collector)
- sta_core_alarm->alarm_handle = (cyg_handle_t)0;
- }
}
/**