end2endzone / win32Arduino

win32Arduino is a windows/linux implementation of many arduino functions to allow an arduino library developer to unit test code outside of the arduino platform.
MIT License
2 stars 2 forks source link

Refactor the time strategies #3

Closed end2endzone closed 6 years ago

end2endzone commented 6 years ago

Create an enum for strategies:

Create the functions that matches each strategies:

end2endzone commented 6 years ago

Regroup functions by strategies.

end2endzone commented 6 years ago

The CLOCK_MANUAL strategy may not be required. The CLOCK_AUTO_INCREMENT strategy may be redundent.

end2endzone commented 6 years ago

CLOCK_SIMULATION need to be renamed to something better like CLOCK_AUTO_INCREMENT or CLOCK_INCREMENTAL. The solution must clearly identify that time increases automatically by a given step each time the millis() or micros() function is called.

end2endzone commented 6 years ago

The setMicrosResolution() function will remain the same to be consistent with the arduino micros() function documentation which uses the term 'resolution' instead of 'increments'. The function may be renamed to setMicrosecondsResolution(). The documentation of the function should state that it defines the minimum increments of the microseconds counter.