Redlib semihost Preprocessor define

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Redlib semihost Preprocessor define

352件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by atomicdog on Thu Mar 01 21:16:34 MST 2012
Is there a C preprocessor define that gets set when the semihost library is used?

I want to be able to redefine a symbol based on if the semihost library is used.
0 件の賞賛
3 返答(返信)

314件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by atomicdog on Fri Mar 02 18:01:38 MST 2012

Quote: CodeRedSupport
Just to follow up on this, can you explain in more detail exactly what you are trying to achieve here?  There may well be an alternative approach.

Regards,
CodeRedSupport


Yeah, now that I've thought about it more I can just use NDEBUG since I just wanted to remove some semihosting functions from the binary with a release build.


#if defined NDEBUG
#define debug_puts(s)
#else
#define debug_puts(s) __sys_write0(s)
#endif

int main(void) {


  debug_puts("Begin Main Loop:\n");
0 件の賞賛

314件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Fri Mar 02 04:10:15 MST 2012
Just to follow up on this, can you explain in more detail exactly what you are trying to achieve here?  There may well be an alternative approach.

Regards,
CodeRedSupport
0 件の賞賛

314件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Fri Mar 02 03:09:11 MST 2012

Quote: atomicdog
Is there a C preprocessor define that gets set when the semihost library is used?

I want to be able to redefine a symbol based on if the semihost library is used.



This is not possible, because none/nohost/semihost is a library selection. That is, it affects the libraries that you link with - it does not affect the compilation in any way.
0 件の賞賛