k4be
pushed to master at k4be/GPStracker
05050f4e7e ds18b20: re-arm poll timer even with no sensor present
gettemp() returned early when _1WireInit() found no presence pulse
(no sensor, or a bus short), before reaching the
atomic_set_uint(&System.timers.owire, ...) call at the end that
re-arms the 4s poll interval. With no sensor ever connected, this
timer never gets set at all, so gettemp() (and its ~1ms delay plus a
~960us interrupts-disabled 1-Wire init pulse) runs on every single
main loop pass instead of once per 4 seconds.
Bad CRC and the power-on-reset scratchpad default (85.0C, still in
place if a conversion never completed) were already handled
correctly - both fall through to the normal error-counting and
timer-rearming path since they only skip the point where
temp_ok_out is set to 1, not the whole function.
a8bbc3b3f4 add soft/common.h to stop duplicating structs between builds
struct system_s/location_s/config_s/auto_pause_s, and the value
constants their fields hold, were maintained as separate, hand-synced
copies in soft/main.h (embedded) and gps-test-tool/main.h (PC test
tool) - every field added to one needed a matching edit to the other,
and this session hit that gap repeatedly (missing fields causing build
failures, a stale REJECT_REASON_ALTDIFF, etc). Move the shared
definitions into a new soft/common.h both sides include.
While consolidating, found two real, silent mismatches this had
already caused:
- CONFFLAG_* meant different things on each side: embedded's
get_flag()/set_flag() (settings.c) treat the value as a bit index
into System.conf.flags[4], but the PC build's get_flag() treated it
as an already-shifted bitmask, with its own separately-numbered
constants that didn't include CONFFLAG_LOGGING_AFTER_BOOT - shifting
every flag after it out of alignment with embedded's real indices.
Rewrote the PC build's get_flag()/set_flag() to index
System.conf.flags the same way as embedded, and dropped the
redundant config_flags global.
- LOC_VALID/LOC_VALID_NEW were swapped (1/2 vs 2/1) between the two
copies - harmless only because both sides always compared by name,
never by raw value.
Also removed gps-test-tool/avr_compat.h, an unused, out-of-date
predecessor of the same idea (nothing included it - confirmed via
grep - so it had drifted independently and silently for a while).
b3ac3670d7 autopause: manual resume didn't clear an active auto-pause
auto_pause_process() only forces tracking_auto_paused off while
tracking_paused is true (so an active auto-pause is dropped the
instant a manual pause starts), but that guard never fires the other
way around: manually resuming (tracking_paused -> 0) while auto-pause
was also active left tracking_auto_paused set. tracking_is_paused()
(tracking_paused || tracking_auto_paused) would then still report
paused, and the logger stayed silently paused until the
speed/distance-based auto-resume condition was separately satisfied -
well after the user asked to resume, with no indication why.
Add auto_pause_clear_manual_resume() (no log/beep - the manual resume
already has its own), called from tracking_pause() whenever the
manual-pause transition to resumed also needs to drop an auto-pause
that was riding along with it.
949903cef6 autopause: reset stationary-time counter on a fix gap
auto_pause.point_counter (the running count towards auto_pause_time)
was never reset when a fix was lost and reacquired - it just kept
counting through the gap, with no visibility into how long the gap
was or whether the device kept moving during it. Reacquiring a fix
that was lost while genuinely moving could then satisfy the
stationary-time threshold within moments of regaining signal, using
mostly pre-gap progress towards a threshold meant to require
persistent, continuous stationary time.
Verified against a real ~7.5 minute signal-loss log: point_counter was
frozen at a near-complete count going into the gap, and only needed a
handful of post-reacquisition points to reach auto_pause_time and
trigger a pause.
Share fix-gap detection (previously private to gpx.c) via a new
fix_gap_detected() in main.c, called once per accepted point before
both auto_pause_process() (new auto_pause_reset_gap(): resets
point_counter/speed_counter/prev_distance, and re-anchors the
resume-by-distance check if already paused) and gpx_process_point()
(gpx_reset_gap(), unchanged in behavior, just extracted so both
callers share one gap check instead of gpx.c silently owning it).
e201aacb8a add paused/skipped/accepted point counters to summaries
Points processed only showed the total; there was no visibility into
how a session's points broke down (during a pause, dropped by the
skip_points warm-up, rejected, sitting in the averaging window, or
actually saved), which made diagnosing filter/pause behavior harder
than it needed to be. Track System.points_paused/points_skipped/
points_accepted, and print them (plus the existing rejected_count and
points_written) in both the test tool's own summary and the firmware's
periodic SUMMARY log line.
- View comparison for these 13 commits »
3 weeks ago