2019-05-22 07:47:04 +00:00
|
|
|
#include <fomu/csr.h>
|
2019-05-22 07:02:00 +00:00
|
|
|
#include <irq.h>
|
|
|
|
#include <usb.h>
|
|
|
|
#include <time.h>
|
|
|
|
#include <rgb.h>
|
|
|
|
#include <spi.h>
|
2019-05-22 07:47:04 +00:00
|
|
|
#include <tester.h>
|
|
|
|
#include <usb-cdc.h>
|
2019-05-22 07:02:00 +00:00
|
|
|
|
|
|
|
struct ff_spi *spi;
|
|
|
|
|
|
|
|
void isr(void)
|
|
|
|
{
|
|
|
|
unsigned int irqs;
|
|
|
|
|
|
|
|
irqs = irq_pending() & irq_getmask();
|
|
|
|
|
|
|
|
if (irqs & (1 << USB_INTERRUPT))
|
|
|
|
usb_isr();
|
|
|
|
}
|
|
|
|
|
|
|
|
static void init(void)
|
|
|
|
{
|
|
|
|
rgb_init();
|
2019-05-23 01:51:45 +00:00
|
|
|
spi_init();
|
2019-05-22 07:02:00 +00:00
|
|
|
irq_setmask(0);
|
|
|
|
irq_setie(1);
|
|
|
|
usb_init();
|
|
|
|
time_init();
|
|
|
|
}
|
|
|
|
|
|
|
|
int main(int argc, char **argv)
|
|
|
|
{
|
|
|
|
(void)argc;
|
|
|
|
(void)argv;
|
|
|
|
|
|
|
|
init();
|
|
|
|
|
|
|
|
usb_connect();
|
|
|
|
while (1)
|
|
|
|
{
|
|
|
|
usb_poll();
|
2019-05-22 07:26:27 +00:00
|
|
|
if (cdc_connected()) {
|
|
|
|
tester_poll();
|
|
|
|
}
|
2019-05-22 07:02:00 +00:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|