not clean itself up in all failure cases, however. Current approach could
likely be replaced with central table that could handle dispatching for
multiple concurrent connections.
interface documentation is now dynamically generated by the "builddoc.lua"
script, with the description files located in doc/arch_platform/*.lua directory.
The same script will be used to generate the reference manual and ultimately
will be modified to generate a different format of the reference manual,
suitable for embedding directly into eLua (thus providing on-line help).
To generate the platform interface documentation, simply execute the
"build_all_docs.sh" script from the doc/ directory.
- disabled by default (enable on a target-by-target basis) so it shouldn't
cause much breakage for non-rpc users
- some modifications to the binary chunk reader which should allow reading of
chunks encoded on various platforms (with certain limitations like lualong
can't read float lua bytecode, one must generate lualong bytecode from a float
lua)
- other misc changes.
- code cleanup
- the platform is now named 'sim'. You build it like this:
$ scons cpu=linux
The idea is to support more than one host OS by changing the "cpu" variable
above (for example cpu=osx, or cpu=win32). Also, a crude "host interface" was
defined in hostif.h. In theory, a host OS should only implement that interface
in order to run the eLua simulator. The implementation must reside in a file
called hostif_{os}.c (in this case hostif_linux.c). Too bad I don't have a MAC,
I would've loved to try this :)
REMEMBER: whem implementing a host interface, you CAN NOT rely on your regular
libc! You'll have to rewrite the syscalls (see host.c for an example on how to
do this in Linux).
- after you build it, don't start it directly, use the new "run_elua_sim.sh"
script to run it. It will set the terminal to raw mode, no echo, so it will
behave more like "traditional" eLua (even hangman.lua will run in this mode :) ).
Remember to run in on an ANSI capable terminal (although most of them support
ANSI emulation nowadays).
- you can exit from the simulator with "exit". You can't do this with CTRL+C if
you run it with "run_elua_sim.sh".
All in all, this looks pretty good and it's an excellent test platform. It will
do wonders when we integrate our own libc and we won't be able to figure out why
it doesn't work :)
- adc_wait_samples now returns the actual number of samples available at the
time it returns. this simplifies a pattern where one would wait on samples
if blocking and then subsequently check the number of available samples.
- adc.insertsamples(id, table, idx, count) function now available to take
samples and insert them into a table. this is slightly slower than
assignment for single values in a table, but can avoid having to use
getsamples (returning new tables) for certain situations
idx: starting index in table where values will be inserted
count: number of samples to get from channel id