mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-05 23:49:00 +08:00
Basic UCenter Functions Running
This commit is contained in:
@@ -19,10 +19,21 @@
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#define GPS_UBX_UCENTER_RUNNING 1
|
||||
#define GPX_UBX_UCENTER_STOPPED 0
|
||||
#include "gps_ubx_ucenter.h"
|
||||
|
||||
#define GPS_UBX_UCENTER_STATUS_RUNNING 1
|
||||
#define GPS_UBX_UCENTER_STATUS_STOPPED 0
|
||||
|
||||
#define GPS_UBX_UCENTER_REPLY_NONE 0
|
||||
#define GPS_UBX_UCENTER_REPLY_ACK 1
|
||||
#define GPS_UBX_UCENTER_REPLY_NACK 2
|
||||
|
||||
/** Space Vehicle Information */
|
||||
struct gps_ubx_ucenter_t {
|
||||
uint8_t status;
|
||||
uint8_t reply;
|
||||
} gps_ubx_ucenter;
|
||||
|
||||
uint8_t gps_ubx_ucenter_status
|
||||
|
||||
/////////////////////////////
|
||||
// Periodic Function
|
||||
@@ -30,7 +41,8 @@ uint8_t gps_ubx_ucenter_status
|
||||
void gps_ubx_ucenter_init(void)
|
||||
{
|
||||
// Start UCenter
|
||||
gps_ubx_ucenter_status = GPS_UBX_UCENTER_RUNNING;
|
||||
gps_ubx_ucenter.status = GPS_UBX_UCENTER_STATUS_RUNNING;
|
||||
gps_ubx_ucenter.reply = GPS_UBX_UCENTER_REPLY_NONE;
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +53,7 @@ void gps_ubx_ucenter_init(void)
|
||||
void gps_ubx_ucenter_periodic(void)
|
||||
{
|
||||
// Save processing time inflight
|
||||
if (gps_ubx_ucenter_status == GPX_UBX_UCENTER_STOPPED)
|
||||
if (gps_ubx_ucenter.status == GPS_UBX_UCENTER_STATUS_STOPPED)
|
||||
return;
|
||||
|
||||
// Autobaud
|
||||
@@ -55,18 +67,21 @@ void gps_ubx_ucenter_periodic(void)
|
||||
void gps_ubx_ucenter_event(void)
|
||||
{
|
||||
// Save processing time inflight
|
||||
if (gps_ubx_ucenter_status == GPX_UBX_UCENTER_STOPPED)
|
||||
if (gps_ubx_ucenter_status == GPS_UBX_UCENTER_STATUS_STOPPED)
|
||||
return;
|
||||
|
||||
// Which Message
|
||||
if (gps_ubx.msg_class == UBX_NAV_ID) {
|
||||
if (gps_ubx.msg_id == UBX_NAV_SOL_ID) {
|
||||
}
|
||||
}
|
||||
// Read Configuration Reply's
|
||||
if (gps_ubx.msg_class == UBX_ACK_ID) {
|
||||
if (gps_ubx.msg_id == UBX_ACK_ACK_ID) {
|
||||
gps_status_config++;
|
||||
gps_ubx_ucenter.reply = GPX_UBX_UCENTER_REPLY_ACK;
|
||||
}
|
||||
else
|
||||
{
|
||||
gps_ubx_ucenter.reply = GPX_UBX_UCENTER_REPLY_NACK;
|
||||
}
|
||||
}
|
||||
// Version info
|
||||
else if (gps_ubx.msg_class == UBX_ACK_ID) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -209,7 +224,6 @@ void gps_configure( void ) {
|
||||
}
|
||||
gps_configuring = user_gps_configure(gps_status_config);
|
||||
}
|
||||
#endif /* GPS_CONFIGURE */
|
||||
#endif // GPS_CONFIGURE
|
||||
|
||||
*/
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#ifndef GPS_UBX_UCENTER_H
|
||||
#define GPS_UBX_UCENTER_H
|
||||
|
||||
extern void gps_ubx_ucenter_init(void);
|
||||
extern void gps_ubx_ucenter_periodic(void);
|
||||
extern void gps_ubx_ucenter_event(void);
|
||||
|
||||
|
||||
@@ -388,7 +388,7 @@ void gps_configure( void ) {
|
||||
#endif /* GPS_CONFIGURE */
|
||||
|
||||
#ifdef GPS_UBX_UCENTER
|
||||
#include GPX_UBX_UCENTER
|
||||
#include GPS_UBX_UCENTER
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -78,10 +78,7 @@ extern bool_t gps_configuring;
|
||||
#define GpsParseOrConfigure() gps_ubx_read_message()
|
||||
#endif
|
||||
|
||||
#ifdef GPS_UBX_UCENTER
|
||||
extern void gps_ubx_ucenter_periodic(void);
|
||||
extern void gps_ubx_ucenter_event(void);
|
||||
#else
|
||||
#ifndef GPS_UBX_UCENTER
|
||||
#define gps_ubx_ucenter_event() {}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user