ch.h vs nil.h header

Discussions and support about ChibiOS/NIL, the almost nil RTOS.
Post Reply
User avatar
jcw
Posts: 55
Joined: Thu May 23, 2013 12:59 am

ch.h vs nil.h header

Post by jcw »

Just to try out nil, since my code won't be needing much more for now, I tried switching from RT to NIL.

One snag is that chprintf.h has a hard dependency on "ch.h". Given that the names of calls and macro's are kept at "chBlah...", might it be a better idea to also keep Nil's header file named "ch.h" instead of "nil.h"?

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

Re: ch.h vs nil.h header

Post by Giovanni »

I was thinking to make chprintf() import "hal.h" because it exports the streams interface even when used with nil.

Giovanni
colin
Posts: 149
Joined: Thu Dec 22, 2011 7:44 pm

Re: ch.h vs nil.h header

Post by colin »

I was just looking at that and was wondering is the streams interface is going to be in the HAL eventually? Or does the kernel use it?

I think the HAL hal_streams.h had the stuff #if 0'd out? Seems a bit fragile to have duplicate definitions of structures etc. too, in case one gets modified then they are binary incompatible and Bad Things will happen.

Just wondered what the plan is long term.
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: ch.h vs nil.h header

Post by Giovanni »

The HAL is the place for streams but, on the other hand, I don't want to remove the capability from RT. Same for I/O queues.

The HAL will use the RTOS implementation, if present, else it will provide its own implementation transparently.

Giovanni
Post Reply