mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-27 23:41:18 +01:00
added some debug output
This commit is contained in:
parent
0aa240a1c0
commit
2527d3d636
@ -24,6 +24,9 @@
|
||||
#include "lifo.h"
|
||||
#include "mutex.h"
|
||||
|
||||
#define ENABLE_DEBUG (0)
|
||||
#include "debug.h"
|
||||
|
||||
#include "hwtimer.h"
|
||||
#include "hwtimer_cpu.h"
|
||||
#include "hwtimer_arch.h"
|
||||
@ -54,6 +57,7 @@ static void hwtimer_releasemutex(void* mutex) {
|
||||
|
||||
void hwtimer_spin(unsigned long ticks)
|
||||
{
|
||||
DEBUG("hwtimer_spin ticks=%lu\n", ticks);
|
||||
unsigned long t = hwtimer_arch_now();
|
||||
|
||||
/**
|
||||
@ -116,6 +120,8 @@ unsigned long hwtimer_now(void)
|
||||
|
||||
void hwtimer_wait(unsigned long ticks)
|
||||
{
|
||||
DEBUG("hwtimer_wait ticks=%lu\n", ticks);
|
||||
|
||||
mutex_t mutex;
|
||||
|
||||
if (ticks <= 6 || inISR()) {
|
||||
@ -142,6 +148,8 @@ void hwtimer_wait(unsigned long ticks)
|
||||
|
||||
static int _hwtimer_set(unsigned long offset, void (*callback)(void*), void *ptr, bool absolute)
|
||||
{
|
||||
DEBUG("_hwtimer_set: offset=%lu callback=%p ptr=%p absolute=%d\n", offset, callback, ptr, absolute);
|
||||
|
||||
if (!inISR()) {
|
||||
dINT();
|
||||
}
|
||||
@ -161,9 +169,11 @@ static int _hwtimer_set(unsigned long offset, void (*callback)(void*), void *ptr
|
||||
timer[n].data = ptr;
|
||||
|
||||
if (absolute) {
|
||||
DEBUG("hwtimer_arch_set_absolute n=%d\n", n);
|
||||
hwtimer_arch_set_absolute(offset, n);
|
||||
}
|
||||
else {
|
||||
DEBUG("hwtimer_arch_set n=%d\n", n);
|
||||
hwtimer_arch_set(offset, n);
|
||||
}
|
||||
|
||||
@ -191,6 +201,7 @@ int hwtimer_set_absolute(unsigned long offset, void (*callback)(void*), void *pt
|
||||
|
||||
int hwtimer_remove(int n)
|
||||
{
|
||||
DEBUG("hwtimer_remove n=%d\n", n);
|
||||
hwtimer_arch_disable_interrupt();
|
||||
hwtimer_arch_unset(n);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user