host_bios: Cleanup of printfs
authorSam Nelson <sam.nelson@ti.com>
Fri, 26 May 2017 19:25:06 +0000 (15:25 -0400)
committerSam Nelson <sam.nelson@ti.com>
Fri, 2 Jun 2017 02:04:56 +0000 (22:04 -0400)
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
host_bios/simple_buffer_example/dsp/MainDsp.c
host_bios/simple_buffer_example/dsp/Server.c
host_bios/simple_buffer_example/dsp/makefile
host_bios/simple_buffer_example/host/App.c

index 19c75d5855718004032e676998b0f4f4c3a8944e..83202111c0b8e99e54ed4c4c7d56d91a162c26a9 100644 (file)
@@ -138,6 +138,11 @@ Void Server_taskFxn(UArg arg0, UArg arg1)
         goto leave;
     }
 
+        Log_print0(Diags_INFO, "DSP: Test Passed");
+
+#ifdef CONSOLE_PRINT
+        printf("\n DSP: Test Passed\n");
+#endif
     /* finalize the server */
     status = Server_delete();
 
@@ -149,18 +154,14 @@ Void Server_taskFxn(UArg arg0, UArg arg1)
     Server_exit();
 
 leave:
-    Log_print1(Diags_INFO, "Server_taskFxn: <-- status=%d", (IArg)status);
 
     if (status < 0)
-        Log_print0(Diags_INFO, "\n DSP: Test Failed \n");
-    else
-        Log_print0(Diags_INFO, "\n DSP: Test Passed \n");
-
+        Log_print1(Diags_INFO, " DSP: Test Failed: %d", status);
 #ifdef CONSOLE_PRINT
     if (status < 0)
-        printf("\n DSP: Test Failed \n");
-    else
-        printf("\n DSP: Test Passed \n");
+        printf("\n DSP: Test Failed: %d\n", status);
 #endif
+    Log_print1(Diags_INFO, "Server_taskFxn: <-- status=%d", (IArg)status);
+
     return;
 }
index 9705ad4f35ede6af30bca68e9da6f1d4945b037d..7f8ff85cd845360c00fec099b7d479ac37dcb7f6 100644 (file)
@@ -150,6 +150,7 @@ Int Server_exec()
         if (status < 0) {
             goto leave;
         }
+        Log_print1(Diags_ENTRY | Diags_INFO, "Message received...%d", msg->id);
         switch (msg->cmd) {
         case App_CMD_SHARED_REGION_INIT:
             regionId = msg->regionId;
@@ -172,7 +173,7 @@ Int Server_exec()
         case App_CMD_BIGDATA:
 #ifdef DEBUG
             Log_print1(Diags_ENTRY | Diags_INFO, "msg->cmd=App_CMD_BIGDATA,msg->ptr=0x%x",
-                (IArg)msg->u.bigDataBuffer.sharedPtr);
+                (IArg)msg->u.bigDataSharedDesc.sharedPtr);
 #endif
 
             /* Translate to local descriptor */
@@ -186,6 +187,7 @@ Int Server_exec()
 #ifdef DEBUG
             /* print message from buffer */
             Log_print1(Diags_INFO, " Received message %d", msg->id);
+            Log_print1(Diags_INFO, " Local Pointer 0x%x", (UInt32)bigDataLocalPtr);
             Log_print0(Diags_INFO, " First 8 bytes: ");
             for ( j = 0; j < 8 && j < bigDataLocalDesc.size/sizeof(uint32_t); j+=4)
                 Log_print4(Diags_INFO, "0x%x, 0x%x, 0x%x, 0x%x",
@@ -225,10 +227,10 @@ Int Server_exec()
         }
 
         /* process the message */
-        Log_print1(Diags_INFO, "Server_exec: processed cmd=0x%x", msg->cmd);
+        Log_print2(Diags_INFO, "Server_exec: processed id %d, cmd=0x%x", msg->id, msg->cmd);
 
         /* send message back */
-        queId = MessageQ_getReplyQueue(msg); /* type-cast not needed */
+        queId = MessageQ_getReplyQueue(msg);
         MessageQ_put(queId, (MessageQ_Msg)msg);
     } /* while (running) */
 
index f927edecd613d963a4243a1acdff387296d35332..9388872e585ac75f7854cecf77599d85e63be9ac 100644 (file)
@@ -80,8 +80,7 @@ bin/shared/$(PLATFORM)/$(PROFILE)/obj/%.oe66: ../%.c $(CONFIG)/compiler.opt
        @$(ECHO) "# Making $@ ..."
        $(CC) $(CPPFLAGS) $(CFLAGS) --output_file=$@ -fc $<
 
-%/compiler.opt: %/linker.cmd ;
-%/linker.cmd: Dsp.cfg ../shared/$(PLATFORM)/config.bld
+%/compiler.opt %/linker.cmd: Dsp.cfg ../shared/$(PLATFORM)/config.bld
        @$(ECHO) "#"
        @$(ECHO) "# Making $@ ..."
        $(XDC_INSTALL_DIR)/xs --xdcpath="$(subst +,;,$(PKGPATH))" \
index b6c302de23bd08c88ee07a1e4b25eb091a8526e1..f7afca5530a4bb1ca0c769bf5912ba157c98e3b6 100644 (file)
@@ -325,15 +325,15 @@ Int App_exec(Void)
             bigDataLocalPtr = (UInt32 *)bigDataLocalDesc.localPtr;
 #ifdef DEBUG
             /* print data from big data buffer */
-            Log_print1(Diags_INFO, " Received back buffer %d", msg->id);
-            Log_print0(Diags_INFO, " First 8 bytes: ");
+            Log_print1(Diags_INFO, " Received back buffer %d\n", msg->id);
+            Log_print0(Diags_INFO, " First 8 bytes: \n");
             for ( j = 0; j < 8 && j < bigDataLocalDesc.size/sizeof(uint32_t); j+=4)
-                Log_print4(Diags_INFO, "0x%x, 0x%x, 0x%x, 0x%x",
+                Log_print4(Diags_INFO, "0x%x, 0x%x, 0x%x, 0x%x\n",
                     bigDataLocalPtr[j], bigDataLocalPtr[j+1], bigDataLocalPtr[j+2], bigDataLocalPtr[j+3]);
-            Log_print0(Diags_INFO, " Last 8 bytes: ");
+            Log_print0(Diags_INFO, " Last 8 bytes: \n");
             for ( j = (bigDataLocalDesc.size/sizeof(uint32_t))-8 ;
                  j < bigDataLocalDesc.size/sizeof(uint32_t); j+=4)
-                Log_print4(Diags_INFO, "0x%x, 0x%x, 0x%x, 0x%x",
+                Log_print4(Diags_INFO, "0x%x, 0x%x, 0x%x, 0x%x\n",
                     bigDataLocalPtr[j], bigDataLocalPtr[j+1], bigDataLocalPtr[j+2], bigDataLocalPtr[j+3]);
 #endif
             /* Check values to see expected results */
@@ -347,10 +347,13 @@ Int App_exec(Void)
             HeapMemMP_free(srHeap, bigDataLocalPtr, bigDataLocalDesc.size);
         }
 
+        Log_print1(Diags_INFO, "App_exec: message received %d",
+                (IArg)msg->id);
+
         /* free the message */
         MessageQ_free((MessageQ_Msg)msg);
 
-        Log_print1(Diags_INFO, "App_exec: message received, sending message %d",
+        Log_print1(Diags_INFO, "App_exec: Preparing message %d",
                 (IArg)i);
         /* Receive messages: End =======================================> */
 
@@ -376,7 +379,7 @@ Int App_exec(Void)
             msg->id = i;
 
             /* Allocate buffer from HeapMemMP */
-            bigDataLocalPtr = (UInt32 *)(HeapMemMP_alloc(srHeap, BIGDATA_BUF_SIZE, BIGDATA_ALIGN));
+            bigDataLocalPtr = (UInt32 *)(HeapMemMP_alloc(srHeap, BIGDATA_BUF_SIZE, BIGDATA_BUF_ALIGN));
 
             if (!bigDataLocalPtr) {
                 status = -1;
@@ -411,6 +414,8 @@ Int App_exec(Void)
             }
         }
 
+        Log_print1(Diags_INFO, "App_exec: Sending message %d\n", i);
+
         /* send message */
         MessageQ_put(Module.slaveQue, (MessageQ_Msg)msg);
 
@@ -420,7 +425,6 @@ Int App_exec(Void)
 
     /* drain process pipeline */
     for (i = 1; i <= 3; i++) {
-        Log_print0(Diags_INFO, "App_exec: message received");
 
         /* wait for return message */
         status = MessageQ_get(Module.hostQue, (MessageQ_Msg *)&msg,
@@ -429,6 +433,7 @@ Int App_exec(Void)
         if (status < 0) {
             goto leave;
         }
+        Log_print1(Diags_INFO, "App_exec: message received: %d\n", msg->id);
 
         /* extract message payload */
 
@@ -437,6 +442,9 @@ Int App_exec(Void)
     }
 
 leave:
+    if (srHeap) {
+        HeapMemMP_delete(&srHeap);
+    }
     /* Print error count if non-zero */
     if (errorCount) {
         Log_print1(Diags_INFO, "App_exec: Error Count %d", errorCount);