raiden00pl commented on pull request #1248: URL: https://github.com/apache/incubator-nuttx/pull/1248#issuecomment-646229938
I think it is the responsibility of the caller to provide a valid input data for the called function. If the input is incorrect, we expect the called function to return an error. We're discussing a rare situation so in most cases there will never be a problem. But if a problem occurs, we have the following options: 1. Trigger the callback with an incorrect time. The caller thinks everything is OK. We can spend hours searching for why something is wrong. 2. Do not trigger the callback and return the error code. The caller knows that something is wrong. sleep()/usleep() are not designed to provide precise time delays, but one-shot timers are based on more precise timers, so they can be used for more precise triggering. Looking for time-related bugs in a situation where the system gives no feedback can be a nightmare :) ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
