10 #define LED4 PORTB_PB4
11 #define LED3 PORTB_PB5
12 #define LED2 PORTB_PB6
13 #define LED1 PORTB_PB7
15 #define KEY1 PORTE_PE6
16 #define KEY2 PORTE_PE5
17 ///#define KEY3 PORTE_PE6
18 //#define KEY4 PORTE_PE7
29 #define FIFO_REN PORTB_PB0
30 #define FIFO_RCLK PORTB_PB1
31 #define FIFO_OE PORTB_PB2
33 #define ADC_OE PORTB_PB3
35 #define FIFO_RS PTT_PTT4
36 #define FIFO_WEN PTT_PTT5
37 #define FIFO_EF PTT_PTT6
39 #define ARM_RDY PTM_PTM0
40 #define ARM_MODE PTM_PTM5
41 #define ARM_CLK PTM_PTM3
42 #define ARM_RCVD PTM_PTM2
44 #define DATA_DDR PTS_PTS3
48 extern unsigned char image_data
[VER
][HOR
];
51 /* **************************************************
52 * Board declared global variables .
53 * PAY ATTENTION to define each one at modified file.
54 * **************************************************/
56 extern byte LINECNT; //Count line numbers while IRQ is enable
57 extern byte FRAMECNT; //Count frame numbers while PJINT is enable
60 extern byte LOFCNT; //Count each LINEACH capture one line
63 extern byte data[LINE][PIEX];
66 extern byte EVNB; // Environment Brightness
67 extern bool KNOCK; // Task communicating
73 INT16U RVS; // Control motor reverse running
77 byte MOD; // Trace Module. LINE:0; 'S'route:1; 'U'route:2;
78 byte STA; // Route stage. Basically 3 Stage will be implemented. 1: head into; 2: in middle; 3: head out
79 byte RQR; // Module change require. Almost occured from 'S' 'U' to LINE
81 int CNT; // Trace central offset in LINE
82 int TOP; // Trace top boundary in LINE
83 byte LFT; // Trace left boundary in PIEX
84 byte RIT; // Trace right boundary in PIEX
96 void transchar(char *);
97 void transchar_n(char *);
98 int transdbg(char *buff
, int size
);
102 void data_proc(void);
106 int feedback(int a, int b, struct pid_data pid);