[En-Nut-Discussion] Include <dev/board.h> in TWI devices like dev/at24c.c?

Harald Kipp harald.kipp at egnite.de
Wed Jan 30 12:40:32 CET 2013


Hi Uwe,

On 30.01.2013 11:34, Uwe Bonnes wrote:

> Lets look at the sht21 driver. Probably
> 
> int ShtInit(void)
> 
> should be changes in
> 
> int ShtInit(NUTTWIBUS *bus)
> 
> and then the new api should be used. Would that be a right fix? If yes, I
> would try to go for a fix.

Appreciated. However, this solution would break existing applications.
As long as it doesn't make things too complicated, we should try to
maintain upward compatibility.

What about...

extern int ShtInit(void) NUT_DEPRECATED;
...

int ShtBusInit(NUTTWIBUS *bus)
{
...
}

int ShtInit(void)
{
...
  ShtBusInit(&DEF_TWIBUS);
...
}

It that fits, please go ahead.

Regards,

Harald



More information about the En-Nut-Discussion mailing list