CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

precompiler function

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
cvargcal



Joined: 17 Feb 2015
Posts: 134

View user's profile Send private message

precompiler function
PostPosted: Wed Apr 29, 2020 9:53 pm     Reply with quote

Hi, I saw similar in arduino and I want know if it possible in CCS? and how fix it because dont work.

Code:


   #define show_debug_smg                     

// Set where debug messages will be printed.
#define debug_printer fprintf
                         
                             
// Define actual debug output functions when necessary.
#ifdef show_debug_smg                     
   #define debug_print_smg (...) { debug_printer(__VA_ARGS__); }             
#else                                           
   #define debug_print_smg(...) {}                                                             
#endif                                                     
       

void main(){

    debug_print_smg (UART1,"ERROR  MODEM");
   
    while(1);
}


I dont want write this everytime

Code:
      #if defined(show_debug_smg )                           
            fprintf(uart1,"ERROR  MODEM\r\n"); 
        #endif
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Apr 30, 2020 12:05 am     Reply with quote

The following thread discusses the topic:

Debug Printfs:
http://www.ccsinfo.com/forum/viewtopic.php?t=54635
cvargcal



Joined: 17 Feb 2015
Posts: 134

View user's profile Send private message

PostPosted: Thu Apr 30, 2020 1:15 am     Reply with quote

PCM programmer wrote:
The following thread discusses the topic:

Debug Printfs:
http://www.ccsinfo.com/forum/viewtopic.php?t=54635



Perfect! thank you!
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
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


Powered by phpBB © 2001, 2005 phpBB Group