diff projects/d-box/DboxSensors.cpp @ 15:901d205d1a3c

Updated to latest PRU library; external PRU file no longer needed. Also catch SIGTERM as well as SIGINT to clean up gracefully.
author andrewm
date Sat, 07 Feb 2015 16:41:56 +0000
parents 8a575ba3ab52
children
line wrap: on
line diff
--- a/projects/d-box/DboxSensors.cpp	Fri Jan 23 15:35:10 2015 +0000
+++ b/projects/d-box/DboxSensors.cpp	Sat Feb 07 16:41:56 2015 +0000
@@ -13,14 +13,14 @@
 
 
 
-int DboxSensors::initSensors(int tk0_bus, int tk0_address, int tk1_bus, int tk1_address, int tk_file, int fsr_pin, int fsrmax, bool useNewSensors, int gpio_0, int gpio_1)
+int DboxSensors::initSensors(int tk0_bus, int tk0_address, int tk1_bus, int tk1_address, int tk_file, int fsr_pin, int fsrmax, int sensorTypeToUse, int gpio_0, int gpio_1)
 {
-	newSensors = useNewSensors;
+	sensorType = sensorTypeToUse;
 	// init first touch key on i2c bus
 	if(tk0_address >= 0) {
 		if(TK0.initI2C_RW(tk0_bus, tk0_address, tk_file)>0)
 			return 1;
-		if(TK0.initTouchKey(newSensors)>0)
+		if(TK0.initTouchKey(sensorType)>0)
 			return 2;
 	}
 
@@ -28,7 +28,7 @@
 	if(tk1_address >= 0) {
 		if(TK1.initI2C_RW(tk1_bus, tk1_address, tk_file)>0)
 			return 1;
-		if(TK1.initTouchKey(newSensors)>0)
+		if(TK1.initTouchKey(sensorType)>0)
 			return 2;
 	}
 
@@ -77,7 +77,7 @@
 
 
 	int max = 3;
-	if(newSensors)
+	if(sensorType != kSensorTypeTouchKey)
 		max = 5;
 	// if touches detected on main touch key
 	if(tk0_touchCnt == 0 && tk1_touchCnt == 0)
@@ -131,7 +131,7 @@
 void DboxSensors::resetSensorsData()
 {
 	int max = 3;
-	if(newSensors)
+	if(sensorType != kSensorTypeTouchKey)
 		max = 5;
 
 	for(int i=0; i<max; i++)