Skip to content

Commit b90640b

Browse files
committed
Changes:
- GPS power switch off when detecting low volts. - Update "no camera" image. - Add thread sleep in image capture retry sequence.
1 parent ed95350 commit b90640b

File tree

3 files changed

+304
-4
lines changed

3 files changed

+304
-4
lines changed

tracker/software/source/drivers/ov5640.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -743,6 +743,8 @@ uint32_t OV5640_Snapshot2RAM(uint8_t* buffer,
743743
TRACE_INFO("CAM > Image size: %d bytes", size_sampled);
744744
return size_sampled;
745745
}
746+
/* Allow time for other threads. */
747+
chThdSleep(TIME_MS2I(10));
746748
} while(cntr--);
747749
TRACE_ERROR("CAM > No image captured");
748750
return 0;

tracker/software/source/threads/collector.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,13 +131,15 @@ static bool aquirePosition(dataPoint_t* tp, dataPoint_t* ltp,
131131
uint16_t batt = stm32_get_vbat();
132132
if(batt < conf_sram.gps_on_vbat) {
133133
getPositionFallback(tp, ltp, GPS_LOWBATT1);
134+
/* In case GPS was already on power it off. */
135+
GPS_Deinit();
134136
return false;
135137
}
136138

137139
/* Try to switch on GPS. */
138140
if(!GPS_Init()) {
139-
GPS_Deinit();
140141
getPositionFallback(tp, ltp, GPS_ERROR);
142+
GPS_Deinit();
141143
return false;
142144
}
143145
/* If a Pa pressure is set then GPS model depends on BME reading.
@@ -169,9 +171,9 @@ static bool aquirePosition(dataPoint_t* tp, dataPoint_t* ltp,
169171
* Switch off GPS and set fallback position data.
170172
*/
171173

172-
GPS_Deinit();
173174
TRACE_WARN("COLL > GPS acquisition stopped due low battery");
174175
getPositionFallback(tp, ltp, GPS_LOWBATT2);
176+
GPS_Deinit();
175177
return false;
176178

177179
}

0 commit comments

Comments
 (0)