Reverse regression in previous commit

This commit is contained in:
Paul Dino Jones 2024-08-04 17:07:09 -04:00
parent 6b9c688bcc
commit 47cf4b3fa9
1 changed files with 6 additions and 15 deletions

View File

@ -79,26 +79,17 @@ int arduino_simhaptic_update(SimDevice* this, SimData* simdata)
{ {
if (motor == 0 || motor == 4 || motor == 7 || motor == 8 || motor == 10 || motor == 11 || motor == 13 || motor == 14) if (motor == 0 || motor == 4 || motor == 7 || motor == 8 || motor == 10 || motor == 11 || motor == 13 || motor == 14)
{ {
if(play != serialdevice->u.simhapticdata.motor1) serialdevice->u.simhapticdata.effect1 = effectspeed;
{ serialdevice->u.simhapticdata.motor1 = 1;
serialdevice->u.simhapticdata.effect1 = effectspeed; slogt("Updating arduino haptic device with effect type %i speed motor speed %i on motor %i from original effect %f", this->hapticeffect.effecttype, serialdevice->u.simhapticdata.effect3, serialdevice->motorsposition, rplay);
slogt("Updating arduino haptic device with effect type %i speed motor speed %i on motor %i from original effect %f", this->hapticeffect.effecttype, serialdevice->u.simhapticdata.effect1, serialdevice->motorsposition, rplay);
}
} }
if (motor == 2 || motor == 6 || motor == 8 || motor == 9 || motor == 10 || motor == 11 || motor == 12 || motor == 14) if (motor == 2 || motor == 6 || motor == 8 || motor == 9 || motor == 10 || motor == 11 || motor == 12 || motor == 14)
{ {
if(play != serialdevice->u.simhapticdata.motor3) serialdevice->u.simhapticdata.effect3 = effectspeed;
{ serialdevice->u.simhapticdata.motor3 = 1;
serialdevice->u.simhapticdata.effect3 = effectspeed; slogt("Updating arduino haptic device with effect type %i speed motor speed %i on motor %i from original effect %f", this->hapticeffect.effecttype, serialdevice->u.simhapticdata.effect3, serialdevice->motorsposition, rplay);
slogt("Updating arduino haptic device with effect type %i speed motor speed %i on motor %i from original effect %f", this->hapticeffect.effecttype, serialdevice->u.simhapticdata.effect3, serialdevice->motorsposition, rplay);
}
} }
serialdevice->state = play; serialdevice->state = play;
serialdevice->u.simhapticdata.motor1 = play;
serialdevice->u.simhapticdata.motor2 = play;
serialdevice->u.simhapticdata.motor3 = play;
serialdevice->u.simhapticdata.motor4 = play;
} }
size_t size = sizeof(SimHapticData); size_t size = sizeof(SimHapticData);