Make interface::CAN buildable on targets without DEVICE_CAN

This commit adds provisions to enable using interface::CAN on targets that don't have DEVICE_CAN set to 1 (ie: they don't normally have a CAN peripheral).
pull/14336/head
George Beckstein 2021-05-04 02:23:51 -04:00
parent d6104c8194
commit 49e58ddab6
2 changed files with 8 additions and 1 deletions

View File

@ -28,8 +28,10 @@
namespace mbed {
#ifndef FEATURE_EXPERIMENTAL_API
// Forward declare CAN
class CAN;
#endif
/** \defgroup drivers-public-api-can CAN
* \ingroup drivers-public-api
@ -171,6 +173,11 @@ using CAN = ::mbed::CAN;
#endif
} // namespace interface
#if defined(FEATURE_EXPERIMENTAL_API) && !DEVICE_CAN
using CAN = interface::CAN;
#endif
} // namespace mbed
#endif /* MBED_INTERFACE_CAN_H_ */

View File

@ -20,7 +20,7 @@
#ifndef MBED_CAN_HELPER_H
#define MBED_CAN_HELPER_H
#if DEVICE_CAN
#if DEVICE_CAN || FEATURE_EXPERIMENTAL_API
#ifdef __cplusplus
extern "C" {