History

Merge branch 'master' of git://github.com/worklist/hifi into 19262

tosh committed 13 years ago

Commit 1e635252 parents bf5f54c f0d891b43 files · +1161 −1184Browse files

Showing the changes to interface/src/SerialInterface.cpp (1 of 43 files). Show all

Unified · Split

interface/src/SerialInterface.cpp+6−7
@@ -167,14 +167,14 @@ void SerialInterface::readData() { · 166 unmodified lines
167167
168168 int initialSamples = totalSamples;
169169
170− while (read(serialFd, &bufchar, 1) > 0) {
171− //std::cout << bufchar[0];
170+ while (read(serialFd, &bufchar, 1) > 0) {
171+ //printLof("%c", bufchar[0]);
172172 serialBuffer[serialBufferPos] = bufchar[0];
173173 serialBufferPos++;
174174 // Have we reached end of a line of input?
175175 if ((bufchar[0] == '\n') || (serialBufferPos >= MAX_BUFFER)) {
176176 std::string serialLine(serialBuffer, serialBufferPos-1);
177− //std::cout << serialLine << "\n";
177+ //printLog("%s\n", serialLine.c_str());
178178 int spot;
179179 //int channel = 0;
180180 std::string val;
@@ -182,7 +182,7 @@ void SerialInterface::readData() { · 1 unmodified line
182182 spot = serialLine.find_first_of(" ", 0);
183183 if (spot != std::string::npos) {
184184 val = serialLine.substr(0,spot);
185− //std::cout << val << "\n";
185+ //printLog("%s\n", val.c_str());
186186 if (i < NUM_CHANNELS) lastMeasured[i] = atoi(val.c_str());
187187 else samplesAveraged = atoi(val.c_str());
188188 } else LED = atoi(serialLine.c_str());
@@ -208,8 +208,7 @@ void SerialInterface::readData() { · 19 unmodified lines
208208 }
209209 if (totalSamples == GRAVITY_SAMPLES) {
210210 gravity = glm::normalize(gravity);
211− std::cout << "gravity: " << gravity.x << "," <<
212− gravity.y << "," << gravity.z << "\n";
211+ printLof("gravity: %f,%f,%f\n", gravity.x, gravity.y, gravity.z);
213212 }
214213
215214 totalSamples++;
@@ -222,7 +221,7 @@ void SerialInterface::readData() { · 6 unmodified lines
222221 gettimeofday(&now, NULL);
223222
224223 if (diffclock(&lastGoodRead, &now) > NO_READ_MAXIMUM_MSECS) {
225− std::cout << "No data - Shutting down SerialInterface.\n";
224+ printLog("No data - Shutting down SerialInterface.\n");
226225 resetSerial();
227226 }
228227 } else {