--- a/main.c
+++ b/main.c
@@ -58,9 +58,12 @@
   ******************************************************************************
   */
 
+#define MAIN_PROFILING
 
 void main(void)
 {
+  volatile unsigned char dummy;
+  
 #ifdef MAIN_PROFILING
   GPIOD->DDR = GPIO_PIN_0;
   GPIOD->CR1 = GPIO_PIN_0;
@@ -83,6 +86,8 @@
  		UART2_PARITY_NO, 
  		UART2_SYNCMODE_CLOCK_DISABLE,
  		UART2_MODE_TXRX_ENABLE);
+  
+  InitRXBuffer();
  
   enableInterrupts();
   
@@ -94,7 +99,8 @@
     GPIOD->ODR |= GPIO_PIN_0;
 #endif 
     
-    if(UART2_IsRX()) 
+    
+    if(RXBuffer_HasBytes()) 
     { 
       process_cmd();
     }