Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Precompiler directives?

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR
View previous topic :: View next topic  
Author Message
Sebastian.Heyn

Bascom Member



Joined: 13 Apr 2005
Posts: 84

PostPosted: Fri Mar 16, 2018 8:47 am    Post subject: Precompiler directives? Reply with quote

Hi,

does bascom have an option - so that I can tell the compiler to output debug information in the code or not?

For example: Right now, I use a software UART for debug output


Code:
? #1 , "Some debug text"


However in the final version, I dont need that and my usual way is to go through the code and uncomment everything.

Sometimes I put a

Code:

if debug_out=1  
 


but this is also taking up some cpu time. is there a possibility to disable these commands with a compiler option somehow?

(BASCOM-AVR version : 2.0.7.9 , Latest : 2.0.8.1 )
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5056
Location: Holland

blank.gif
PostPosted: Fri Mar 16, 2018 10:05 am    Post subject: Reply with quote

in the help you find the DEBUG statement which is similar to PRINT. It can be turned on'/off

A good way is using conditional compilation :
Code:
const cWantDebug=1  ' create some constant

#IF cWantDebug   'notice there is NO THEN for #
#ELSEIF  cWantDebug=2  '  optional
#ELSE  'also optional
#ENDIF  'notice no space between end and if

 


The IDE can also show which code is included and which not (edit show excluded code)

_________________
Mark
Back to top
View user's profile Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum