keyboardio / Kaleidoscope

Firmware for Keyboardio keyboards and other keyboards with AVR or ARM MCUs.
http://keyboard.io
GNU General Public License v3.0
757 stars 259 forks source link

Hardware-EZ-ErgoDox: Use twi.c we use for the Model01? #428

Open algernon opened 5 years ago

algernon commented 5 years ago

Originally by @algernon, as keyboardio/Kaleidoscope-Hardware-EZ-ErgoDox#4.

algernon commented 5 years ago

I gave this a try before, but ended up with linking errors I wasn't able to figure out at the time. Symbols clearly provided by TWI were apparently missing. Turns out, the solution is really obvious in hindsight: TWI is compiled as C, while we're using it from C++. That means that names used by the C++ code will be mungled on use, but won't be mungled in the C code (since that's C, no name mungling there).

The solution is:

extern "C" {
#include "twi.h"
};