v01d commented on pull request #1248: URL: https://github.com/apache/incubator-nuttx/pull/1248#issuecomment-646051733
> We currently have ONESHOT_MAX_DELAY() macro, so the additional ONESHOT_MIN_DELAY() macro seems like a good idea. Adding that macro can be useful but not modifying the code for when the timer period counter is rounded to zero means that one would be always be forced to ensure it is not requesting a delay less than the minimum settable delay. Since it is expected that if you're setting up the oneshot timer you want it to trigger, I would consider this special case and round up, not down, so that any requested time below min_delay fires after min_delay. Then, if it is important to the caller to know if the requested delay will be achievable, min_delay can be used to check. > It seems to me that not only stm32l4 is affected by this problem, so it would be good to make the right decision here. > You're right, this should probably be extended to other platforms. At least for STM32 I think this is always the case (ARR needs to be at least 1) but I'm not sure about which others. > In the case of start_tune(), why not just call oneshot_callback() directly? Maybe @acassis can answer that. Yes, that's probably simpler. I assumed it was required that the callback be from an interrupt context for some reason. ---------------------------------------------------------------- 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: us...@infra.apache.org