ch.h vs nil.h header

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

ch.h vs nil.h header

Postby jcw » Fri Oct 03, 2014 6:53 pm

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: 11080
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 367 times
Been thanked: 306 times
Contact:

Re: ch.h vs nil.h header

Postby Giovanni » Fri Oct 03, 2014 7:17 pm

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

Postby colin » Tue Oct 07, 2014 12:21 am

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: 11080
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 367 times
Been thanked: 306 times
Contact:

Re: ch.h vs nil.h header

Postby Giovanni » Tue Oct 07, 2014 8:00 am

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


Return to “ChibiOS/NIL”

Who is online

Users browsing this forum: No registered users and 1 guest