Menu

#33 gptGetCounter/gptGetInterval

closed
None
4
2014-03-08
2014-02-11
Kayo
No

In some advanced use cases of General Purpose Timer (like a stepper-motors control loop) two useful routines are needed:

gptcnt_t gptGetCounter(GPTDriver gptp) — to get current counter value
gptcnt_t gptGetInterval(GPTDriver
gptp) — to get last used interval

Discussion

  • Giovanni Di Sirio

    Hi,

    This creates a portability issue because the counter behaviour is not specified, it could:
    - Downward counting and reset to N.
    - Upward counting and reset to zero.
    - Ever increasing.
    etc.

    The interval should be possible.

     
  • Giovanni Di Sirio

    Both have been added to ChibiOS 3.0. gptGetCounterX() has a note about the counter behavior.

     
  • Giovanni Di Sirio

    • status: open --> closed
    • assigned_to: Giovanni Di Sirio
    • Priority: 5 --> 4
     

Log in to post a comment.