-
Notifications
You must be signed in to change notification settings - Fork 41
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
no_std
#41
no_std
#41
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Dushistov @hargoniX would any of you be able to take a look at this PR too?
Some of the changes actually broke the parse, I took the code and fixed almost all the issues. |
fix bugs with `heapless` rewrite & cleanup
I made a few improvements on the |
functional_tests - improve readability and use vec & no_std attribute
Having the same satellite in the
|
Ok, I found the problem @patrickoppel. You forgot to |
- revert functional_tests data
If it can contain multiple satellites twice the total number of satellites in view can be a lot higher than what we set now |
This should actually be ready now: Fixed the test data and the missing |
No std test fix & last `no_std` preparations
Codecov Report
@@ Coverage Diff @@
## master #41 +/- ##
==========================================
+ Coverage 87.12% 88.21% +1.08%
==========================================
Files 15 15
Lines 1212 1222 +10
==========================================
+ Hits 1056 1078 +22
+ Misses 156 144 -12
Continue to review full report at Codecov.
|
@@ -72,7 +72,7 @@ pub struct Nmea { | |||
pub pdop: Option<f32>, | |||
/// Geoid separation in meters | |||
pub geoid_separation: Option<f32>, | |||
pub fix_satellites_prns: Option<Vec<u32>>, | |||
pub fix_satellites_prns: Option<Vec<u32, 12>>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose it should be 58, but it can wait until we can teach this crate to merge GSA messages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, Can you also provide some info on this merging?
pub fn satellites(&self) -> Vec<Satellite> { | ||
let mut ret = Vec::with_capacity(20); | ||
/// Returns used satellites | ||
pub fn satellites(&self) -> Vec<Satellite, 58> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice if 58 become constant with comment why exactly 58.
And it would be nice to replace 15 with constant time expression that calculate it from 58 in SatsPack.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know what the limits are for these 2 values tbh and I feel more comfortable gradually improving them.
I feel that the code might get more complex especially with the public API and those constant values.
I think we can improve the API a lot and see how we can do the merging of the messages you mentioed.
let sat_key = |sat: &Satellite| (sat.gnss_type() as u8, sat.prn()); | ||
for sns in &self.satellites_scan { | ||
for sat_pack in sns.data.iter().rev() { | ||
for sat in sat_pack.iter().flatten() { | ||
// for sat_pack in sns.data.iter().rev() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not remove dead code?
O: core::fmt::Debug, | ||
{ | ||
move |mut i: I| { | ||
// let mut acc = crate::lib::std::vec::Vec::with_capacity(4); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dead code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dead but this is the original nom code. I think it would be good to leave it as it is.
I wonder to see logs of GPS receiver that can work with L1 and L2(C) at the same time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder to see logs of GPS receiver that can work with L1 and L2(C) at the same time.
Would they give the same PRN in one GSA message?
I don't know actually. Maybe if a problem arises we can fix it in the library or if we can find this information somewhere?
O: core::fmt::Debug, | ||
{ | ||
move |mut i: I| { | ||
// let mut acc = crate::lib::std::vec::Vec::with_capacity(4); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dead but this is the original nom code. I think it would be good to leave it as it is.
@@ -72,7 +72,7 @@ pub struct Nmea { | |||
pub pdop: Option<f32>, | |||
/// Geoid separation in meters | |||
pub geoid_separation: Option<f32>, | |||
pub fix_satellites_prns: Option<Vec<u32>>, | |||
pub fix_satellites_prns: Option<Vec<u32, 12>>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, Can you also provide some info on this merging?
pub fn satellites(&self) -> Vec<Satellite> { | ||
let mut ret = Vec::with_capacity(20); | ||
/// Returns used satellites | ||
pub fn satellites(&self) -> Vec<Satellite, 58> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know what the limits are for these 2 values tbh and I feel more comfortable gradually improving them.
I feel that the code might get more complex especially with the public API and those constant values.
I think we can improve the API a lot and see how we can do the merging of the messages you mentioed.
I wouldn't expect them to. If I remember it right, dual band allows the receiver to increase the accuracy of the satellites' positions. So it would still use the same number of satellites and return them in the GSA |
I think this is good enough for now. If any problem arise we will fix them in subsequent PR. |
Try at an implementation replacing
std::Vec
withheapless::Vec
as mentioned in #10