-
Notifications
You must be signed in to change notification settings - Fork 43
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
Tidy up various code (main, gps) #34
Open
tormodvolden
wants to merge
39
commits into
dragino:master
Choose a base branch
from
tormodvolden:tidy
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This reverts commit 9e15412. The commit had inadvertently reverted many previous changes and also contains several independent changes, some of which are not necessary.
This file doesn't need to be under revision control.
Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
The current firmware is using the three flash pages at 0x08018F80, 0x08019000, and 0x08019080 for storing settings. Lay out the firmware so that a hole at 0x08018800 - 0x0801A000 is reserved for settings. Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
Improve variable scope and names, and use integer calculation. This rework shouldn't change the resulting values. Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
A constant or macro with a good name could be better. Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
We don't need so many timestamps. Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
The function was doing many things apart from debug printing, so rename it and move some parts to the caller for better readability. Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
And use AT_PRINTF consistently otherwise. Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
Check if any buffers were updated, not only the last. Only dump buffers if any of them were updated. Allow LOGGPS levels higher than 1. Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
Use the non-polling PRINTF which might lose data if it gets too busy, but is also less prone to affect operation. Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
Print UTC time instead of hard-coded +0800 local time. Also print all timestamp elements with 2 digits, and make latitude and longitude output consistent. Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
The most important location data on one line. Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
This has currently higher risk of deadlocking but is also necessary to not miss debug info. Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
Each word is checked against NULL in GPS_parse() but if a field is missing, split() would return a valid pointer to a zero-length string. The subsequent parsing with sscanf() would yield random coordinates calculated from uninitialized stack variables. By returning NULL instead of an empty string, we'll match the logic in gps_parse() and the exisiting checks will work correctly. Fixes dragino#26 Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
Avoid using uninitialized values in coordinate calculation due to incomplete data strings. Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
The buffer overflow is guarded against already. This code was randomly deleting sentences every 255 characters - about every fourth sentence. Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
This simplifies the check() function and further parsing. Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
The newly added changes also fix serious bugs, such as #26. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
These changes should not affect the functionality at all, and are mostly "cosmetic" code cleanup. Only the debug output concerning GPS will have some visible changes. And there is a new debug feature: GPS raw data output with
AT+LOGGPS=2
.