- removed getsmoothing, setfreerunning, samplesready
- isdone has returned so that one can check if the reason why the buffer is
dry is because no more samples are being collected
- smoothing should support fairly large lengths now (as long as you have the
memory)
- added support to adc.sample to take a table as the first argument so that a
set of channels can be started at closer to the same time.
example:
adcchannels = {0,1,2,3}
adc.sample(adcchannels,8)
this should collect samples on all 4 channels starting nearly at the same
time.
- more comments added to elua_adc.c to describe behavior.
Misc
- remove rndpow2, not being used
is full). Clock and sampling frequency have been moved to a separate function
from burst. There is now one function to initiate sampling called sample
which takes a channel and count. setclock takes a channel, clock_id, and
frequency. Adjustments should be made to make channel groupings somewhat
cleaner, but this is functional.
Suggestions are welcome for simplification :-)
I'll try and make some doc updates in the coming day or so to reflect
finalized adjustments.
ADC:
- getsamples split into getsamples and getsample. getsamples always returns a
table of results. getsample returns single values (if available).
EABI compiler support:
- added a parameter to SConstruct called cprefix, which allows one to define a
prefix other than the arm-elf used by some platforms. Currently the only
platform that does anything with this parameter is LM3S, conf.py scripts can
be updated to handle the default toolchain prefix, and accommodate alternate
ones if needed.
- Added sections to lm3s.ld (originally committed by Jesus Alvarez) to handle
linking properly for arm-eabi targets.
- new addition to the PIO module: now you can use pin ranges in PIO expressions. For example:
gpio.PA_3_6_DIR = gpio.OUTPUT -- make pins 3-6 from PORTA outputs
gpio.PB_0_30_PULL = gpio.PULLUP -- activate pullups on all but the last pin of PORTB
gpio.PB_3_6 = 11 -- set value 10 (1011) to pins 3-6 of PB (so PB.6 == 1, PB.5 == 0, PB.4 == 1, PB.3 == 1 )
value = gpio.PB_2_9 -- read the value of pins 2-9 of PB into 'value'
Of course, one can still specify a single pin instead of a range.
This is still tested, but seems to work fine for now.
- romfs/ samples updated to work with the new module name and syntax
- small fix to buf.c (in the BUF_MOD_INCR macro).
buf.c.
The smoothing buffer is still kept separate from the main buffering system,
but as samples come in via interrupt, they are placed into a "standard" elua
buf. The size of this buf is configured according to whether one is grabbing
a bunch of samples rapidly (burst), or singly in order to accommodate the
expected number of incoming samples. If smoothing is enabled, incoming
samples are claimed until the smoothing buffer is full, and then remaining
samples are left in the main buffer until they are collected. This means that
whether one is collecting single samples or samples at burst rate, and
smoothing is enabled, the filter will only be providing samples that have
enough history.
Added a function to manually flush both smoothing and main buffers.
This would be useful if you know your state has changed and you only want
fresh samples that are going to be collected after a flush.
Also, a lot of functionality moved into elua_adc.c and common.c
(boundaries for what belongs where, might be evaluated), reducing the number
of platform.c specific functions dramatically.
Basic functionality seems to be working, but some more testing should be done.
Also, given that there's now a dynamic buffer behind everything, a shift in
the way sampling is handled could be done:
sample and burst functions could be made to be non-blocking, and to never
return anything except for errors.
a separate getsamples function could be used for removing samples collected by
either function from the buffer.
Suggestions are welcome as it would be nice to keep usage paradigms stable
after the 0.6 release.
- complete rewrite of the PIO module. New usage:
pio.PA = 10 -- set the value of PA to 10
pio.PB_1 = 1 -- set the value of pin 1 of PB to 1
local value = pio.PB -- get the value of PB
local value = pio.PB_3 -- get the value of pin 3 of PB
pio.PA_DIR = pio.OUTPUT/pio.INPUT - set the direction of PA
pio.dir[ pio.PA ] = pio.OUTPUT/pio.INPUT - same as above
pio.PA_2_DIR = pio.OUTPUT/pio.INPUT - set the direction of pin 2 of PA
pio.dir[ pio.PA_2 ] = pio.OUTPUT/pio.INPUT - same as above
pio.PA_PULL = pio.PULLUP/pio.PULLDOWN/pio.NOPULL - set pulls on PA
pio.pull[ pio.PA ] = pio.PULLUP/pio.PULLDOWN/pio.NOPULL - same as above
pio.P0_3_PULL = pio.PULLUP/pio.PULLDOWN/pio.NOPULL - set pulls on pin 3 of P0
pio.pull[ pio.P0_3 ] = pio.PULLUP/pio.PULLDOWN/pio.NOPULL - same as above
- samples modified to use the new PIO syntax
- bugfix in AT91SAM7X256 UART int handler
- fixed yet another bug in AVR32's libc (actually replaced strcmp (which is broken on AVR32) with a custom version).
channel. Smoothing support (rolling average) has been added. adcscope has
been updated to reflect these changes, and show output from 4 channels at
once.
- fix for typo in stm32/platform.c
- all eLua modules updated to work with LTR
- "cpu" module added to avr32, at91sam7x, str7
- "disp" module no longer generic (now stays in src/modules/lm3s). For this reason, the "disp" platform interface was also removed.
- the "modcommon" mechanism in STM32 (ROM loader) was depreciated in favour of the Lua Tiny RAM patch (and the "stm3210lcd" module from the STM32 backend now uses LTR).
- small bugfixes
It now illustrates how to create and use a module in Lua for eLua.
An LM3S platform-dependend module is created, exposing it's buttons, leds and offering some utility functions.
- ls shell command enhanced with column aligned file sizes and total size report
- New section on CHANGELOG for ongoing dev changes, to ease up next release
- pong.lua added to examples in romfs
- minor URL and e-mail updates, to reflect the new eluaproject.net domain
- added the eLua web server example (romfs/lhttpd.lua, romfs/index.pht, romfs/test.lua). Use "lua /rom/lhttpd.lua" from the console to run the server. The server code is largely WIP.
mathlib (sin, cos, tan and all the other functions from there).
- corrected "pwmled.lua" (removed a debug print)
- bumped version number to minor versn 0.4.1