Unable to use hal_lld.h types in kernel hooks

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
User avatar
lilvinz
Posts: 130
Joined: Sat Dec 21, 2013 2:56 pm
Has thanked: 1 time
Been thanked: 6 times

Unable to use hal_lld.h types in kernel hooks

Post by lilvinz »

Hi Giovanni,

i am trying to implement a precise tick accounting for threads by
adding a halrtcnt_t field to THREAD_EXT_FIELDS and using
hal_lld_get_counter_value() in THREAD_CONTEXT_SWITCH_HOOK.
This results in a build error "error: unknown type name 'halrtcnt_t'" because
of the order of the includes in several files.
Is this intentional behavior or a defect?

Thanks and cheers,

Vinz
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Unable to use hal_lld.h types in kernel hooks

Post by Giovanni »

Hi,

It is by design, the Kernel does not have dependencies on the HAL because it is meant to be usable alone.

You may duplicate the definitions of the types you need in chconf.h, this should work.

Giovanni
User avatar
lilvinz
Posts: 130
Joined: Sat Dec 21, 2013 2:56 pm
Has thanked: 1 time
Been thanked: 6 times

Re: Unable to use hal_lld.h types in kernel hooks

Post by lilvinz »

Thanks again for the quick reply!
Post Reply