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

Assign callback functions for time based event programming #10

Closed end2endzone closed 6 years ago

end2endzone commented 6 years ago
end2endzone commented 6 years ago

In other words... When clock mode is simulated, allow a user to set a callback that is triggered when the simulation time matches the given time of the callback registration. The callback can be used in test cases for simulatin event that comes from the outside world

void attachMillisecondsCallback(uint32_t time, Callback func);
void attachMicrosecondsCallback(uint32_t time, Callback func);

ie

attachMillisecondsCallback(500, &foobar); //run foobar() function when elapsed time is 500ms
end2endzone commented 6 years ago

Completed implementation in revision bd10575cce54c6fd7cd79092b0152eee9c8bae32