Added APRS testing function

v0.96 ubseds8
Richard Meadows 2015-06-18 07:00:51 +01:00
rodzic c2dd5ce641
commit 04c183eec0
1 zmienionych plików z 27 dodań i 0 usunięć

Wyświetl plik

@ -272,6 +272,33 @@ void aprs_telemetry(void) {
}
}
/**
* APRS function for use during testing. Not for flight
*/
void aprs_test(void)
{
if (!gps_is_locked()) return; /* Don't bother with no GPS */
while(1) {
struct ubx_nav_posllh pos = gps_get_nav_posllh();
float lat = (float)pos.payload.lat / 10000000.0; // This division is from the gps reciver, not for geofence
float lon = (float)pos.payload.lon / 10000000.0;
uint32_t altitude = pos.payload.height / 1000;
/* Set location */
aprs_set_location(lat, lon, altitude);
/* Set frequency */
telemetry_aprs_set_frequency(144800000);
/* Transmit packet and wait */
telemetry_start(TELEMETRY_APRS, 0xFFFF);
while (telemetry_active()) {
system_sleep();
}
}
}
/**
* Internal initialisation
* =============================================================================