lab 1 code

Dependencies:   CMSIS-DSP_for_STM32F746G BSP_DISCO_F746NG

Revision:
10:a82b64ea1d11
Parent:
9:f5b37c71856d
Child:
11:4256dbbb0c89
--- a/main.cpp	Sun Dec 29 04:15:45 2019 +0000
+++ b/main.cpp	Sun Dec 29 06:29:49 2019 +0000
@@ -44,7 +44,7 @@
 static void Draw_Trace(uint16_t Xpos, uint16_t L_Ypos, uint16_t R_Ypos, uint16_t* Mem_start, uint16_t Length);
 
 uint32_t counter = 0;
-char buf[10];
+char buf[40];
 int first_half_time, second_half_time, total_time;
 
 int main()
@@ -123,21 +123,18 @@
         //Erase_Trace(OSC_START_X_POS+OSC_LINE_SIZE, L_CHANNEL_Y_POS, R_CHANNEL_Y_POS, 50);
         //Draw_Trace(OSC_START_X_POS+OSC_LINE_SIZE, L_CHANNEL_Y_POS, R_CHANNEL_Y_POS, (uint16_t *) AUDIO_BUFFER_IN + (AUDIO_BLOCK_SIZE), 50);
         
+        
+        
         counter++;
-        sprintf(buf, "%d", counter);
+        sprintf(buf, "Cycles: %9d", counter);
         BSP_LCD_SetTextColor(LCD_COLOR_RED);
-        BSP_LCD_DisplayStringAt(0, 46, (uint8_t *) buf, LEFT_MODE);
+        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);
         
+        audio_rec_buffer_state = BUFFER_OFFSET_NONE;
         second_half_time = timer.read_us();
         
-        sprintf(buf, "%10d", first_half_time);
-        BSP_LCD_DisplayStringAt(0, 20, (uint8_t *) buf, LEFT_MODE);
-        sprintf(buf, "%10d", second_half_time);
-        BSP_LCD_DisplayStringAt(100, 20, (uint8_t *) buf, LEFT_MODE);
-        sprintf(buf, "%10d", total_time);
-        BSP_LCD_DisplayStringAt(200, 20, (uint8_t *) buf, LEFT_MODE);
-        
-        audio_rec_buffer_state = BUFFER_OFFSET_NONE;
     }
 }