Working ping

Biggest problem was definitions in rtimer_arch.h -- we have a 16-bit
rtimer_clock_t so this was overflowing and not working. Therefore most
delays in the radio implementation didn't work.
This commit is contained in:
Ralf Schlatterbeck 2016-05-12 13:51:20 +02:00
parent cb1e085ebf
commit b87ba1f526
8 changed files with 59 additions and 48 deletions

View file

@ -72,9 +72,6 @@ irq_handler(uint32_t irq_mask, uint32_t *regs)
int i;
for (i=0; i<=MAXIRQ; i++) {
if (irq_mask & (1<<i)) {
if (i>0) {
printf ("irq: %d\n", i);
}
if (irq_callback_functions [i] == NULL) {
printf ("Ooops: IRQ without callback: %d\n", i);
} else {
@ -112,14 +109,12 @@ void irq_init(void)
void register_irq (int irq, void (*callback)(void))
{
printf ("register: %d\n", irq);
assert (irq <= MAXIRQ);
irq_callback_functions [irq] = callback;
}
void enable_irq (int irq)
{
printf ("enable: %d\n", irq);
assert (irq <= MAXIRQ);
if (irq_callback_functions [irq] != NULL) {
irqmask &= (~(1<<irq));

View file

@ -35,7 +35,7 @@
#include <sys/clock.h>
#define RTIMER_ARCH_SECOND F_CPU
#define RTIMER_ARCH_SECOND 65536L
#define rtimer_arch_now() (clock_time ())
#define rtimer_arch_now() ((rtimer_clock_t)(clock_time () * 65536 / F_CPU))
#endif /* RTIMER_ARCH_H_ */