@@ -41,10 +41,10 @@ class CANMessage : public CAN_Message {
41
41
*/
42
42
CANMessage () : CAN_Message()
43
43
{
44
- len = 8 ;
44
+ len = 8U ;
45
45
type = CANData;
46
46
format = CANStandard;
47
- id = 0 ;
47
+ id = 0U ;
48
48
memset (data, 0 , 8 );
49
49
}
50
50
@@ -56,7 +56,7 @@ class CANMessage : public CAN_Message {
56
56
* @param _type Type of Data: Use enum CANType for valid parameter values
57
57
* @param _format Data Format: Use enum CANFormat for valid parameter values
58
58
*/
59
- CANMessage (unsigned _id, const char *_data, char _len = 8 , CANType _type = CANData, CANFormat _format = CANStandard)
59
+ CANMessage (unsigned int _id, const unsigned char *_data, unsigned char _len = 8 , CANType _type = CANData, CANFormat _format = CANStandard)
60
60
{
61
61
len = _len & 0xF ;
62
62
type = _type;
@@ -70,7 +70,7 @@ class CANMessage : public CAN_Message {
70
70
* @param _id Message ID
71
71
* @param _format Data Format: Use enum CANType for valid parameter values
72
72
*/
73
- CANMessage (unsigned _id, CANFormat _format = CANStandard)
73
+ CANMessage (unsigned int _id, CANFormat _format = CANStandard)
74
74
{
75
75
len = 0 ;
76
76
type = CANRemote;
@@ -104,10 +104,10 @@ class CAN : private NonCopyable<CAN> {
104
104
* CAN can1(MBED_CONF_APP_CAN1_RD, MBED_CONF_APP_CAN1_TD);
105
105
* CAN can2(MBED_CONF_APP_CAN2_RD, MBED_CONF_APP_CAN2_TD);
106
106
*
107
- * char counter = 0;
107
+ * unsigned char counter = 0;
108
108
*
109
109
* void send() {
110
- * if(can1.write(CANMessage(1337 , &counter, 1))) {
110
+ * if(can1.write(CANMessage(1337U , &counter, 1))) {
111
111
* printf("Message sent: %d\n", counter);
112
112
* counter++;
113
113
* }
@@ -116,7 +116,7 @@ class CAN : private NonCopyable<CAN> {
116
116
*
117
117
* int main() {
118
118
* ticker.attach(&send, 1);
119
- * CANMessage msg;
119
+ * CANMessage msg;
120
120
* while(1) {
121
121
* if(can2.read(msg)) {
122
122
* printf("Message received: %d\n\n", msg.data[0]);
0 commit comments