Closed reitermarkus closed 2 years ago
Hi,
Please expand on what is the improvement related to this PR?
Instead of custom Date
and Time
types, use the types from the time
crate. A combined DateTime
type is much more ergonomic to work with than a (Date, Time)
tuple, e.g. when calculating time difference.
The same was done for the F4 and F7 HALs.
https://github.com/stm32-rs/stm32f4xx-hal/pull/436 https://github.com/stm32-rs/stm32f7xx-hal/pull/162
I see, ergonomics is always nice.
Next question, how does this time
crate impact code size compared to what is used today?
Having a look at the time crate its not clear.
code size compared to what is used today
Time
today is 17 bytes, time::Time
is 8 bytes. Date
today is 16 bytes, time::Date
is 4 bytes. Other than that there's not much you can do today other than access the struct fields.
Sounds good, no major change then!
Similar to
stm32f4xx-hal
.