projects
/
bertos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cpu: Split frame handling macros to the new header cpu/frame.h
[bertos.git]
/
bertos
/
emul
/
timer_qt.c
diff --git
a/bertos/emul/timer_qt.c
b/bertos/emul/timer_qt.c
index 204b22dc40e2e4796da19a15ec325af1713e14a1..7c2a0c34d23cd9345c6b11a11b633f1ac551c878 100644
(file)
--- a/
bertos/emul/timer_qt.c
+++ b/
bertos/emul/timer_qt.c
@@
-88,12
+88,23
@@
public:
system_time.start();
// Activate timer interrupt
system_time.start();
// Activate timer interrupt
-
timer.connect(&timer, SIGNAL(timeout()), this
, SLOT(timerInterrupt()));
+
connect(&timer, SIGNAL(timeout())
, SLOT(timerInterrupt()));
timer.start(1000 / TIMER_TICKS_PER_SEC);
initialized = true;
}
timer.start(1000 / TIMER_TICKS_PER_SEC);
initialized = true;
}
+ void cleanup()
+ {
+ // Timer cleaned twice?
+ ASSERT(initialized);
+
+ timer.stop();
+ timer.disconnect();
+
+ initialized = false;
+ }
+
/// Return current time in high-precision format.
hptime_t hpread()
{
/// Return current time in high-precision format.
hptime_t hpread()
{
@@
-116,10
+127,14
@@
public slots:
/// HW dependent timer initialization.
static void timer_hw_init(void)
{
/// HW dependent timer initialization.
static void timer_hw_init(void)
{
- // Kick EmulTimer initialization
EmulTimer::instance().init();
}
EmulTimer::instance().init();
}
+static void timer_hw_cleanup(void)
+{
+ EmulTimer::instance().cleanup();
+}
+
INLINE hptime_t timer_hw_hpread(void)
{
return EmulTimer::instance().hpread();
INLINE hptime_t timer_hw_hpread(void)
{
return EmulTimer::instance().hpread();