ARM9教程DSP教程FPGA教程CPLD教程12A软硬件设计0229
void main( void ) {
unsigned char c = 0; unsigned int k = 0;
char str_input[STRING_SIZE]; char str_read_cmd[] = "-read"; char str_write_cmd[] = "-write";
initialize();
output_welcome();
while (1) {
output_instructions();
gets( str_input );
if ( strncmp(str_input, str_write_cmd, 6) == 0 ) {
c = getchar(); while ( c != ESC ) {
GPIO_LED( Base_GPIO ) = c; c = getchar(); } }
else if ( strncmp(str_input, str_read_cmd, 5) == 0 ) {
gets( str_input ); puts( str_input );