mirror of https://github.com/ARMmbed/mbed-os.git
Updated the Licenses for RawCAN and aligned indentation
parent
7a4a4ea30d
commit
debfda67f2
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue