unsigned char lpt_windows::leer(void){ /*** leer un byte en la direccion corriente ***/ int dto = 0, result = 0; /* la funcion leer() devuelve el byte leido */ result = send_byte(LPT_CONTROL, 0x21) == 0; /* bus inter_p = salida + RD */ if(result) dto = recive_byte(LPT_DATA); if(result) send_byte(LPT_CONTROL, 0x24); return(dto); }
void main(void) { usart_init(); ticks_init(); while (1) { delay_ms(100); //test delay and systemclock if (recive_count() > 100) send('!'); uint8_t rx = 0; if (recive_byte(&rx)) send(rx); } }