Fork of the offical HSP_RPC_GUI firmware

Dependencies:   USBDevice

Fork of MAXREFDES100 firmware for MAX32620HSP

Revision:
1:9490836294ea
Parent:
0:e4a10ed6eb92
--- a/HSP/Devices/MAX30101/MAX30101_RPC.cpp	Tue Oct 25 15:22:11 2016 +0000
+++ b/HSP/Devices/MAX30101/MAX30101_RPC.cpp	Fri Apr 21 12:12:30 2017 -0500
@@ -47,7 +47,6 @@
 	uint8_t args[2];
 	uint8_t reply[1];
 	ProcessArgs(argStrs, args, sizeof(args));
-//	Peripherals::max30101()->writeReg(args[0] , args[1]);	// pass in the register address and the data
 	reply[0] = 0x80;
 	FormatReply(reply, sizeof(reply), replyStrs);
 	return 0;
@@ -57,9 +56,8 @@
 int MAX30101_ReadReg(char argStrs[32][32], char replyStrs[32][32]) {
 	uint8_t args[1];
 	uint8_t reply[1];
-	char value;
+	char value = 0;
 	ProcessArgs(argStrs, args, sizeof(args));
-//	Peripherals::max30101()->readReg(args[0] , &value, 1);
 	reply[0] = (uint8_t)value;
 	FormatReply(reply, sizeof(reply), replyStrs);
 	return 0;
@@ -69,11 +67,9 @@
 int MAX30101_COMMinit(char argStrs[32][32], char replyStrs[32][32])
 {
 	uint8_t args[4];
-	uint8_t return_value;
+	uint8_t return_value = 0;
 	ProcessArgs(argStrs,args,sizeof(args));
 
-	//return_value = max30101_COMMinit(args[0], args[1], args[2], args[3]);
-
 	strcpy(replyStrs[0],"80");
 	return return_value;
 }
@@ -82,11 +78,9 @@
 int MAX30101_SpO2mode_stop(char argStrs[32][32], char replyStrs[32][32])
 {
 	uint8_t args[4];
-	uint8_t return_value;
+	uint8_t return_value = 0;
 	ProcessArgs(argStrs,args,sizeof(args));
 
-	//lis2dh_Stop();
-	//max30101_SpO2mode_stop();
 	Peripherals::max30101()->SpO2mode_stop();
 
 	strcpy(replyStrs[0],"80");
@@ -99,7 +93,6 @@
 	uint8_t args[4];
 	ProcessArgs(argStrs,args,sizeof(args));
 
-	//lis2dh_Stop();
 	Peripherals::max30101()->HRmode_stop();
 
 	strcpy(replyStrs[0],"80");
@@ -112,7 +105,6 @@
 	uint8_t args[4];
 	ProcessArgs(argStrs,args,sizeof(args));
 
-	//lis2dh_Stop();
 	Peripherals::max30101()->Multimode_stop();
 
 	strcpy(replyStrs[0],"80");
@@ -121,8 +113,8 @@
 
 //******************************************************************************
 void ClearInOutFifos() {
-	fifo_clear(GetStreamOutFifo());		// clear stream out fifo
-	fifo_clear(GetUSBIncomingFifo());				// clear USB serial incoming fifo
+	fifo_clear(GetStreamOutFifo());	   ///< clear stream out fifo
+	fifo_clear(GetUSBIncomingFifo());  ///< clear USB serial incoming fifo
 }
 
 int highDataRate = 0;
@@ -181,7 +173,9 @@
 
 	ClearInOutFifos();
 	MAX30101_Helper_SetStreamingFlag(eStreaming_SPO2,1);
-	if (args[2] >= MAX30101_200HZ) highDataRate = 1;
+	if (args[2] >= MAX30101_200HZ) {
+      highDataRate = 1;
+    }
 	Peripherals::max30101()->SpO2mode_init(args[0], args[1], args[2], args[3], args[4], args[5]);
 
 	strcpy(replyStrs[0],"80");
@@ -218,7 +212,9 @@
 
 	ClearInOutFifos();
 	MAX30101_Helper_SetStreamingFlag(eStreaming_HR,1);
-	if (args[2] >= MAX30101_200HZ) highDataRate = 1;
+	if (args[2] >= MAX30101_200HZ) {
+      highDataRate = 1;
+    }
 	Peripherals::max30101()->HRmode_init(args[0], args[1], args[2], args[3], args[4]);
 	strcpy(replyStrs[0],"80");
 	return 0;
@@ -259,7 +255,9 @@
 
 	ClearInOutFifos();
 	MAX30101_Helper_SetStreamingFlag(eStreaming_MULTI, 1);
-	if (args[2] >= MAX30101_200HZ) highDataRate = 1;
+	if (args[2] >= MAX30101_200HZ) {
+      highDataRate = 1;
+    }
 	Peripherals::max30101()->Multimode_init(args[0], args[1], args[2],
 											args[3], args[4], args[5], args[6],
 											args[7], args[8], args[9], args[10]);