TWCR register not defined on Teensy?

Status
Not open for further replies.

roach374

Member
Hi all,

I'm trying to use the platformio-managed library WiiChuck, for integrating with a Wiimote nunchuck control on Teensy 3.2.

But it looks like, somewhere in the guts of this library is a check, to only call Wire.begin() if I2C isn't already running. They do this by checking the TWCR register, but this register doesn't exist on Teensy.

So I get this error at compile time:

Code:
src/Accessory.cpp: In static member function 'static void Accessory::switchMult
iplexer(uint8_t, uint8_t)':
src/Accessory.cpp:94:8: error: 'TWCR' was not declared in this scope
if(TWCR == 0){ Wire.begin(); } // Start I2C if it's not running
^

My question to you: What is an equivalent way to determine, for Teensy, whether Wire.begin() has already been called? Is there any harm in calling it again (According to Wire.begin() docs, "This should only be called once").

Suggestions?
 
Status
Not open for further replies.
Back
Top