Generate message size and cycle time consts#176
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
829730a to
cee3a5c
Compare
|
@nyurik this is also ready for review now. :) |
Adds methods to lookup DBC attributes: `message_attribute`, `signal_attribute`, `attribute_default`, `resolved_message_attribute` and `resolved_signal_attribute`. These will be used in oxibus/dbc-codegen#175 and oxibus/dbc-codegen#176. --------- Co-authored-by: Yuri Astrakhan <YuriAstrakhan@gmail.com>
ce2298b to
729de18
Compare
ea045db to
c56765b
Compare
c56765b to
4f6e7ed
Compare
trnila
left a comment
There was a problem hiding this comment.
Works great!
embassy is using its own embassy_time::Duration type instead of core::time::Duration. Would it make sense to have this type configurable? The embassy type memory footprint is also smaller than the core one.
|
@trnila Since the generated code will be integrated into projects using different timing libraries downstream ( |
Generates the following new constants per message:
MESSAGE_SIZEin bytes. This avoids the overhead of usingraw().len()orembedded_can::Frame::dlc()and makes the size known at compile-time.MESSAGE_CYCLE_TIMEcontaining the value from the correspondingGenMsgCycleTimeDBC attribute when it is present.This PR should be stacked on top of #175.