Inconsistent location of HAL driver object declaration

Discussions and support about ChibiOS/HAL, the MCU Hardware Abstraction Layer.
Post Reply
faisal
Posts: 382
Joined: Wed Jul 19, 2017 12:44 am
Has thanked: 45 times
Been thanked: 62 times

Inconsistent location of HAL driver object declaration

Post by faisal »

The HAL driver object is defined in either in the top level hal_xxx.h file, or the hal_xxx_lld.h file depending on the driver. There should be one consistent pattern across all drivers.
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Inconsistent location of HAL driver object declaration

Post by Giovanni »

It is being moved at top level in new drivers, old drivers will be updated but it is not high priority.

Giovanni
faisal
Posts: 382
Joined: Wed Jul 19, 2017 12:44 am
Has thanked: 45 times
Been thanked: 62 times

Re: Inconsistent location of HAL driver object declaration

Post by faisal »

Giovanni wrote:It is being moved at top level in new drivers, old drivers will be updated but it is not high priority.

Giovanni


Cool, so the new standard is to have the definition in the top level header file, with platform specific structure members included as macros defined in the lld driver?
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Inconsistent location of HAL driver object declaration

Post by Giovanni »

Correct, I made the change in order to avoid duplicating the structures and related types in all LLDs.

This thing has an impact on other platforms: AVR, e200 etc so I am not pushing it for older drivers.

Giovanni
Post Reply