Is it possible to generate C code with Embedded Coder (ERT TLC) following the Google C style guide?

12 ビュー (過去 30 日間)
Pasquale
Pasquale 2025 年 9 月 25 日 15:25
回答済み: Mark McBroom 2025 年 9 月 29 日 1:00
Hello,
I am using Embedded Coder with the ERT TLC file to generate C code from Simulink models.
I would like to know if it is possible to configure the code generator so that the generated functions and source files comply with the Google C Style Guide.
In particular, I am interested in:
  • Function naming conventions
  • Indentation and formatting rules
  • File structure and organization
Is there any built-in support for this, or would it require customizing TLC files and code generation templates?
Any references or examples would be very helpful.
Thank you in advance!

回答 (1 件)

Mark McBroom
Mark McBroom 2025 年 9 月 29 日 1:00
There is not built-in support for this standard. Embedded Coder has many custtomization options, so I would expect many of the guidelines could be met. For example, on the "Code Style" section, things like parantheses, indentation and casting can be congrolled: https://www.mathworks.com/help/ecoder/ref/code-generation-pane-code-style.html
Thanks.
Mark.

カテゴリ

Help Center および File ExchangeSimulink Coder についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by