Revision 0f37fb41

View differences:

devices/DiWheelDrive/DiWheelDrive.cpp
98 98
      }
99 99
      break;
100 100
    case CAN::SET_LINE_FOLLOW_SPEED:
101
      if (frame->DLC == 8) {
102
        uint8_t speedForward    = frame->data8[0];
103
        uint8_t speedSoftLeft0  = frame->data8[1];
104
        uint8_t speedSoftLeft1  = frame->data8[2];
105
        uint8_t speedHardLeft0  = frame->data8[3];
106
        uint8_t speedHardLeft1  = frame->data8[4];
107
        global.rpmForward[0] = speedForward;
108
        global.rpmForward[1] = speedForward;
109
        global.rpmSoftLeft[0] = speedSoftLeft0;
110
        global.rpmSoftLeft[1] = speedSoftLeft1;
111
        global.rpmHardLeft[0] = speedHardLeft0;
112
        global.rpmHardLeft[1] = speedHardLeft1;
101
      if (frame->DLC == 5) {
102
        global.rpmForward[0] = frame->data8[0];
103
        global.rpmForward[1] = frame->data8[0];
104
        global.rpmSoftLeft[0] = frame->data8[1];
105
        global.rpmSoftLeft[1] = frame->data8[2];
106
        global.rpmHardLeft[0] = frame->data8[3];
107
        global.rpmHardLeft[1] = frame->data8[4];
113 108
        global.rpmSoftRight[0] = global.rpmSoftLeft[1];
114 109
        global.rpmSoftRight[1] = global.rpmSoftLeft[0];
115 110
        global.rpmHardRight[0] = global.rpmHardLeft[1];

Also available in: Unified diff