Teensy 3.5: usb_init() ? How to bring into scope.

Status
Not open for further replies.
I expect there is a simple answer to this. I'm trying to get raw_hid working, but I can't call the functions on the Teensy side.

With one functional line calling usb_init(), I get..

Code:
Arduino: 1.8.5 (Windows 10), TD: 1.40, Board: "Teensy 3.5, Serial, 120 MHz, Faster, US English"

sketch_mar03b: In function 'void setup()':
sketch_mar03b:3: error: 'usb_init' was not declared in this scope
   usb_init();

            ^

'usb_init' was not declared in this scope


The code being:

Code:
void setup() {
  // put your setup code here, to run once:
  usb_init();
}

void loop() {
  // put your main code here, to run repeatedly:

}

I assume there's a lib or #include<something.h>, but it's not mentioned in the documentation.

Thanks
 
Just because you can do a thing does not necessarily mean you should do that thing!

In this case, usb_init() is already called by the startup code before setup() runs. You probably should not call it again or mess with it.

But if you want to disregard that advice, here's the answer you seek:

Code:
extern "C" void usb_init(void);

void setup() {
  usb_init();
}

void loop() {
}
 
Status
Not open for further replies.
Back
Top