AVR os-less OSAL Topic is solved

ChibiOS public support forum for topics related to the Atmel AVR family of micro-controllers.

Moderators: utzig, tfAteba

Marco
Posts: 128
Joined: Tue Apr 16, 2013 8:22 pm
Has thanked: 4 times
Been thanked: 11 times

Re: AVR os-less OSAL

Postby Marco » Fri Oct 21, 2016 8:34 am

Ok, attached are two patches. One for the nop insructions in osal.h and the other one for hal_serial_lld.c.

Marco
Attachments
osal.h.patch.zip
Add nop after sei
(362 Bytes) Downloaded 223 times
hal_serial_lld.c.patch.zip
Improvements in hal_serial_lld.c
(588 Bytes) Downloaded 228 times

utzig
Posts: 359
Joined: Sat Jan 07, 2012 6:22 pm
Location: Brazil
Has thanked: 1 time
Been thanked: 20 times
Contact:

Re: AVR os-less OSAL  Topic is solved

Postby utzig » Fri Oct 21, 2016 12:57 pm

Applied, thanks!

Marco
Posts: 128
Joined: Tue Apr 16, 2013 8:22 pm
Has thanked: 4 times
Been thanked: 11 times

Re: AVR os-less OSAL

Postby Marco » Mon Nov 28, 2016 5:18 pm

Hi,

I'd like to use a virtual timer in the AVR os-less OSAL. Is it possible to make the vtSetI and vtResetI functions public?

Marco

utzig
Posts: 359
Joined: Sat Jan 07, 2012 6:22 pm
Location: Brazil
Has thanked: 1 time
Been thanked: 20 times
Contact:

Re: AVR os-less OSAL

Postby utzig » Tue Nov 29, 2016 12:12 pm

Hi,

The rationale for it being the way it is, is something that only Giovanni will know. But IMO we could make vtIsArmedI, vtSetI and vtResetI public. I would suggest changing the names to something like osalVtIsArmedI, osalVtSetI, osalVtResetI.

Also it bothers me a lot that os-less/ARMCMx/osal.c and os-less/AVR/osal.c have the same contents. Maybe moving one of them to "common" and updating the makefiles?

Giovanni, what do you think?

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: AVR os-less OSAL

Postby Giovanni » Tue Nov 29, 2016 7:33 pm

Hi,

Those function do not belong to the "osal" namespace because the underlying OS could (and usually does) have its own timeout mechanism, see RT and NIL for example. RT has virtual timers, NIL does it differently.

Giovanni

Marco
Posts: 128
Joined: Tue Apr 16, 2013 8:22 pm
Has thanked: 4 times
Been thanked: 11 times

Re: AVR os-less OSAL

Postby Marco » Wed Nov 30, 2016 3:14 pm

Hi Giovanni,

I understand, but since there is no underlying OS there is no timeout mechanism available. Since the os-less OSAL already has a timers implementation i thought it can be made public so the application can use it as well.

Marco

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: AVR os-less OSAL

Postby Giovanni » Wed Nov 30, 2016 4:43 pm

You can make it public, I didn't want to establish it as a standard OSAL API.

Perhaps I should make those VTs a GPL library and make those available even without the OS, it is an useful and well tested mechanism.

Giovanni

Marco
Posts: 128
Joined: Tue Apr 16, 2013 8:22 pm
Has thanked: 4 times
Been thanked: 11 times

Re: AVR os-less OSAL

Postby Marco » Wed Nov 30, 2016 5:20 pm

Yes that would be a good solution i think. On the other hand, i guess that means the user needs it's own timer implementation if he doesn't want GPL?

Marco

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: AVR os-less OSAL

Postby Giovanni » Wed Nov 30, 2016 5:29 pm

It could be Apache 2.0, no problems, but in that case I couldn't add a "tickless" mode like in RT. Note that the timers in OSAL are a stripped down version of those in RT.

Giovanni

Marco
Posts: 128
Joined: Tue Apr 16, 2013 8:22 pm
Has thanked: 4 times
Been thanked: 11 times

Re: AVR os-less OSAL

Postby Marco » Thu Dec 01, 2016 12:24 pm

I'm not sure if the following makes sense, but how about having two different implementations? A ticked version as Apache 2.0 and a tickless version as GPL? You can always use the ticked version but if you need a better (lower power) version then you need the tickless one.

Marco


Return to “AVR Support”

Who is online

Users browsing this forum: No registered users and 13 guests