Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

application: asset_tracker: save power by triggering GPS update on motion #1902

Merged
merged 2 commits into from
Feb 21, 2020

Conversation

plskeggs
Copy link
Contributor

Add GPS_START_ON_MOTION to asset_tracker/Kconfig (default y for Thingy:91).
Add GPS_CONTROL_FIX_CHECK_OVERDUE to gps_controller/Kconfig; to be set longer
than *_INTERVAL value. Use GPS_START_ON_MOTION to conditionally change gps
reporting interval in gps_controller. Add motion_activity_state_t to motion.h.
Rewrite motion_handler() in main.c to detect activity/inactivity state.
Change structure of it to allow triggering of GPS at end. Add new function
motion_trigger_gps() to trigger GPS no faster than shorter
GPS_CONTROL_FIX_CHECK_INTERVAL on motion, otherwise revert to new *_OVERDUE
value to save power. Enhance gps_controller.c to keep track of most recent
time the GPS unit was powered. Use most recent time powered in
motion_trigger_gps() to ensure GPS not triggered immediately on every
movement (which hurts power consumption).

@NordicBuilder
Copy link
Contributor

NordicBuilder commented Feb 15, 2020

All checks are passing now.

checkpatch (informational only, not a failure)

No additional types will be considered - file 'scripts/checkpatch/typedefsfile': No such file or directory
-:490: WARNING:NEW_TYPEDEFS: do not add new typedefs
#490: FILE: applications/asset_tracker/src/motion/motion.h:36:
+typedef enum {

- total: 0 errors, 1 warnings, 443 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

Your patch has style problems, please review.

NOTE: Ignored message types: AVOID_EXTERNS BRACES CONFIG_EXPERIMENTAL CONST_STRUCT DATE_TIME FILE_PATH_CHANGES MINMAX MULTISTATEMENT_MACRO_USE_DO_WHILE NETWORKING_BLOCK_COMMENT_STYLE PRINTK_WITHOUT_KERN_LEVEL SPLIT_STRING VOLATILE

NOTE: If any of the errors are false positives, please report
      them to the maintainers.

Tip: The bot edits this comment instead of posting a new one, so you can check the comment's history to see earlier messages.

@plskeggs plskeggs force-pushed the feature-motion-triggered-gps branch 2 times, most recently from d2dd646 to ea6b40b Compare February 15, 2020 01:35
Copy link
Contributor

@rlubos rlubos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just a few nits.

@plskeggs plskeggs force-pushed the feature-motion-triggered-gps branch from ea6b40b to b898c94 Compare February 18, 2020 21:45
@plskeggs plskeggs force-pushed the feature-motion-triggered-gps branch 2 times, most recently from 338abae to af26581 Compare February 19, 2020 22:08
@plskeggs
Copy link
Contributor Author

It's unclear to me why the Jenkins job has failed. There is no useful information I can glean from it to act on.

…tion

Add GPS_CONTROL_FIX_CHECK_OVERDUE to gps_controller/Kconfig; to be set
longer than *_INTERVAL value. Use GPS_START_ON_MOTION to conditionally
change gps reporting interval in gps_controller. Add
motion_activity_state_t to motion.h. Rewrite motion_handler() in main.c
to detect activity/inactivity state. Change structure of it to allow
triggering of GPS at end. Add new function motion_trigger_gps() to
trigger GPS no faster than shorter GPS_CONTROL_FIX_CHECK_INTERVAL on
motion, otherwise revert to new *_OVERDUE value to save power. Enhance
gps_controller.c to keep track of most recent time the GPS unit was
powered. Use most recent time powered in motion_trigger_gps() to ensure
GPS not triggered immediately on every movement (which hurts power
consumption).

Jira:TG91-7

Signed-off-by: Pete Skeggs <peter.skeggs@nordicsemi.no>
During code review it was noticed that many of the Kconfig help text
sections in this file do not follow the indenting standard of one
tab plus two spaces.  This commit makes them all follow the rule.

Signed-off-by: Pete Skeggs <peter.skeggs@nordicsemi.no>
@plskeggs plskeggs force-pushed the feature-motion-triggered-gps branch from af26581 to 9b97122 Compare February 20, 2020 19:36
@SebastianBoe SebastianBoe merged commit 9f79717 into nrfconnect:master Feb 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants