Previously, you called platform_adc_op(id, OPERATION, u32 arg) to achieve
six unrelated functions with different arg types and return values:
GET_MAXVAL takes nothing and returns an ADC conversion value
SET_SMOOTHING takes a power-of-two filter length and returns nothing
SET_BLOCKING takes a boolean and returns nothing
IS_DONE takes nothing and returns a boolean
SET_TIMER takes a timer ID and returns nothing
SET_CLOCK takes a frequency in Hz and returns a frequency in Hz.
This changes these to six independent functions, each with the right
parameters and return values.
This also makes the documentation more comprehensible, saves 26 bytes of
executable code and should be very slightly faster.
Three modules had a bogus luaopen_disp() function that was never called.
In reality, each platform.c only uses the extern disp_map[] (or str9_pio_map[])
and does the right thing with it in luaopen_platform().
This also removes a bug (AUXLIB_DISP undefined), which prevented avr32
and str9 from compiling when optram=0
Previously, with i2c.write(id, "123"), lua_isnumber would react to the numeric
string and greedily convert it to a single character '{', which made printing
digits to an I2C LCD display almost impossible.
elua_mmc.c uses the virtual timer tick to implement its timeout delays,
and needs MMCFS_TICK_HZ to have the same value as VTMR_FREQ_HZ.
This corrects the mismatch on AVR32 platforms and adds a check to
validate.h to ensure that it remains so.
MMCFS timeouts work by counting ticks of the virtual timer, which is
free-running and could tick immediately, giving a zero timeout.
This fixes the calculation of the number of ticks to wait for to set up
an N-millisecond timeout, ensuring that the actual timeout used is >= N.
Tabs have been creeping in to eLua's source files, sometimes representing
2 characters, sometimes 8. This patch replaces them all with the appropriate
number of spaces, according to the context.
This only fixes files that were written specifically for eLua, not the
manufacturers' SDK source files that were simply imported into the tree.
The return value from tmr.getmaxdelay() is always passed to
lua_pushinteger(), which turns the top half of the unsigned numbers into
negative values. This always used to bite getmaxdelay(tmr.VIRT0) and can bite
tmr.gettimediff(0, small, large).
Fixes bug #229 in the old tracker.