Closed andresv closed 2 years ago
Ahaa, I think I know why I did not see these errors. I added std
to:
atat = { version = "0.13.1", features = ["std", "derive", "defmt", "bytes"] }
Edit: nope that wasn't the problem
I just realized that atat
uses embedded-hal
CountDown
trait (https://github.com/BlackbirdHQ/atat/blob/master/atat/src/client.rs#L58), but at the moment here we are using our own Clock
trait.
It would be actually better if we use CountDown
also here, but we also need now()
method to get current time and I guess there is also problem with time conversion. Typically CountDown
is implemented for u32
, but here we would like to use it more like for fugit::MillisDurationU32
.
Lemme think about it some more.
Yeah . The timer stuff across the stack is not ideal, so i am very much open to solutions that would make it easier to use..
It is very much affected by the currently bad shape of the timer traits in embedded Hal.. also the requirement on into
Clock
trait now comes from atat
: https://github.com/andresv/atat/blob/use-fugit-for-timing/atat/src/lib.rs#L278-L290
This looks amazing! Awesome job so far! Hope i can find the time to review both atat & this tomorrow 🤞👌
Clock
in atat
was changed to use WouldBlock
for wait. This is not yet updated here.
Hmm, I guess cherry-picking your latest commit was not right thing to do (this conflict message here).
Clock
is now updated.
It makes most sense if Format is implemented for fugit types: https://github.com/korken89/fugit/issues/6
Can you update this PR to make use of atat 0.14.0 & ublox-sockets 0.1.0 releases as well?
Yes. Adding those and starting to use fmt.rs
file for logging.
I wonder how to enable log
or defmt
feature for atat
and ublox-sockets
based on if log
or defmt
feature is selected for this crate.
For example here log
is at the moment hardcoded.
[dependencies]
atat = { version = "0.14", features = ["derive", "log", "bytes"] }
ublox-sockets = { version = "0.1", features = ["log"] }
log = { version = "^0.4", default-features = false, optional = true }
defmt = { version = "^0.2", optional = true }
[features]
default = ['log", "toby-r2", "socket-udp", "socket-tcp"]
lara-r2 = []
leon-g1 = []
lisa-u2 = []
mpci-l2 = []
sara-g3 = []
sara-g4 = []
sara-u1 = []
sara-u2 = ["upsd-context-activation"]
toby-l2 = []
toby-r2 = []
topy-l4 = []
upsd-context-activation = []
socket-tcp = ["ublox-sockets/socket-tcp"]
socket-udp = ["ublox-sockets/socket-udp"]
defmt-default = ["defmt"]
defmt-trace = ["defmt"]
defmt-debug = ["defmt"]
defmt-info = ["defmt"]
defmt-warn = ["defmt"]
defmt-error = ["defmt"]
FYI: this is not dropped, I am continuing with it quite soon.
No problem :+1: I have not had a chance to replace our own embedded-time stuff with fugit yet, so i am not in a rush.. Hopefully i'll find the time in the beginning of the new year.
Let med know if you need anything from me :)
Merry Christmas :christmas_tree:
Finally back in hacking with it. At the moment I am working on SARA-N310 support. I think actually embedded-time replacement with fugit was successful. I can confirm if everything works if I got N310 working.
Updated, but waiting for new atat
release: https://github.com/BlackbirdHQ/atat/issues/116.
Yeah, i also have a few PRs blocked on that, so it will be out during today.
Just want to check if https://github.com/BlackbirdHQ/atat/pull/115 makes any significant code-size changes first
atat v0.15.0
& ublox-sockets v0.2.0
released :tada:
This PR replaces
embedded-time
with more lightweight const generics based time library called fugit which is for example going to be used in RTIC.embedded-time
had some dependencies that did not work well on ESP32, this PR fixes this particular problem.