chipKIT32 / chipKIT32-MAX

Multi-platform IDE derived version from Arduino 0022 for the chipKit.
http://chipkit.net
Other
108 stars 76 forks source link

stderr cause compilation error for chipKIT UNO32 #212

Open knchip opened 12 years ago

knchip commented 12 years ago

Hi, if we use fprintf(stderr , "hello"); it compiles fine for chipKIT max32, but fails for UNO32. It looks to me that, since UNO has only 2 serial ports and stdio.h has definition for stderr as #define stderr (&_iob[2]) we get the error.

if we undef stderr and redefine , the compileation is successfull. Thanks, Narayanan

ricklon commented 12 years ago

The original Arduino code doesn't support printf. So it's kind of fluke that these are working. Do we want this feature to be supported officially by ChipKit?

knchip commented 12 years ago

I prefer to have this features due to the following reasons.

  1. PIC 32 has mutiple UARTs and resources such as RAM and FLASH to support the library.
  2. There is no risk of board re-start when we use any UART other than the debug one.
  3. Sample code from other projects and code libraries can be easily ported this platform 4.Printf has better formatting than our current Serial.print., so easy to use.