2 Copyright (C) 2011 J. Coliz <maniacbug@ymail.com>
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 version 2 as published by the Free Software Foundation.
8 /* Galileo support from spaniakos <spaniakos@gmail.com> */
13 * Setup necessary to direct stdout to the Arduino Serial library, which
20 #if defined (ARDUINO) && !defined (__arm__) && !defined(__ARDUINO_X86__)
22 int serial_putc( char c, FILE * )
29 void printf_begin(void)
31 fdevopen( &serial_putc, 0 );
34 #elif defined (__arm__)
36 void printf_begin(void){}
38 #elif defined(__ARDUINO_X86__)
39 int serial_putc( char c, FILE * )
46 void printf_begin(void)
48 //JESUS - For reddirect stdout to /dev/ttyGS0 (Serial Monitor port)
49 stdout = freopen("/dev/ttyGS0","w",stdout);
51 printf("redirecting to Serial...");
53 //JESUS -----------------------------------------------------------
56 #error This example is only for use on Arduino.
59 #endif // __PRINTF_H__