コード例 #1
0
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);
}
コード例 #2
0
ファイル: main.c プロジェクト: Mirn/Boot_F4_fast_uart
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);
	}
}