1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

added missing timer remove on the end of the measurement

This commit is contained in:
Christian Mehlis 2013-12-10 22:18:15 +01:00
parent df5ac883e1
commit ed4ed963ce

View File

@ -31,6 +31,7 @@
#define native_ltc4150_startup_delay 10
static int _int_enabled;
static int hwtimer_id;
/**
* native ltc4150 hwtimer - interrupt handler proxy
@ -40,9 +41,10 @@ static void _int_handler()
DEBUG("ltc4150 _int_handler()\n");
ltc4150_interrupt();
if (_int_enabled == 1) {
if (hwtimer_set(100000, _int_handler, NULL) == -1) {
hwtimer_id = hwtimer_set(100000, _int_handler, NULL);
if (hwtimer_id == -1) {
errx(1, "_int_handler: hwtimer_set");
};
}
}
}
@ -53,6 +55,7 @@ void ltc4150_disable_int(void)
{
DEBUG("ltc4150_disable_int()\n");
_int_enabled = 0;
hwtimer_remove(hwtimer_id);
}
/**
@ -62,9 +65,10 @@ void ltc4150_enable_int(void)
{
DEBUG("ltc4150_enable_int()\n");
_int_enabled = 1;
if (hwtimer_set(100000, _int_handler, NULL) == -1) {
hwtimer_id = hwtimer_set(100000, _int_handler, NULL);
if (hwtimer_id == -1) {
errx(1, "ltc4150_enable_int: hwtimer_set");
};
}
}
/**