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]
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);
}
......@@ -109,11 +104,9 @@ bool WhillModelC::streaming(bool b, uint16_t interval, DATASET n, SPEEDMODE mode
void WhillModelC::parse()
{
static uint32_t prev_ms = millis();
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.error_code = 253;
......@@ -122,7 +115,7 @@ void WhillModelC::parse()
while(serial->available() > 0)
{
prev_ms = millis();
prev_streaming_ms = millis();
char data = serial->read();
unpacker.feed(data);
......@@ -131,8 +124,6 @@ void WhillModelC::parse()
{
if (unpacker.dataset() == (uint8_t)DATASET::SPEED_PROFILE)
{
Serial.print("Speed Profile buffer is changed : ");
Serial.println(millis());
#ifdef DEBUG_INFO
printSpeedProfile();
#endif
......@@ -149,8 +140,6 @@ void WhillModelC::parse()
}
else if (unpacker.dataset() == (uint8_t)DATASET::SENSOR_INFO)
{
Serial.print("Sensor Info buffer is changed : ");
Serial.println(millis());
#ifdef DEBUG_INFO
printSensorInfo();
#endif
......
......@@ -155,6 +155,8 @@ private:
SpeedProfile spd_profile;
Status status;
StreamingInfo streaming_info;
uint32_t prev_streaming_ms;
};
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