Skip to content
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

🎨 有大量更改,见以下内容 #15

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

SummerFalls
Copy link

  • 简化了条件注释中断部分代码的宏开关

  • 统一自定义类型 大小写_t 后缀

  • 将多组宏定义分组并改换成枚举类型

  • 调整枚举类型变量的命名中相同字段所处的位置,例如将 J1939_CONTROL_BYTE_ 提前,方便编辑器快速联想同类型变量

    typedef enum {
        J1939_CONTROL_BYTE_ACK            = 0,    /**< 用于TP(长帧数据),代表确认*/
        J1939_CONTROL_BYTE_NACK           = 1,    /**< 用于TP(长帧数据),PNG不被支持。否定消息*/
        J1939_CONTROL_BYTE_ACCESS_DENIED  = 2,    /**< 拒绝访问,但是信息是被支持,暂时不能响应(需要再次发送请求)*/
        J1939_CONTROL_BYTE_CANNOT_RESPOND = 3,    /**< 不能做出反应,有空但是接受的缓存不够,或则发送资源被占领,暂时不能响应(需要再次发送请求)*/
        J1939_CONTROL_BYTE_RTS            = 16,   /**< TP.CM_RTS*/
        J1939_CONTROL_BYTE_CTS            = 17,   /**< TP.CM_CTS*/
        J1939_CONTROL_BYTE_EOMACK         = 19,   /**< 消息应答结束*/
        J1939_CONTROL_BYTE_BAM            = 32,   /**< 广播公告消息*/
        J1939_CONTROL_BYTE_CONNABORT      = 255,  /**< 连接中断控制字节(放弃连接)*/
        /* CONTROL BYTE RESERVED BELOW */
        J1939_CONTROL_BYTE_RESERVED       = 0xFF, /**< 变量的保留位的值*/
    } J1939_CONTROL_BYTE_t;
  • 将不同CAN节点的相关全局变量使用数组进行管理,去除了多个 switch() 代码段所造成的代码重复性高的问题,减少了Flash占用,增强了可扩展更多CAN节点的可能性,同时增加代码灵活性,尽量避免增减节点时对协议栈主源文件的大量改动

  • 注释统一使用 MISRA-C 的标准 C 注释:/* Comment */

  • 缩进统一使用空格缩进,避免不同编辑器缩进量差异

  • 将本段版本历史记录信息从各个源文件中提取出来,单独存放于 CHANGELOG 文件中

@XeiTongXueFlyMe

Signed-off-by: Yujia Chen [email protected]

SummerFalls and others added 8 commits August 4, 2020 20:18
文件编码方式更改为统一的UTF-8编码
🚀 1. 修复错误的函数返回类型 2. 更改为 UTF-8 编码 3. 兼容 C89 4. 代码格式化
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants