Pages: [1]   Go Down
Author Topic: How to add customized compiling message under Arduino IDE  (Read 386 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi All,
I want to add some customized output information in Arduino IDE when compiling the code written by me.
I tried #pragma message("hello"). It dispalyed nothing.
Can anybody know it?

Thanks,

Steve
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 197
Posts: 12743
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
#error Bad news, dude.

#warning Something fishy.
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 197
Posts: 12743
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


Another possibility (requires the condition to reduce to a compile-time constant)...

Code:
static void OutputsErrorIfCalled( void ) __attribute__ (( error("Unexpected condition encountered.") ));

void loop( void )
{
  if ( true )
  {
    OutputsErrorIfCalled();
  }
}
« Last Edit: January 03, 2013, 12:15:51 am by Coding Badly » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It works!
Thanks for your help.

Steve
Logged

Pages: [1]   Go Up
Jump to: