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

Harald Kipp harald.kipp at egnite.de
Tue Jan 29 18:11:58 CET 2013


Hi Uwe,

On 29.01.2013 16:22, Uwe Bonnes wrote:
> some board define DEF_TWIBUS in include/dev/board.h or a file included from
> board.h.
> 
> However
> nut/dev/at24c.c
> nut/dev/eeprom.c
> nut/dev/mma745x.c
> nut/dev/sht21.c
> 
> don't include dev/board.h.
> Should the c-files above include board.h or are the boards wrong to define
> DEF_TWIBUS in board.h

http://www.ethernut.de/api-beta/board_8h.html

states, that dev/board.h is for inclusion in application code only. I
vaguely remember, that using dev/board.h in Nut/OS system code could
result in strange dependencies regarding the sequence of header file
references.

Anyway, why would a Nut/OS driver code need DEF_TWIBUS? Only, if it is
based on the old API with the hard coded interface, right? IMHO, this is
not a board-dependent feature.

Regards,

Harald



More information about the En-Nut-Discussion mailing list