#include "cyc_cnt.h"
#include "eth.h"
#include "lcd.h"
#include "leds.h"
#include "uart.h"
#include "switches.h"
//#define CFG_SIMULATION
#define CFG_UART
#ifdef CFG_SIMULATION
# define CFG_UART_CHK
#else
# define CFG_DELAY
# define CFG_ETH
# define CFG_LCD
#endif
const int myconst = 0x12345678;
int myvar = 0x11223344;
volatile int data[100];
void switches(void)
{
#ifdef CFG_LCD
lcd_chr(1, 0, switches_get_state(sw_0) ? '0' : ' ');
lcd_chr(1, 1, switches_get_state(sw_1) ? '1' : ' ');
lcd_chr(1, 2, switches_get_state(sw_2) ? '2' : ' ');
lcd_chr(1, 3, switches_get_state(sw_3) ? '3' : ' ');
lcd_chr(1, 4, switches_get_state(sw_east) ? 'E' : ' ');
lcd_chr(1, 5, switches_get_state(sw_north) ? 'N' : ' ');
lcd_chr(1, 6, switches_get_state(sw_south) ? 'S' : ' ');
lcd_chr(1, 7, switches_get_state(sw_west) ? 'W' : ' ');
lcd_chr(1, 8, switches_get_state(sw_center) ? 'C' : ' ');
lcd_chr(1, 9, switches_get_state(sw_rot_a) ? 'a' : ' ');
lcd_chr(1, 10, switches_get_state(sw_rot_b) ? 'b' : ' ');
#endif
#ifdef CFG_LCD
unsigned int cnt = switches_get_rot_cnt();
lcd_chr(1, 12, '0' + (cnt >> 9 & 0x7));
lcd_chr(1, 13, '0' + (cnt >> 6 & 0x7));
lcd_chr(1, 14, '0' + (cnt >> 3 & 0x7));
lcd_chr(1, 15, '0' + (cnt & 0x7));
#endif
}
void delay(void)
{