Changes the default Mizar32 CPU to the 256K model,
the default allocator for the 128K Mizar32 to simple (the smallest)
the default allocator for other Mizar32s to multiple to avoid newlib's
dlmalloc bug
and only use one memory region on AVR32 platforms when newlib or simple
for the same newlib dlmalloc bug and because simple can only handle
one region
The previous Atmel code didn't set the PRESCAL filend, so overclocked
the ADC at 7.5Mhz or 8.25Mhz (according to PBA_FREQ) instead of the
maximum of 5MHz for 10-bit conversions and 8MHz for 8-bit.
It also set the sample-hold and startup times to their maxima instead
of just within spec.
This change calculates the optimal in-spec values for these fields,
also improving the maximum sampling rate, from 64ks/sec to 71ks/sec
and is preparatory work for being able to set the sampling rate.
Tested on Mizar32 and EVK1100
The values for the stopbit defines happen to be the same in eLua
headers and avr32 headers, so check for this and when true replace
a no-op switch statement with an =
Instead of defining the virtual timer channel twice in two .c files,
define it once in each board's platform_conf.h file. Although all the
currently-supported UC3 parts (A & B) have 3 timers, the UC3C parts have 6.
tmr.getmaxdelay() used to return -1 for the system timer and -2 for
virtual timers in the integer build due to Lua integers being signed.
This makes them return 2147483647 and 2147483646 resectively.
The I2C delay routine would very occasionally pause execution for
60 seconds then continue. This was due to an Atmel delay routine
that claimed to handle the 32-bit counter register overflowing
but didn't. Specifically, in the old code, when delay_end_cycle was
very close to 2^32, the counter register could wrap to 0 before it
was compared for being > delay_end_cycle, resulting in a 2^32-cycle
pause, about a minute. If the end_cycle were exactly 2^32-1,
the delay might have takes several minute-long cycles to finish.
This commit also fixes the bug in the SDRAM init code where the
delay code was copied from. In that case the odds of the bug biting
were very small indeed, since it was immediately after system startup
and in SDRAM init code there are no interrupt routines running.
However, the correct code is also shorter.
On Linux, the serial connection was not setup properly, which led to
weird errors in the RFS server. This fix disables any input processing
in the termios layer, thus fixing the problem. Thanks to Markus Korber
for reporting and fixing the issue.
Read from the UART file descriptor until no data can be read
anymore (POSIX only). This is needed because sometimes the
RFS server didn't read all the available data and signaled errors.
This commit fixes
src/modules/tmr.c:203: warning: implicit declaration of function 'LNUMVAL'
src/modules/tmr.c:203: error: initializer element is not constant
src/modules/tmr.c:203: error: (near initialization for 'tmr_map[11].func')
due to missing #if LUA_OPTIMIZE_MEMORY > 0
The previous Mizar32 LCD firmware had a limit of 31 bytes per
data message, while the new has no limit. This commit drops the
code that used to split long data transfers into 31-byte chunks.
When defining a user-defined character on the LCD panel, the hardware
forgets the current cursor position on the display. We used to
restore it by keeping track of the cursor in software, but now that
the LCD firmware has a "report current cursor position" command,
we simply use that to save and restore the cursor position when
defining a char. Code saving: 272 bytes.
The old firmware could not return the current cursor position, so
previously, when defining a user-definable character, it could
The new LCD PIC firmware has the ability to return the cursor position
in the LCD character RAM and the state of the buttons. This commit
implements eLua module functions to make these available to users.
Commit d4f03efb96973d73056d87b4173c394ca673bebf halves the running
speed of the interpreter on Mizar32 because the vitrual timer tick
happens 128906 ties a second when there is no FOSC32 crystal.
This commit restores VTMR granularity by calling the 10Hz routines
once every 12890 ticks.
Fixed an error which made the getmindelay/getmaxdelay functions
invalid (thanks to Martin for spotting this). Also refactored the
code that computes min/max delay from platform files to common code.
- Always set a speed <= the one requested, never higher
- Return the closest integer to the actual speed that we set,
instead of just returning the speed they asked for
- Limit the range of the speed to the possible values
to avoid divisions by zero
INT_GPIO_POSEDGE and INT_GPIO_NEGEDGE support for AVR32. Tested on
an ATEVK1100 board (NEGEDGE only, POSEDGE is 100% symmetrical and
thus it should work too)