printf redirection

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

printf redirection

812件の閲覧回数
mircopizzichini
Contributor III

Hi all

 

Currently I'm porting my old MQX project on KSDK.

In the previous version, we had modified fio.h file from:

 

#define  ioctl      _io_ioctl  #define  printf     _io_printf #define  putc       _io_fputc

 

to:

 

#define  ioctl      _io_ioctl  #if defined(MQX_USES_MY_PRINTF) && MQX_USES_MY_PRINTF == 1    #define  printf     my_printf #else    #define  printf     _io_printf #endif #define  putc       _io_fputc

 

where MQX_USES_MY_PRINTF was defined in user_config.h.

This is beacuse we used a custom printf function which, in addition to performing the classic _io_printf, sent the string to the Bluetooth_Task for wireless transmission. Now fio.h file is no more present.

Is there a way to replicate this redirection? The new function shall be called by EVERY printf in my working set, like usb or nshell project.

ラベル(1)
0 件の賞賛
返信
1 返信

653件の閲覧回数
Kan_Li
NXP TechSupport
NXP TechSupport

Hi,

You may find similar definition in the following header file:

pastedImage_0.png

Hope that helps,


Have a great day,
Kan

NXP Technical Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------