comparison projects/d-box/sensors.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 18d03901f866
comparison
equal deleted inserted replaced
14:06f93bef7dd2 15:901d205d1a3c
54 54
55 55
56 56
57 using namespace std; 57 using namespace std;
58 58
59 int initSensorLoop(int sensorAddress0, int sensorAddress1, bool useNewSensors) 59 int initSensorLoop(int sensorAddress0, int sensorAddress1, int sensorType)
60 { 60 {
61 int tk0_bus = 1; 61 int tk0_bus = 1;
62 int tk0_address = sensorAddress0; 62 int tk0_address = sensorAddress0;
63 int tk1_bus = 1; 63 int tk1_bus = 1;
64 int tk1_address = sensorAddress1; 64 int tk1_address = sensorAddress1;
67 int fsr_pinNum = 4; 67 int fsr_pinNum = 4;
68 68
69 if(gVerbose==1) 69 if(gVerbose==1)
70 cout << "---------------->Init Control Thread" << endl; 70 cout << "---------------->Init Control Thread" << endl;
71 71
72 if(Sensors.initSensors(tk0_bus, tk0_address, tk1_bus, tk1_address, tk_file, fsr_pinNum, fsr_max, useNewSensors)>0) 72 if(Sensors.initSensors(tk0_bus, tk0_address, tk1_bus, tk1_address, tk_file, fsr_pinNum, fsr_max, sensorType)>0)
73 { 73 {
74 gShouldStop = 1; 74 gShouldStop = 1;
75 cout << "control cannot start" << endl; 75 cout << "control cannot start" << endl;
76 return -1; 76 return -1;
77 } 77 }