µTasker Forum

µTasker Forum => µTasker general => Topic started by: thamanjd on February 13, 2008, 08:08:33 AM

Title: My setup of CW compiler doesnt like the joining of two lines of "#define"
Post by: thamanjd on February 13, 2008, 08:08:33 AM
after enabling the network indicator option in NE64 version of the project, the complier compained about this line:

    #define LINK_DOWN_LEDS()       PTL |= (LNKLED | ACTLED);       \
                                       PTL = ~(COLLED | SPDLED | DUPLED);


i assume the backslash somehow is supposed to indicated that the second line shoulds also be included in the define but my CW doesnt like it. Anybody know a way to make it work?
Title: Re: My setup of CW compiler doesnt like the joining of two lines of "#define"
Post by: mark on February 15, 2008, 11:37:38 AM
Hi

Yes, the \ indicates that the following line should  be considered to be an extension of the first. This is used in a number of defines to avoid lines becoming too long.

For a fast solution simply declare the line as follows:
    #define LINK_DOWN_LEDS()       PTL |= (LNKLED | ACTLED); PTL = ~(COLLED | SPDLED | DUPLED);

If it still causes a problem it is not the \ but rather something else. But this will certainly remove the first possibility. At the moment I don't see why CW would have a problem with this so please tell us if it really solves it.

Regards

Mark
Title: Re: My setup of CW compiler doesnt like the joining of two lines of "#define"
Post by: thamanjd on May 06, 2008, 08:20:00 AM
Ive now tested this in a second project and it seems ok. Not sure what i was doing that caused the error the first time.