Page 1 of 1

Unable to use hal_lld.h types in kernel hooks

Posted: Thu Feb 20, 2014 7:47 pm
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

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

Posted: Thu Feb 20, 2014 8:20 pm
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

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

Posted: Thu Feb 20, 2014 8:35 pm
by lilvinz
Thanks again for the quick reply!