char get_uart_input(void)
{
char c = 0;
u32 start= 0;
start = get_sys_ticks();
while(1)
{
if(sunxi_serial_tstc())
{
c = sunxi_serial_getc();
pr_force("key press : %c\n", c);
break;
}
/* test time: 10 ms */
if(get_sys_ticks()- start > 10)
{
break;
}
__usdelay(500);
}
return c;
}
void wait_user_input( int stamp )
{
char c;
printf( "stamp %d, press any key to continue...\n", stamp );
while(1){
c = get_uart_input();
if( c != 0 ){
break;
}
}
}