Auto Formater won't format the following code WHEN "" characters ARE REMOVED !
void setup ()
{
#define ASSERT(cond, text )if( (cond) ){printf( "assertion error line %d, file(%s)\n",__LINE__, __FILE__ );
Serial.printf("ASSERT error \nfunction %s parameter %i @line %i file %s time %s \n",
text , cond, __LINE__,__FILE__ ,__TIME__);lcd.clear(); lcd.print(text);}
ASSERT(Initialize(), "Initialize()") //; // initialize serial, LCD etc.
// where is power up test??
ASSERT(Logo(), "Logo()") // display logo serial and LCD
ASSERT(InitializeRecords(), "InitializeRecords()") // initialize structure
// setup and run
SetupGenerator(); // exits to reset
}
void setup ()
{
And refuses to format anything when the macro uses line continuation characters , see "too many curly brackets "
This is the actual text entered in editor - with "" characters
#define ASSERT(cond, text )if( (cond) ){printf( "assertion error line %d, file(%s)\n",LINE, FILE );
Serial.printf("ASSERT error \nfunction %s parameter %i @line %i file %s time %s \n",
text , cond, LINE,FILE ,TIME);lcd.clear(); lcd.print(text);}
Also the macro won't print the entire message, missing CR/LF, stopping and picking up strange text AFTER the FILE macro is executed.
Here is the output:
[code][/code]
ASSERT error
function Initialize() parameter 1 @line 220 file Analyzer_V27.inAnalyzer 2014
AD9850 DDS
Analyzer 2014
AD9850 DDS
ASSERT error
function Logo() parameter 1 @line 222 file Analyzer_V27.ino timASSERT error
function InitializeRecords() parameter 1 @line 224 file AnalyzerStart frequency