Re: Doubt regarding drivers implementation
Posted: Mon Aug 05, 2019 8:09 pm
Wow, that was fast!
1) I'm not sure if I'm using any ch function, as long as I can tell, I'm only using chnAddFlagsI that starts with "ch".
2) I followed the i2c fallback as example, it has some instances defined, so I just believed it was the norm. Removed.
3) I did regarding IO lines(IO Lines Config), the GPT driver itself is a #define(GPT Driver define), because the same GPT is used across all instances, so no need to define it in every instance.
4) I'll work on that, is that OK to create a function to be called every "tick"? In my driver, a tick is 3 times de baud rate. I used it that way because I thought that it would be too cumbersome to the user to do that, but sounds more flexible that way.
5) The static variable is because I was using a single timer to all instances, so I needed to know when the last one called "stop" so I could stop the GPT. I'll work based on #4.
Will refactor things and let you know.
1) I'm not sure if I'm using any ch function, as long as I can tell, I'm only using chnAddFlagsI that starts with "ch".
2) I followed the i2c fallback as example, it has some instances defined, so I just believed it was the norm. Removed.
Code: Select all
/** @brief I2C1 driver identifier.*/
#if SW_I2C_USE_I2C1 || defined(__DOXYGEN__)
I2CDriver I2CD1;
#endif
3) I did regarding IO lines(IO Lines Config), the GPT driver itself is a #define(GPT Driver define), because the same GPT is used across all instances, so no need to define it in every instance.
4) I'll work on that, is that OK to create a function to be called every "tick"? In my driver, a tick is 3 times de baud rate. I used it that way because I thought that it would be too cumbersome to the user to do that, but sounds more flexible that way.
5) The static variable is because I was using a single timer to all instances, so I needed to know when the last one called "stop" so I could stop the GPT. I'll work based on #4.
Will refactor things and let you know.