This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
l0dable [2011/12/30 00:05] emdete |
l0dable [2011/12/30 13:18] emdete |
||
---|---|---|---|
Line 1: | Line 1: | ||
==== l0dable documentation ==== | ==== l0dable documentation ==== | ||
- | This page is intended to document how to write a [[l0dable]]. depending on the font you are seeing this looks like "I/O dables" but meant is "loadable". these are small software components (in opposite to [[m0duls]] which are hardare components) that can easily copied to the [[r0ket]]. Once you are done with you l0dable please mention it in [[l0dables]]. | + | This page documents to how to write a [[l0dable]]. depending on the font you are seeing this looks like "I/O dables" but meant is "loadable". these are small software components (in opposite to [[m0duls]] which are hardare components) that can easily copied to the [[r0ket]]. Once you are done with you l0dable please mention it in [[l0dables]]. |
+ | Set up build environment as described in [[build]] | ||
+ | |||
+ | <code> | ||
+ | cd firmware/l0dable/ | ||
+ | vi hello.c | ||
+ | </code> | ||
+ | |||
+ | <code> | ||
+ | #include <sysinit.h> | ||
+ | #include <string.h> | ||
+ | #include <stdlib.h> | ||
+ | |||
+ | #include "basic/basic.h" | ||
+ | #include "basic/config.h" | ||
+ | |||
+ | #include "lcd/render.h" | ||
+ | #include "lcd/print.h" | ||
+ | |||
+ | #include "usetable.h" | ||
+ | |||
+ | void ram(void) | ||
+ | { | ||
+ | lcdPrintln("Hello"); | ||
+ | lcdPrintln(GLOBAL(nickname)); | ||
+ | lcdRefresh(); | ||
+ | while (getInputRaw() != BTN_ENTER); | ||
+ | } | ||
+ | </code> | ||
+ | |||
+ | more examples how to do stuff are in the l0dable directory. | ||
+ | |||
+ | ==== Compiling the l0dable for the r0ket ==== | ||
+ | |||
+ | <code> | ||
+ | make hello.c0d | ||
+ | </code> | ||
+ | |||
+ | Select usb_storage on your r0ket, mount it and copy hello.c0d on the usb device. | ||
+ | on OS X so not use the finder, use | ||
+ | |||
+ | <code> | ||
+ | cp hello.c0d /Volumes/NO\ NAME/ | ||
+ | </code> | ||
+ | |||
+ | make sure you unmount the device properly. | ||
+ | |||
+ | exit usb_storage, and run hello from the execute menu. | ||
+ | |||
+ | ==== running in the simulat0r ==== | ||
+ | |||
+ | <code> | ||
+ | cd simulat0r | ||
+ | make APP=l0dable LAPP=hello | ||
+ | gui/build/qsimulat0r | ||
+ | </code> | ||