2014-04-03 14:21:37 -06:00
|
|
|
|
|
|
|
#include <cpu/irq.h>
|
|
|
|
#include <cfg/debug.h>
|
|
|
|
|
|
|
|
#include "afsk.h"
|
|
|
|
|
|
|
|
#include <drv/ser.h>
|
|
|
|
#include <drv/timer.h>
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
static Afsk afsk;
|
|
|
|
static Serial ser;
|
|
|
|
|
|
|
|
#define ADC_CH 0
|
|
|
|
|
|
|
|
static void init(void)
|
|
|
|
{
|
|
|
|
IRQ_ENABLE;
|
|
|
|
kdbg_init();
|
|
|
|
timer_init();
|
|
|
|
|
|
|
|
afsk_init(&afsk, ADC_CH, 0);
|
|
|
|
|
|
|
|
ser_init(&ser, SER_UART0);
|
|
|
|
ser_setbaudrate(&ser, 115200);
|
|
|
|
}
|
|
|
|
|
|
|
|
int main(void)
|
|
|
|
{
|
|
|
|
init();
|
2014-04-03 14:54:34 -06:00
|
|
|
//ticks_t start = timer_clock();
|
2014-04-03 14:21:37 -06:00
|
|
|
|
|
|
|
while (1)
|
|
|
|
{
|
2014-04-03 15:22:15 -06:00
|
|
|
if (!fifo_isempty(&afsk.rxFifo)) {
|
|
|
|
char c = fifo_pop(&afsk.rxFifo);
|
2014-04-03 14:21:37 -06:00
|
|
|
kprintf("%c", c);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
2014-04-03 14:41:49 -06:00
|
|
|
}
|