/Designs/GPSnavigator/SW/GPS/GPS.c
2,7 → 2,7
demo for LCD NOKIA5110 and MCP9800 and GPS modul
 
CPU ATMEGA644P
fcpu = 1MHz
fcpu = 7372800
 
!! define PIN,PORT,DDR for IOpin !!
*/
11,9 → 11,23
//************************************************************************
// defines
 
#define POINTNAME " DOMOV"
#define MY_LAT 48*60+57.7647
#define MY_LON 14*60+28.0836
 
/*
// 50°7'38.768"N, 13°32'43.132"E
#define POINTNAME " ORACOV"
#define MY_LAT 50*60+7.64613
#define MY_LON 13*60+32.7189
*/
/*
// 50°7'38.768"N, 13°32'43.132"E
#define POINTNAME " ZAMEK"
#define MY_LAT 50*60+6.191
#define MY_LON 13*60+32.118
*/
 
#define KEY_TIME_DEAD 5 //cca 50ms 8*5
//#define KEY_TIME_START_REPEAT 100 //cca 1s
//#define KEY_TIME_REPEAT 20 //cca 240ms
33,7 → 47,7
#define CLOCK5S 255;
#define CLOCK50MS 5
 
#define DEBUG
//#define DEBUG
 
//************************************************************************
//including
167,6 → 181,9
UCSR0B = _BV(RXCIE0) | _BV(RXEN0) | _BV(TXEN0);
 
//*** USART1 *** RX PD2, TX PD3 PC
DDRD |= _BV(PD3);
PORTD &= (~(_BV(PD3)));
 
#ifndef DEBUG
UBRR1 = 95;
#else
173,7 → 190,7
UBRR1 = 3;
#endif
//UCSR0A =
UCSR1B = _BV(RXCIE1) | _BV(RXEN0) | _BV(TXEN1);
UCSR1B = _BV(RXCIE1) | _BV(RXEN1) | _BV(TXEN1);
 
//*** ADC ***
ADMUX = _BV(REFS1) | _BV(MUX0);
255,6 → 272,7
 
ISR(USART1_RX_vect)
{
 
#ifndef DEBUG
UDR0 = UDR1;
#else
270,6 → 288,8
 
ISR(PCINT3_vect)
{
if (USB_PIN) USART_PC_ON;
else USART_PC_OFF;
if (!TL2_INPUT && USB_INPUT)
{
cli();
285,9 → 305,9
}
 
EMPTY_INTERRUPT(INT0_vect)
EMPTY_INTERRUPT(INT2_vect)
EMPTY_INTERRUPT(WDT_vect)
//EMPTY_INTERRUPT(INT0_vect)
//EMPTY_INTERRUPT(INT2_vect)
//EMPTY_INTERRUPT(WDT_vect)
 
//************************************************************************
// delay_ms functions /define fcpu /
885,7 → 905,7
printf("%4.0fm",gps.altitude);
 
gotoxy(7,2);
printf("go home");
printf(POINTNAME);
gotoxy(9,4);
if (temp < 10000)
1198,6 → 1218,7
GPS_OFF;
REF_OFF;
ADC_OFF;
USART_PC_OFF;
delay_ms(1000);
LED_OFF;
N5110_send_command(POWER_DOWN);
1222,6 → 1243,10
if (temp_wiev) temp();
 
}
 
if (USB_PIN) USART_PC_ON;
else USART_PC_OFF;
 
null_variables();
LCD_N5110_INIT();
displ_start();
1324,7 → 1349,8
LCD_N5110_INIT();
 
//set_static_navigation(0);
if (USB_PIN) USART_PC_ON;
else USART_PC_OFF;
stdout = &mystdout;
sei();