Language: English, Русский.
It's Java source to C source translator, which allows to write MCU filmware in Java.
timer.setMode(TimerMode.FAST);
instead of inconvenient TCCR1B |= (1<<WGM12); TCCR1A |= (1<<WGM10);
Register handling is done automatically by MCU Java Source. Now you need to keep in mind only the principle of operation of MCU devices (timers, UART, ADC), but not registers and bits.Register
class, unless there is another way to do needed action.Compiler - avr-gcc (or WinAVR package)
final
. Primitive fields with final attribute turn to #define
declarations. Strings and primitive arrays are put to program memory and got from it when they are used. No manual working with progmem - just make a field final!volatile
is passed to C source. Use it when variable is used in background thread and interrupt.byte
and boolean
types are supported throught typedef unsigned char.InputStream
and OutputStream
classes are used in UART. Since charset enconders/decoders don't fit into MCU, only default charset is used. That's why there's no BufferedReader, BufferedWriter
classes, instead BufferedInputStream, BufferedOutputStream
are used.@Section
annotation. Will specify, where to put final variables - Flash or EEPROM memory. Now Flash by default. Example:
@Section(Section.EEMEM)
private static final String MESSAGE = "Hello, EEPROM!";
implements Runnable
) like in TinyOS 2.0. Tasks will be executed in background thread and posted from anywhere.synchronized
is completely ignored. Use volatile
instead.static
is completely ignored because C has different meaning of it.Java source code is converted to XML representation (java-ml) using modified version of Java2XML. Then every XML element is processed by MCU Java Source Translator. All primitive variables don't change, all objects are translated. For translation of methods dealing with MCU registers, there is separate translator for each MCU. All listeners are converted to interrupt handlers. Classes of user objects are not processed using XML, they are called using reflection. The result of translation is XML representation of C source code for MCU. Then C source is generated from XML.