This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

On debug method(How to implement the "TRACE" macro?)

Dear all,my footprint of 51 on my project board is PLCC44,so the ICE can't be used(footprint is DIP40).I have to connect the 51's serial port to PC and dump everthing I need to it.So the program of debug version are full of "printf" statements which are unnecessary on release version.Thus,Can we write a "TRACE" macro to resolve it?MFC implement it for us while Keil C don't.

Parents
  • That error C214 you got almost certainly has nothing to do with the TRACE macro as such, but with the argument list you passed it.

    #defining DEBUG or RELEASE is supposed to be done by the project / makefile, so you can decide at compile time, outside the code, which modules to compile with the debug printouts active.

    Seriously, though: if you need to look into Microsoft SDKs to rip off a HIBYTE() macro instead of rolling your own, that's a strong sign you're in well over your head already. You'll have to brush up your knowledge of the C programming language considerably before you go on working on embedded software, I think.

Reply
  • That error C214 you got almost certainly has nothing to do with the TRACE macro as such, but with the argument list you passed it.

    #defining DEBUG or RELEASE is supposed to be done by the project / makefile, so you can decide at compile time, outside the code, which modules to compile with the debug printouts active.

    Seriously, though: if you need to look into Microsoft SDKs to rip off a HIBYTE() macro instead of rolling your own, that's a strong sign you're in well over your head already. You'll have to brush up your knowledge of the C programming language considerably before you go on working on embedded software, I think.

Children