Naming conventions and coding standards

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Naming conventions and coding standards

1,558 次查看
Glogov_Kolac
Contributor II

Is there are some official coding standard and naming convention for C programming language for CW and Freescale MCU's. I now use notaton similar to C# (camael for local vars, atributes and Pascal notation for function names), I try to avoid long names vith _ between words to distinguish them from MQX kernel function names !

标签 (1)
0 项奖励
2 回复数

981 次查看
irob
Contributor V

I really like Michael Barr's "Embedded C Coding Standard", which is based on MISRA's I believe.  His company, Netrino, does training and consulting.  He's got an excellent blog at http://embeddedgurus.com/barr-code/

0 项奖励

981 次查看
AirDragon
Contributor III

I'm not sure about the other members here, but I've been trying to use the MISRA conventions. I also somehow stumbled upon a declassified document that goes over the C++ language and style rules used for the JSF electronics, but that's another story.

 

As far as I know, the Codewarrior compiler is happy so long as you have ISO 9899:1990. Versions after 6 or so support 9899:1999 I think.

0 项奖励