kopia lustrzana https://github.com/DL7AD/pecanpico10
Fix: GPS should power off when caller is fixed or ?APRSP
rodzic
df731b68a8
commit
b692c4b01b
|
@ -15,7 +15,7 @@ const conf_t conf_flash_default = {
|
|||
.pos_pri = {
|
||||
.beacon = {
|
||||
.active = true,
|
||||
.cycle = TIME_S2I(60 * 30),
|
||||
.cycle = TIME_S2I(60 * 2),
|
||||
.init_delay = TIME_S2I(0),
|
||||
.fixed = true, // Add lat, lon alt fields when enabling fixed
|
||||
.lat = -337331175, // Degrees (expressed in 1e-7 form)
|
||||
|
@ -38,7 +38,7 @@ const conf_t conf_flash_default = {
|
|||
// Secondary position app
|
||||
.pos_sec = {
|
||||
.beacon = {
|
||||
.active = true,
|
||||
.active = false,
|
||||
.cycle = TIME_S2I(60 * 5), // Beacon interval
|
||||
.init_delay = TIME_S2I(10),
|
||||
.fixed = false
|
||||
|
@ -59,8 +59,8 @@ const conf_t conf_flash_default = {
|
|||
// Primary image app
|
||||
.img_pri = {
|
||||
.svc_conf = {
|
||||
.active = true,
|
||||
.cycle = TIME_S2I(60 * 30),
|
||||
.active = false,
|
||||
.cycle = TIME_S2I(60 * 5),
|
||||
.init_delay = TIME_S2I(60),
|
||||
.send_spacing = TIME_S2I(10)
|
||||
},
|
||||
|
@ -139,7 +139,7 @@ const conf_t conf_flash_default = {
|
|||
// If there is a duration only then it is a run once setup.
|
||||
// The APRS schedule thread terminates and leaves the radio active.
|
||||
// If duration is TIME_INFINITE then the radio stays active while the thread waits forever.
|
||||
.active = true,
|
||||
.active = false,
|
||||
.init_delay = TIME_S2I(20),
|
||||
.cycle = TIME_S2I(60 * 10),
|
||||
.interval = TIME_S2I(60 * 9)
|
||||
|
|
|
@ -127,6 +127,7 @@ static void getPositionFallback(dataPoint_t* tp,
|
|||
* @notapi
|
||||
*/
|
||||
static bool aquirePosition(dataPoint_t* tp, dataPoint_t* ltp,
|
||||
bcn_app_conf_t *config,
|
||||
sysinterval_t timeout) {
|
||||
systime_t start = chVTGetSystemTime();
|
||||
|
||||
|
@ -225,7 +226,8 @@ static bool aquirePosition(dataPoint_t* tp, dataPoint_t* ltp,
|
|||
TRACE_INFO("COLL > Keep GPS switched on because cycle < 60sec");
|
||||
tp->gps_state = GPS_LOCKED2;
|
||||
} else if(conf_sram.gps_onper_vbat != 0
|
||||
&& batt >= conf_sram.gps_onper_vbat) {
|
||||
&& batt >= conf_sram.gps_onper_vbat
|
||||
&& !(config->beacon.fixed || config->run_once)) {
|
||||
TRACE_INFO("COLL > Keep GPS switched on because VBAT >= %dmV",
|
||||
conf_sram.gps_onper_vbat);
|
||||
tp->gps_state = GPS_LOCKED2;
|
||||
|
@ -546,7 +548,7 @@ THD_FUNCTION(collectorThread, arg) {
|
|||
chTimeI2MS(gps_wait_time) / 1000,
|
||||
chTimeI2MS(gps_wait_time) % 1000);
|
||||
|
||||
if(aquirePosition(tp, ltp, gps_wait_time)) {
|
||||
if(aquirePosition(tp, ltp, config, gps_wait_time)) {
|
||||
/* Acquisition succeeded. */
|
||||
if(ltp->gps_state == GPS_TIME) {
|
||||
/* Write the time stamp where RTC was calibrated. */
|
||||
|
@ -590,7 +592,7 @@ THD_FUNCTION(collectorThread, arg) {
|
|||
TRACE_INFO("COLL > Acquire position using GPS for up to %d.%d seconds",
|
||||
chTimeI2MS(gps_wait_fix) / 1000,
|
||||
chTimeI2MS(gps_wait_fix) % 1000);
|
||||
if(aquirePosition(tp, ltp, gps_wait_fix)) {
|
||||
if(aquirePosition(tp, ltp, config, gps_wait_fix)) {
|
||||
if(ltp->gps_state == GPS_TIME) {
|
||||
/* Write the time stamp where RTC was calibrated. */
|
||||
ltp->gps_sats = 0;
|
||||
|
|
Ładowanie…
Reference in New Issue