Skip to content

Commit

Permalink
drop report instead of pausing
Browse files Browse the repository at this point in the history
  • Loading branch information
darknao committed Oct 14, 2018
1 parent 4ecac41 commit 47a88bc
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions src/csw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -598,19 +598,27 @@ void loop() {
Serial.println(String("usb loop time : ") + delta_t);
#endif

if (delta_t <= MAX_SPEED)
if (delta_t >= MAX_SPEED)
{
delayMicroseconds(MAX_SPEED - delta_t);
// delayMicroseconds(MAX_SPEED - delta_t);
#ifdef HAS_DEBUG
Serial.println(String("usb loop time pre send: ") + (micros() - usb_time));
#endif
Joystick.send_now();
#ifdef HAS_DEBUG
Serial.println(String("usb loop time post send: ") + (micros() - usb_time));
#endif
usb_time = micros();
}
else {
#ifdef HAS_DEBUG
Serial.println(String("skipping report"));
#endif
}
}
#ifdef HAS_DEBUG
Serial.println(String("usb loop time pre send: ") + (micros() - usb_time));
#endif
Joystick.send_now();
#ifdef HAS_DEBUG
Serial.println(String("usb loop time post send: ") + (micros() - usb_time));
#endif
usb_time = micros();



// rotary_debounce = 0;
#else
uint32_t timout;
Expand Down

0 comments on commit 47a88bc

Please # to comment.