From 6aec050fc482ce2b2af26302c1a8dbe7c34acd45 Mon Sep 17 00:00:00 2001 From: Christian Mehlis Date: Mon, 16 Dec 2013 11:20:00 +0100 Subject: [PATCH] initialize id and only remove a valid timer --- boards/native/drivers/native-ltc4150.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/boards/native/drivers/native-ltc4150.c b/boards/native/drivers/native-ltc4150.c index 871109e2d9..b1860b242b 100644 --- a/boards/native/drivers/native-ltc4150.c +++ b/boards/native/drivers/native-ltc4150.c @@ -55,7 +55,10 @@ void ltc4150_disable_int(void) { DEBUG("ltc4150_disable_int()\n"); _native_ltc_int_enabled = 0; - hwtimer_remove(_native_ltc_hwtimer_id); + if (_native_ltc_hwtimer_id != -1) { + hwtimer_remove(_native_ltc_hwtimer_id); + _native_ltc_hwtimer_id = -1; + } } /** @@ -84,6 +87,7 @@ void ltc4150_sync_blocking(void) */ void ltc4150_arch_init(void) { + _native_ltc_hwtimer_id = -1; ltc4150_disable_int(); puts("Native LTC4150 initialized.");