I am using Arduino Due IDE 1.5.2 with Eclipse Juno and Arduino Eclipse Plugin V2. I am trying to implement the Relic Toolkit library on Due. But it requires printf() support. Whenever I am trying to implement the below code
int serial_putchar(char c, FILE* f) {
if (c == '\n') serial_putchar('\r', f);
return Serial.write(c) == 1? 0 : 1;
}
FILE serial_stdout;
void setup(){
Serial.begin(115200);
// Set up stdout
fdev_setup_stream(&serial_stdout, serial_putchar, NULL, _FDEV_SETUP_WRITE);[/b]
stdout = &serial_stdout;
printf("My favorite number is %6d!", 12);
}
I get the error message as
_FDEV_SETUP_WRITE' was not declared in this scope
Symbol '_FDEV_SETUP_WRITE' could not be resolved.
Can anybody help to resolve this issue.
Your help will be highly appreciated.