Skip to content

Commit debfda6

Browse files
committed
Updated the Licenses for RawCAN and aligned indentation
1 parent 7a4a4ea commit debfda6

File tree

2 files changed

+43
-43
lines changed

2 files changed

+43
-43
lines changed

drivers/include/drivers/RawCAN.h

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
/* mbed Microcontroller Library
2-
* Copyright (c) 2019 ARM Limited
3-
* SPDX-License-Identifier: Apache-2.0
1+
/*
2+
* Copyright (C) 2021, STMicroelectronics, All Rights Reserved
3+
* SPDX-License-Identifier: Apache-2.0
44
*
5-
* Licensed under the Apache License, Version 2.0 (the "License");
6-
* you may not use this file except in compliance with the License.
7-
* You may obtain a copy of the License at
5+
* Licensed under the Apache License, Version 2.0 (the "License"); you may
6+
* not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
88
*
9-
* http://www.apache.org/licenses/LICENSE-2.0
9+
* http://www.apache.org/licenses/LICENSE-2.0
1010
*
11-
* Unless required by applicable law or agreed to in writing, software
12-
* distributed under the License is distributed on an "AS IS" BASIS,
13-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14-
* See the License for the specific language governing permissions and
15-
* limitations under the License.
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
1616
*/
1717

1818
#ifndef RAWCAN_H
@@ -30,7 +30,7 @@
3030

3131
namespace mbed {
3232
class RawCAN: public CAN {
33-
public:
33+
public:
3434
RawCAN(PinName rd, PinName td);
3535

3636
/** Initialize CAN interface and set the frequency
@@ -61,8 +61,8 @@ class RawCAN: public CAN {
6161
*/
6262
int read(CANMessage &msg, int handle = 0);
6363

64-
};
65-
} //namespace mbed
64+
};
65+
}
6666

6767
#endif
6868
#endif //RAWCAN_H

drivers/source/RawCAN.cpp

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
/* mbed Microcontroller Library
2-
* Copyright (c) 2006-2019 ARM Limited
3-
* SPDX-License-Identifier: Apache-2.0
1+
/*
2+
* Copyright (C) 2021, STMicroelectronics, All Rights Reserved
3+
* SPDX-License-Identifier: Apache-2.0
44
*
5-
* Licensed under the Apache License, Version 2.0 (the "License");
6-
* you may not use this file except in compliance with the License.
7-
* You may obtain a copy of the License at
5+
* Licensed under the Apache License, Version 2.0 (the "License"); you may
6+
* not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
88
*
9-
* http://www.apache.org/licenses/LICENSE-2.0
9+
* http://www.apache.org/licenses/LICENSE-2.0
1010
*
11-
* Unless required by applicable law or agreed to in writing, software
12-
* distributed under the License is distributed on an "AS IS" BASIS,
13-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14-
* See the License for the specific language governing permissions and
15-
* limitations under the License.
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
1616
*/
1717

1818
#include "drivers/RawCan.h"
@@ -22,21 +22,21 @@
2222
#include "platform/mbed_power_mgmt.h"
2323

2424
namespace mbed {
25-
RawCAN::RawCAN(PinName rd, PinName td): CAN(rd, td) {}
26-
27-
RawCAN::RawCAN(PinName rd, PinName td, int hz): CAN(rd, td, hz) {}
28-
29-
/* There are situations where the RX interrupt of CAN are cleared only by
30-
* CAN read operations and locks are not allowed in ISR context in mbed
31-
* hence this provides an unlocked read to resolve such problem without
32-
* any effect on the performance. This will work only in case of a single
33-
* thread accessing a CAN instance, multiple threads will lead to race conditions
34-
*/
35-
int RawCAN::read(CANMessage &msg, int handle){
36-
int ret = can_read(&_can, &msg, handle);
37-
return ret;
38-
}
39-
40-
} // namespace
25+
26+
RawCAN::RawCAN(PinName rd, PinName td): CAN(rd, td) {}
27+
28+
RawCAN::RawCAN(PinName rd, PinName td, int hz): CAN(rd, td, hz) {}
29+
30+
/* There are situations where the RX interrupt of CAN are cleared only by
31+
* CAN read operations and locks are not allowed in ISR context in mbed
32+
* hence this provides an unlocked read to resolve such problem without
33+
* any effect on the performance. This will work only in case of a single
34+
* thread accessing a CAN instance, multiple threads will lead to race conditions
35+
*/
36+
int RawCAN::read(CANMessage &msg, int handle) {
37+
int ret = can_read(&_can, &msg, handle);
38+
return ret;
39+
}
40+
}
4141

4242
#endif //DEVICE_CAN

0 commit comments

Comments
 (0)