Change save_cmnos_printf type to function pointer
authorEugene Krasnikov <k.eugene.e@gmail.com>
Mon, 18 Mar 2013 16:46:38 +0000 (17:46 +0100)
committerEugene Krasnikov <k.eugene.e@gmail.com>
Mon, 8 Apr 2013 11:23:02 +0000 (13:23 +0200)
save_cmnos_printf is always used as a function pointer
and never as integer

Signed-off-by: Eugene Krasnikov <k.eugene.e@gmail.com>
target_firmware/magpie_fw_dev/target/inc/k2/athos_api.h
target_firmware/magpie_fw_dev/target/init/app_start.c
target_firmware/magpie_fw_dev/target/init/init.c

index ed3ff66f6526f6d634efed55ff9b5030bcb7e136..01f75aaf6f3bd1e8dd8c2a89ef7383d9a9a68a52 100755 (executable)
@@ -56,7 +56,7 @@
 /* ROM Patch API */
 
 /* save the ROM printf function point */
-extern uint32_t save_cmnos_printf;
+extern int (* save_cmnos_printf)(const char * fmt, ...);
 
 extern unsigned int _data_start_in_rom;
 extern unsigned int _data_start;
index 64552aaf7fdb511c0ce5e90029582d1935fc52c4..136f966dfe8fd3fd4e04a7fd35f3139f85eb08c2 100644 (file)
@@ -128,13 +128,13 @@ void app_start()
        A_PRINTF(" A_WDT_INIT()\n\r");
 
 #if defined(PROJECT_K2)
-       save_cmnos_printf = (uint32_t) fw_cmnos_printf;
+       save_cmnos_printf = fw_cmnos_printf;
 #endif
 
        if( hostif == HIF_USB ) {
 #if defined(PROJECT_K2)
 #if MOVE_PRINT_TO_RAM
-               save_cmnos_printf = (uint32_t) _indir_tbl.cmnos.printf._printf;
+               save_cmnos_printf = _indir_tbl.cmnos.printf._printf;
                _indir_tbl.cmnos.printf._printf = fw_cmnos_printf;
 #endif
                _indir_tbl.cmnos.usb._usb_fw_task = _fw_usb_fw_task;
index b32661e96df22995d79a8ec6d4caf6d7abed9c33..54885b24b497b2f9fc76e82257f1d9d2bf822f23 100755 (executable)
@@ -60,7 +60,7 @@ uint32_t idle_cnt = 0;
 
 #if defined(PROJECT_K2)
 // save the ROM printf function point
-uint32_t save_cmnos_printf;
+int (* save_cmnos_printf)(const char * fmt, ...);
 #endif
 
 #define ATH_DATE_STRING     __DATE__" "__TIME__