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:
parent
cb1e085ebf
commit
b87ba1f526
8 changed files with 59 additions and 48 deletions
|
@ -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));
|
||||
|
|
|
@ -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_ */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue