-
Notifications
You must be signed in to change notification settings - Fork 4
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
Better autogen #247
Better autogen #247
Conversation
@@ -10,7 +10,7 @@ | |||
|
|||
--- | |||
Messages: | |||
uv_cutoff_notification: | |||
uv_cutoff_notification1: |
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.
there are two uv_cutoffs, from power-distribution and uw_cutoff, both to telemetry, and autogen can't handle this, so slight name change. Previously, one of them is just ignored, but this is in fact a different message with different id.
"receiver": message["target"], | ||
}) | ||
|
||
return {"Boards": boards, "Messages": 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.
autogen will now read all board yamls once, all necessary message info is stored in this dictionary (list of boards to generate board id, and list of messages which is then filtered by the board at jinja generation)
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.
Makes sense
def main(): | ||
parser = OptionParser() | ||
# TODO: Get rid of -y option or -b option, redundant |
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.
got rid of -y option, can't get rid of -b option unless we want to infer the board from the output path, which is a bit ugly. Maybe later with better_better_autogen
@@ -1,16 +1,16 @@ | |||
{% set board = data["Board"] -%} | |||
{% set messages = data["Messages"] | selectattr("receiver", "contains", board) | list -%} |
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.
this bit filters the messages to contain only the relevant ones for the specific board.
@@ -2,5 +2,6 @@ | |||
"libs": [ | |||
"FreeRTOS", | |||
"ms-common" | |||
] | |||
], | |||
"no_lint": true |
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.
there are some python lint issues in this library, it's annoying to fix, make a ticket for this.
eventually, I want to have all autogeneration stuff in one place, for can autogen, test auto gen, and new project autogen. better_better_autogen: something like
then specifying |
"receiver": message["target"], | ||
}) | ||
|
||
return {"Boards": boards, "Messages": 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.
Makes sense
change the autogen to be called only once to generate all the can files for one project
autogenner -f {source_dir} -t {all source templates...} -f {header dir} -t {all header templates}
changed test_runner auto-generator to use jinja
added a python template to generate some cansend functions for can (just preliminary)