Q

Dependencies:   mbed

Fork of RD117_MBED by Maxim Integrated

Revision:
4:5273ab1085ab
Parent:
3:7c0fb55eb3ff
--- a/main.cpp	Thu Apr 21 19:38:17 2016 +0000
+++ b/main.cpp	Thu May 19 22:04:06 2016 +0000
@@ -4,31 +4,28 @@
 * Filename: main.cpp
 * Description: This module contains the Main application for the MAXREFDES117 example program.
 *
-* Revision History:
-*\n 1-18-2016 Rev 01.00 GL Initial release.
-*\n
 *
 * --------------------------------------------------------------------
 *
 * This code follows the following naming conventions:
 *
-*\n char              ch_pmod_value
-*\n char (array)      s_pmod_s_string[16]
-*\n float             f_pmod_value
-*\n int32_t           n_pmod_value
-*\n int32_t (array)   an_pmod_value[16]
-*\n int16_t           w_pmod_value
-*\n int16_t (array)   aw_pmod_value[16]
-*\n uint16_t          uw_pmod_value
-*\n uint16_t (array)  auw_pmod_value[16]
-*\n uint8_t           uch_pmod_value
-*\n uint8_t (array)   auch_pmod_buffer[16]
-*\n uint32_t          un_pmod_value
-*\n int32_t *         pn_pmod_value
+* char              ch_pmod_value
+* char (array)      s_pmod_s_string[16]
+* float             f_pmod_value
+* int32_t           n_pmod_value
+* int32_t (array)   an_pmod_value[16]
+* int16_t           w_pmod_value
+* int16_t (array)   aw_pmod_value[16]
+* uint16_t          uw_pmod_value
+* uint16_t (array)  auw_pmod_value[16]
+* uint8_t           uch_pmod_value
+* uint8_t (array)   auch_pmod_buffer[16]
+* uint32_t          un_pmod_value
+* int32_t *         pn_pmod_value
 *
 * ------------------------------------------------------------------------- */
 /*******************************************************************************
-* Copyright (C) 2015 Maxim Integrated Products, Inc., All Rights Reserved.
+* Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
@@ -64,18 +61,17 @@
 * \section intro_sec Introduction
 *
 * This is the code documentation for the MAXREFDES117# subsystem reference design.
-* \n
-* \n The Files page contains the File List page and the Globals page.
-* \n
-* \n The Globals page contains the Functions, Variables, and Macros sub-pages.
+* 
+*  The Files page contains the File List page and the Globals page.
+* 
+*  The Globals page contains the Functions, Variables, and Macros sub-pages.
 *
 * \image html MAXREFDES117_Block_Diagram.png "MAXREFDES117# System Block Diagram"
-* \n
+* 
 * \image html MAXREFDES117_firmware_Flowchart.png "MAXREFDES117# Firmware Flowchart"
 *
 */
 #include "mbed.h"
-#include "main.h"
 #include "algorithm.h"
 #include "MAX30102.h"
 
@@ -122,7 +118,7 @@
     //wait until the user presses a key
     while(pc.readable()==0)
     {
-        pc.printf("%c[2J",27);  //clear terminal program screen
+        pc.printf("\x1B[2J");  //clear terminal program screen
         pc.printf("Press any key to start conversion\n\r");
         wait(1);
     }
@@ -157,7 +153,7 @@
     
     
     //calculate heart rate and SpO2 after first 500 samples (first 5 seconds of samples)
-    maxim_heart_rate_and_oxygen_saturation(aun_ir_buffer, n_ir_buffer_length, aun_red_buffer ,  &n_sp02, &ch_spo2_valid , &n_heart_rate , &ch_hr_valid); 
+    maxim_heart_rate_and_oxygen_saturation(aun_ir_buffer, n_ir_buffer_length, aun_red_buffer, &n_sp02, &ch_spo2_valid, &n_heart_rate, &ch_hr_valid); 
     
     //Continuously taking samples from MAX30102.  Heart rate and SpO2 are calculated every 1 second
     while(1)
@@ -209,16 +205,15 @@
 #endif
             //send samples and calculation result to terminal program through UART
             pc.printf("red=");
-            pc.printf("%i",aun_red_buffer[i]);
+            pc.printf("%i", aun_red_buffer[i]);
             pc.printf(", ir=");
             pc.printf("%i", aun_ir_buffer[i]);
-            pc.printf(", HR=%i, ",n_heart_rate); 
-            pc.printf("HRvalid=%i, ",ch_hr_valid);
-            pc.printf("SpO2=%i, ",n_sp02);
-            pc.printf("SPO2Valid=%i\n\r",ch_spo2_valid);
+            pc.printf(", HR=%i, ", n_heart_rate); 
+            pc.printf("HRvalid=%i, ", ch_hr_valid);
+            pc.printf("SpO2=%i, ", n_sp02);
+            pc.printf("SPO2Valid=%i\n\r", ch_spo2_valid);
         }
-        maxim_heart_rate_and_oxygen_saturation(aun_ir_buffer, n_ir_buffer_length, aun_red_buffer ,  &n_sp02, &ch_spo2_valid , &n_heart_rate , &ch_hr_valid); 
-
+        maxim_heart_rate_and_oxygen_saturation(aun_ir_buffer, n_ir_buffer_length, aun_red_buffer, &n_sp02, &ch_spo2_valid, &n_heart_rate, &ch_hr_valid); 
     }
 }
  
\ No newline at end of file