Jump to content
Sign in to follow this  
LASTBOLT

preprocssor

Recommended Posts

:)

Hello all,

   I cannot get the macro below to compile correct.

   AM i alone?

 

Define  motor_on       PORTB|=(1<<6)  ;// my macro

 

 

main()

 {

       motor_on;

 

}

Share this post


Link to post
Share on other sites
Guest Pavel

Try this code:

 

#include <system.h>

//////////////////////////////////////////////
// Main program entry
//////////////////////////////////////////////

#define  motor_on       portb=portb|(1<<6)

main()
{
motor_on; 
}

 

I also discovered that sometimes the ide corruts source files by replacing spaces with 0xA0 symbol and the preprocessor doesn't handle this. This bug will be fixed in the final 5.0 release.

 

Regards,

Pavel

Share this post


Link to post
Share on other sites

Hello,

    below is the code  generated...

    no code was generated for sw;

 

Thank you,

 

 

 

startcode

   ;;;;;;;;{

   ;;;;;;;;motor_on;

   ;;;;;;;;}

_main__end

   END

Share this post


Link to post
Share on other sites
Guest Pavel

Which target and compiler version do you use. On my pc c2c 4.7 generates meaningful assembly for the pic16f84 target.

 

Regards,

Pavel

Share this post


Link to post
Share on other sites
Guest Pavel

4.1.6 doesn't work with external preprocessor but has only internal very limited one. You need to upgrade your c2c compiler for 4.6.3 or 4.7

 

Regards,

Pavel

Share this post


Link to post
Share on other sites

hello,

       So I am lost.. but where do I find  the compiler only

4.6.3  or 4.7

 

       I did download the  latest version + the zip file

       I am doing something wrong .. I now think so.

 

 

thank you

Share this post


Link to post
Share on other sites
Guest Pavel
So I am lost.. but where do I find  the compiler only

4.6.3  or 4.7

 

        I did download the  latest version + the zip file

        I am doing something wrong .. I now think so.

Everything is here http://www.picant.com/c2c/download.html Where did you download yours from?

 

Regards,

Pavel

Share this post


Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...