Subversion Repositories FlightCtrl

Compare Revisions

Ignore whitespace Rev 722 → Rev 724

/branches/V0.68d Code Redesign killagreg/main.c
60,6 → 60,7
#include "uart.h"
#include "uart1.h"
#include "menu.h"
#include "ubx.h"
#include "fc.h"
#include "rc.h"
#include "analog.h"
114,6 → 115,7
TIMER0_Init();
TIMER2_Init();
USART0_Init();
ubx_init();
if (BoardRelease == 11) USART1_Init();
RC_Init();
ADC_Init();
/branches/V0.68d Code Redesign killagreg/ubx.c
4,7 → 4,6
#include <avr/io.h>
 
#include "uart.h"
#include "timer0.h"
 
// ubx protocol parser state machine
#define UBXSTATE_IDLE 0
26,7 → 25,6
#define UBX_SYNC1_CHAR 0xB5
#define UBX_SYNC2_CHAR 0x62
 
 
typedef struct {
uint32_t ITOW; // ms GPS Millisecond Time of Week
uint8_t GPSfix; // GPSfix Type, range 0..6
106,7 → 104,7
GPSInfo.veleast = GpsVelNed.VEL_E;
GPSInfo.velnorth = GpsVelNed.VEL_N;
GPSInfo.veltop = -GpsVelNed.VEL_D;
GpsPosUtm.Status = PROCESSED; // never update old data
GpsVelNed.Status = PROCESSED; // never update old data
}
if (GpsStatus.Status != INVALID)
{
114,6 → 112,15
}
}
 
void ubx_init(void)
{
GpsStatus.Status = INVALID;
GpsPosLlh.Status = INVALID;
GpsPosUtm.Status = INVALID;
GpsVelNed.Status = INVALID;
GPSInfo.status = INVALID;
}
 
// this function should be called within the UART RX ISR
void ubx_parser(uint8_t c)
{
236,3 → 243,4
 
}
 
 
/branches/V0.68d Code Redesign killagreg/ubx.h
39,6 → 39,9
//here you will find the current gps info
extern GPS_INFO_t GPSInfo; // measured position (last gps record)
 
// initialized the upx parser
extern void ubx_init(void);
 
// this function should be called within the UART RX ISR
extern void ubx_parser(uint8_t c);