Arduino Core

For help with the bus itself (not a specific product).
rpu_bus
Posts: 210
Joined: Sun Sep 18, 2016 6:07 pm

Arduino Core

Postby rpu_bus » Thu Nov 30, 2017 2:32 pm

Let's talk about the files that provide the functions you may use with your programs. I often see Arduino people call these the Arduino core, but that is just a name.

https://www.arduino.cc/en/Guide/Cores

After Arduino allowed others to add there own core to the IDE then many did, Some examples include

https://github.com/MCUdude
https://github.com/SpenceKonde/ATTinyCore

Linux calls these sort of things system functions

http://faculty.cs.niu.edu/~hutchins/csci480/linuxcalls.htm

My programs for AVR do not use an Arduino core, I have placed my functions like uart.c inside a directory called lib, e.g. /lib/uart.c

https://github.com/epccs/RPUno/blob/master/lib/uart.c

I have taken some of the functions from various peoples open source projects and added/removed stuff e.g. on uart.c I added stdio redirectable [streams] and made [flush] dump its buffer.

[streams]: https://github.com/epccs/RPUno/blob/master/lib/uart.c#L546
[flush]: https://github.com/epccs/RPUno/blob/master/lib/uart.c#L518

The [Standard IO facilities] in avr-libc is a little bewildering but equally wonderful and I wanted to use them, which I now can with the redirect. However this is not the Arduino way, so my programs are incompatable with all Arduino Cores I have seen.

[Standard IO facilities]: http://www.nongnu.org/avr-libc/user-manual/group__avr__stdio.html

When I want the uart.c functions I have to [include] them in my program and control the [build] tools with a Makefile so it compiles. My Makefile is simple, I use it like a framing system that shows where things are relative the current build. I have been able to step away from a project for a while and then back into it with surprising ease so I am increasingly convinced this is a good technique, but for it to scale up I think the build system needs to be more modular, which I have not looked into how that might be done (for all I know it is already an option with Makefiles).

[include]: https://github.com/epccs/RPUno/blob/mas ... main.c#L21
[build]: https://github.com/epccs/RPUno/blob/mas ... kefile#L10

Return to “Installation, Troubleshooting, and Usage”

Who is online

Users browsing this forum: No registered users and 1 guest