From edca41efd8b9385f24309b9739d8e913025c84ad Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Thu, 4 May 2023 14:51:59 -0400 Subject: [PATCH] docs: Add note to API.md on importing can2040.h from C++ Signed-off-by: Kevin O'Connor --- docs/API.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/API.md b/docs/API.md index 46590da..189ed2f 100644 --- a/docs/API.md +++ b/docs/API.md @@ -252,3 +252,16 @@ That is, one must ensure each instance is not reentrant with respect to itself, but it is not required to synchronize between instances. One may run both can2040 instances on the same ARM core or different ARM cores. + +# Using can2040 from C++ + +The can2040 code is intended to be compiled with gcc. If can2040.c is +compiled with a C compiler and linked with a C++ application then be +careful to always import the `can2040.h` header file into C++ code in +"C" mode - for example: + +```c +extern "C" { + #include "can2040.h" +} +```