
On 28. Aug 2013, at 15:54 , Georgi Grinshpun <Georgi.Grinshpun@rwth-aachen.de> wrote:
What do you mean? As i know execution time is not affected by Lock?
I meant, that the initialize method is not called 1000-10000 a second, and therefore the Lock overhead (3-10 cycles) is not so important.
Initialize methods may be used during usual execution also, so interrupts of given modules may cause initialization fail.
I will add it then.
By the way initialize methods should assume arbitrary values in configuration registers, and not default values, which is not always easy and not everywhere done.
I am thinking of adding the initialize() method into the interface as well. Currently we have the following initialize concepts: Uart::initialize< (int) Baudrate >(); Spi::initialize< (int) Frequency >(Mode); I2c::initilaize< (enum class) DataRate >(); SoftwareSpi and SoftwareI2c initializers have the same syntax, so you can have a true drop-in replacement. I think it makes a lot of sense to specify these minimum initializers also in the interfaces, along with some developer comments about using Lock and watching out for arbitrary register values. Niklas