arduino_ci icon indicating copy to clipboard operation
arduino_ci copied to clipboard

Add GODMODE-configurable delay to system calls

Open ianfixes opened this issue 7 years ago • 0 comments

Summary

Time is expected to pass in the real world. In the mocked unit test environment, it doesn't. This means that otherwise-normal code will infinitely loop in tests

Arduino or Unit Test Code, Illustrating the Problem

  while((millis() < wait_timer) && (!FLAG_ABORT_PENDING)) {
    // waiting for random wait to finish
  }

Proposed solution

Add a configurable delay (0 by default) to all system calls: millis() most importantly, but also things like analogRead and analogWrite.

ianfixes avatar Apr 20 '18 13:04 ianfixes