File tree Expand file tree Collapse file tree 2 files changed +42
-6
lines changed
Expand file tree Collapse file tree 2 files changed +42
-6
lines changed Original file line number Diff line number Diff line change 1+ /*
2+ * This file is free software; you can redistribute it and/or modify
3+ * it under the terms of either the GNU General Public License version 2
4+ * or the GNU Lesser General Public License version 2.1, both as
5+ * published by the Free Software Foundation.
6+ */
7+
8+ /* *************************************************************************************
9+ * INCLUDE
10+ **************************************************************************************/
11+
12+ #include " CanMsg.h"
13+
14+ /* *************************************************************************************
15+ * NAMESPACE
16+ **************************************************************************************/
17+
18+ namespace arduino
19+ {
20+
21+ /* *************************************************************************************
22+ * STATIC CONST DEFINITION
23+ **************************************************************************************/
24+
25+ size_t const CanMsg::MAX_DATA_LENGTH;
26+ uint32_t const CanMsg::CAN_EFF_FLAG;
27+ uint32_t const CanMsg::CAN_SFF_MASK;
28+ uint32_t const CanMsg::CAN_EFF_MASK;
29+
30+ /* *************************************************************************************
31+ * NAMESPACE
32+ **************************************************************************************/
33+
34+ } /* arduino */
Original file line number Diff line number Diff line change 1515#include < stdint.h>
1616#include < string.h>
1717
18- #include < Arduino.h>
18+ #include " Print.h"
19+ #include " Printable.h"
20+ #include " Common.h"
1921
2022/* *************************************************************************************
2123 * NAMESPACE
@@ -112,20 +114,20 @@ class CanMsg : public Printable
112114 * |- Bit 29 : reserved (future error frame flag)
113115 * |- Bit 0-28 : CAN identifier (11/29 bit)
114116 */
115- uint32_t id;
116- uint8_t data_length;
117- uint8_t data[MAX_DATA_LENGTH];
117+ private: uint32_t id;
118+ public: uint8_t data_length;
119+ public: uint8_t data[MAX_DATA_LENGTH];
118120};
119121
120122/* *************************************************************************************
121123 * FREE FUNCTIONS
122124 **************************************************************************************/
123125
124- static uint32_t CanStandardId (uint32_t const id) {
126+ inline uint32_t CanStandardId (uint32_t const id) {
125127 return (id & CanMsg::CAN_SFF_MASK);
126128}
127129
128- static uint32_t CanExtendedId (uint32_t const id) {
130+ inline uint32_t CanExtendedId (uint32_t const id) {
129131 return (CanMsg::CAN_EFF_FLAG | (id & CanMsg::CAN_EFF_MASK));
130132}
131133
You can’t perform that action at this time.
0 commit comments