首页 > 其他 > 详细

Embedded C Coding Rules

时间:2020-07-27 15:46:49      阅读:55      评论:0      收藏:0      [点我收藏+]

1. Using inline to replace #define when there are paramters

2. Using unsigned int only for bit-operations

3. Using fixed-width type int e.g. uint8_t, int8_t, etc.

4. Using const as many as you can to avoid mis-modification

5. Using static as many as you can to limit the functions/variables scope

6. Using volatile for interrupt or mutti-task shared varaibles

7. Using {} even there is only one line code in scope

8. Using const to replace #define Marco

 

more rules later

Embedded C Coding Rules

原文:https://www.cnblogs.com/zjbfvfv/p/13384780.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!