lab 1 code

Dependencies:   CMSIS-DSP_for_STM32F746G BSP_DISCO_F746NG

Revision:
26:023edf8cea6c
Parent:
25:5412779376a7
Child:
30:debea332cdfe
--- a/main.cpp	Wed Jan 01 06:47:21 2020 +0000
+++ b/main.cpp	Wed Jan 01 17:17:36 2020 +0000
@@ -133,6 +133,12 @@
         /* Copy recorded 1st half block into the audio buffer that goes out */
         memcpy((uint16_t *)(AUDIO_BUFFER_OUT), (uint16_t *)(Processed_audio), AUDIO_BLOCK_SIZE);
 
+        /* Display useful cycle information (split up information display so the processing is more balanced) */
+        sprintf(buf, "Cycles: %9d", counter);
+        BSP_LCD_SetTextColor(LCD_COLOR_RED);
+        BSP_LCD_DisplayStringAt(0, 46, (uint8_t *) buf, LEFT_MODE);                
+
+
         /* Capture the timing of the first half processing */
         first_half_time = timer.read_us();
     /* End First Half */
@@ -161,11 +167,8 @@
         memcpy((uint16_t *)(AUDIO_BUFFER_OUT + (AUDIO_BLOCK_SIZE)), (uint16_t *) (Processed_audio), AUDIO_BLOCK_SIZE);
                 
         /* Compute important cycle information and display it*/
-        counter++;
-        sprintf(buf, "Cycles: %9d", counter);
+        sprintf(buf, "1:%6d 2:%6d T:%6d", first_half_time, second_half_time, total_time);
         BSP_LCD_SetTextColor(LCD_COLOR_RED);
-        BSP_LCD_DisplayStringAt(0, 46, (uint8_t *) buf, LEFT_MODE);                
-        sprintf(buf, "1:%6d 2:%6d T:%6d", first_half_time, second_half_time, total_time);
         BSP_LCD_DisplayStringAt(0, 20, (uint8_t *) buf, LEFT_MODE);
 
         /* Copy recorded 2nd half block into audio output buffer */
@@ -173,6 +176,9 @@
             
         /* Change the recording buffer state to reflect the status of the buffer */   
         audio_rec_buffer_state = BUFFER_OFFSET_NONE;
+
+        /* Increase the counter */
+        counter++;
         
         /* Measures the amount of time to process the second half */    
         second_half_time = timer.read_us();