Common code for small microcontrollers in the SEM project. Also known as 'libmodule'.
Originally it was a collection of utilities to assist in writing 'modules' for a previously planned modular system. It tries to be somewhat hardware independent, although there is still some dependence on avr-libc.
It should be coupled with a repository that provides the hardware specific implementation, targetted at a particular microcontroller. These repositories can be found at:
- https://github.com/TeddyHut/SEMlibmicavr
- Add libarduino_m328
It primarily targets AVR processors, compiled using avr-gcc
. It is written in C++, but avr-gcc
only provides the C Standard Library. This means it is more "C with classes" than C++. C++ features up to C++14 are used, as Atmel Studio 7 only ships with GCC 5.4.0.
This repository is used as a submodule in other respositories for the SEM project. It can also be used as an Ardino IDE library.
These instructions are for Windows. Adjust as necessary for other systems.
The line:
compiler.cpp.extra_flags=-std=gnu++14
needs to be added to the file C:\Program Files (x86)\Arduino\hardware\arduino\avr\platform.local.txt
.
You can also just paste the platform.local.txt
file in the root of this repository to the path above.
Add keywords.txt
, library.properties
, and src/
to a zip archive. We'll call it libmodule.zip
.
- Add the zip archive as a release.
In the Arduino IDE, navigate to Sketch -> Include Library -> Add .ZIP Library.
Select libmodule.zip
.
In the Arduino IDE, navigate to Sketch -> Include Library. You should see SEMlibmodule vx.x.x
. Select it, and ensure that the line
#include <libmodule.h>
is before the include statements for any libraries that depend on libmodule.
As of present, libmodule is only distributed in source form. This means that you will need to manually add the libmodule files you need to include to your project. You could do this by adding libmodule to your project as a git submodule.