Exemple #1
0
/** Returns 0 if the device initalizes correctly, 0xFF if not */
uint8_t GPS_Init(void)
{

	//Set up PORT C pin 7 for enabling the antenna bias
	DDRC |= (1<<6)|(1<<7);
	GPS_SetBias(0);		//Bias is off
	GPS_Reset(1);		//GPS is reset

	//Set up UART
	UARTinit();
	
	return 0x00;
}
int main(void)
{   

	
	 cfgPorts();
	 UARTinit();
	 initLCD();
	 sendCode(nIns,0x80);
	
	for(;;) {	
		
		if(UART0_S1 & 0x20)
				{
					DT = UART0_D;
					sendCode(nData,DT);
				}
	
	}
	
	return 0;
}
int main(void)
{
    cfgPortPS2();
    cfgPortsLCD();
    teclado = 0;
    memory = 0;
    mayus = 0;
    pos = 0;
    shift = 0;
    page = 0;
    uart = 0;
    UARTinit();
    sendCode(nIns,0x0D);
    for(place=0; place <= 255; place++)
    {
        LCD[place]= ' ';
    }
    writting = 0;
    for(;;)
    {
        teclado_use();
        if (writting)
        {
            LCD_use();
            writting = 0;
        }
        if (uart)
        {
            UARTsend();
            uart = 0;
        }

    }

    return 0;
}