From debfda67f269e0aa3703457a8adb028d690af178 Mon Sep 17 00:00:00 2001 From: Mohammed Mubeen Date: Wed, 30 Jun 2021 17:40:32 +0530 Subject: [PATCH] Updated the Licenses for RawCAN and aligned indentation --- drivers/include/drivers/RawCAN.h | 30 +++++++++---------- drivers/source/RawCAN.cpp | 50 ++++++++++++++++---------------- 2 files changed, 40 insertions(+), 40 deletions(-) diff --git a/drivers/include/drivers/RawCAN.h b/drivers/include/drivers/RawCAN.h index e48bc49aa4..1c7083dc69 100644 --- a/drivers/include/drivers/RawCAN.h +++ b/drivers/include/drivers/RawCAN.h @@ -1,18 +1,18 @@ -/* mbed Microcontroller Library - * Copyright (c) 2019 ARM Limited - * SPDX-License-Identifier: Apache-2.0 +/* + * Copyright (C) 2021, STMicroelectronics, All Rights Reserved + * SPDX-License-Identifier: Apache-2.0 * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ #ifndef RAWCAN_H @@ -30,7 +30,7 @@ namespace mbed { class RawCAN: public CAN { - public: +public: RawCAN(PinName rd, PinName td); /** Initialize CAN interface and set the frequency @@ -61,8 +61,8 @@ class RawCAN: public CAN { */ int read(CANMessage &msg, int handle = 0); - }; -} //namespace mbed +}; +} #endif #endif //RAWCAN_H diff --git a/drivers/source/RawCAN.cpp b/drivers/source/RawCAN.cpp index e0d9f80b66..feb1f230a2 100644 --- a/drivers/source/RawCAN.cpp +++ b/drivers/source/RawCAN.cpp @@ -1,18 +1,18 @@ -/* mbed Microcontroller Library - * Copyright (c) 2006-2019 ARM Limited - * SPDX-License-Identifier: Apache-2.0 +/* + * Copyright (C) 2021, STMicroelectronics, All Rights Reserved + * SPDX-License-Identifier: Apache-2.0 * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ #include "drivers/RawCan.h" @@ -22,21 +22,21 @@ #include "platform/mbed_power_mgmt.h" namespace mbed { - RawCAN::RawCAN(PinName rd, PinName td): CAN(rd, td) {} - RawCAN::RawCAN(PinName rd, PinName td, int hz): CAN(rd, td, hz) {} +RawCAN::RawCAN(PinName rd, PinName td): CAN(rd, td) {} - /* There are situations where the RX interrupt of CAN are cleared only by - * CAN read operations and locks are not allowed in ISR context in mbed - * hence this provides an unlocked read to resolve such problem without - * any effect on the performance. This will work only in case of a single - * thread accessing a CAN instance, multiple threads will lead to race conditions - */ - int RawCAN::read(CANMessage &msg, int handle){ - int ret = can_read(&_can, &msg, handle); - return ret; - } +RawCAN::RawCAN(PinName rd, PinName td, int hz): CAN(rd, td, hz) {} -} // namespace +/* There are situations where the RX interrupt of CAN are cleared only by + * CAN read operations and locks are not allowed in ISR context in mbed + * hence this provides an unlocked read to resolve such problem without + * any effect on the performance. This will work only in case of a single + * thread accessing a CAN instance, multiple threads will lead to race conditions +*/ +int RawCAN::read(CANMessage &msg, int handle) { + int ret = can_read(&_can, &msg, handle); + return ret; +} +} #endif //DEVICE_CAN