You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mynewt.apache.org by will sanfilippo <wi...@runtime.io> on 2016/07/01 21:54:20 UTC

OS_TICKS_PER_SEC

Hello:

Recently there has been some discussion amongst some of us regarding the value of OS_TICKS_PER_SEC.

There are two things I want to bring up here. The first is that the default is 1000 (or 1024 in some cases). The second is where this is defined.

Typically, most RTOS’s really dont need a 1 millisecond tick; that is pretty fast. If this were to change to a 10 msec tick (100 ticks per second; would be 128 for devices using a 32.768 kHz crystal) would anyone object?

Related to the above issue is where we define OS_TICKS_PER_SEC. In my opinion where it is placed now is not optimal; it is in the hw/mcu directories. What this means is that any application/target being built will have to live with the OS_TICKS_PER_SEC defined in the MCU directory. It seems to me that a more appropriate place would be in the application or as a target variable. I guess we could have put this in the BSP as well but not quite sure it belongs there either. It could be that there is simply no great solution for this...

Anyway, unless I hear objections, I will be changing the OS_TICKS_PER_SEC for the nrf51 and nrf52. Other mcu’s may get changed later.

Thanks

Will



Re: OS_TICKS_PER_SEC

Posted by Kevin Townsend <ke...@adafruit.com>.
BSP isn't perfect either but this is still more of a board or project level
decision in my mind than the more generic MCU level so my vote would be
moving it to the BSP. It's much easier to spin a new BSP than it is modify
the MCU level code.

Also breaking the clock source out to the MCU code makes sense as well as
discussed previously with the nRF51. We have boards with no 32kHz XTAL to
control cost for example. Clock setup will often be BSP specific.

Kevin

Le vendredi 1 juillet 2016, will sanfilippo <wi...@runtime.io> a écrit :

> Hello:
>
> Recently there has been some discussion amongst some of us regarding the
> value of OS_TICKS_PER_SEC.
>
> There are two things I want to bring up here. The first is that the
> default is 1000 (or 1024 in some cases). The second is where this is
> defined.
>
> Typically, most RTOS’s really dont need a 1 millisecond tick; that is
> pretty fast. If this were to change to a 10 msec tick (100 ticks per
> second; would be 128 for devices using a 32.768 kHz crystal) would anyone
> object?
>
> Related to the above issue is where we define OS_TICKS_PER_SEC. In my
> opinion where it is placed now is not optimal; it is in the hw/mcu
> directories. What this means is that any application/target being built
> will have to live with the OS_TICKS_PER_SEC defined in the MCU directory.
> It seems to me that a more appropriate place would be in the application or
> as a target variable. I guess we could have put this in the BSP as well but
> not quite sure it belongs there either. It could be that there is simply no
> great solution for this...
>
> Anyway, unless I hear objections, I will be changing the OS_TICKS_PER_SEC
> for the nrf51 and nrf52. Other mcu’s may get changed later.
>
> Thanks
>
> Will
>
>
>