Commit 2202fd10 by Hideaki Tai

fix whill communication error report

parent f2cb86d2
...@@ -63,11 +63,6 @@ bool WhillModelC::moveVel(float y, float x) // [m/s] ...@@ -63,11 +63,6 @@ bool WhillModelC::moveVel(float y, float x) // [m/s]
lr = constrain(lr, -100, 100); lr = constrain(lr, -100, 100);
} }
// Serial.println("move 0-100 (y, x)");
// Serial.print(fb);
// Serial.print(", ");
// Serial.println(lr);
return this->move((int8_t)fb, (int8_t)lr); return this->move((int8_t)fb, (int8_t)lr);
} }
...@@ -109,11 +104,9 @@ bool WhillModelC::streaming(bool b, uint16_t interval, DATASET n, SPEEDMODE mode ...@@ -109,11 +104,9 @@ bool WhillModelC::streaming(bool b, uint16_t interval, DATASET n, SPEEDMODE mode
void WhillModelC::parse() void WhillModelC::parse()
{ {
static uint32_t prev_ms = millis();
if (streaming_info.is_streaming) if (streaming_info.is_streaming)
{ {
if ((millis() - prev_ms) > STATUS_RECEIVE_TIMEOUT) if ((millis() - prev_streaming_ms) > STATUS_RECEIVE_TIMEOUT)
{ {
status.info.battery.percent = 0; status.info.battery.percent = 0;
status.info.error_code = 253; status.info.error_code = 253;
...@@ -122,7 +115,7 @@ void WhillModelC::parse() ...@@ -122,7 +115,7 @@ void WhillModelC::parse()
while(serial->available() > 0) while(serial->available() > 0)
{ {
prev_ms = millis(); prev_streaming_ms = millis();
char data = serial->read(); char data = serial->read();
unpacker.feed(data); unpacker.feed(data);
...@@ -131,8 +124,6 @@ void WhillModelC::parse() ...@@ -131,8 +124,6 @@ void WhillModelC::parse()
{ {
if (unpacker.dataset() == (uint8_t)DATASET::SPEED_PROFILE) if (unpacker.dataset() == (uint8_t)DATASET::SPEED_PROFILE)
{ {
Serial.print("Speed Profile buffer is changed : ");
Serial.println(millis());
#ifdef DEBUG_INFO #ifdef DEBUG_INFO
printSpeedProfile(); printSpeedProfile();
#endif #endif
...@@ -149,8 +140,6 @@ void WhillModelC::parse() ...@@ -149,8 +140,6 @@ void WhillModelC::parse()
} }
else if (unpacker.dataset() == (uint8_t)DATASET::SENSOR_INFO) else if (unpacker.dataset() == (uint8_t)DATASET::SENSOR_INFO)
{ {
Serial.print("Sensor Info buffer is changed : ");
Serial.println(millis());
#ifdef DEBUG_INFO #ifdef DEBUG_INFO
printSensorInfo(); printSensorInfo();
#endif #endif
......
...@@ -155,6 +155,8 @@ private: ...@@ -155,6 +155,8 @@ private:
SpeedProfile spd_profile; SpeedProfile spd_profile;
Status status; Status status;
StreamingInfo streaming_info; StreamingInfo streaming_info;
uint32_t prev_streaming_ms;
}; };
WHILL_NAMESPACE_END WHILL_NAMESPACE_END
......
  • Markdown is supported
    0% or
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or sign in to comment