1
0
mirror of https://github.com/elua/elua.git synced 2025-01-08 20:56:17 +08:00

938 Commits

Author SHA1 Message Date
Martin Guy
d0ac60c65b AVR32 config changes fot default CPU, allocator and memory use
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
2012-01-21 12:24:35 +01:00
Martin Guy
34c634dbf7 AVR32: Configure ADC within spec and at optimal values
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
2012-01-21 09:41:54 +01:00
James Snyder
d608453878 Apply strexh/strexb fix to lpc17xx as well 2012-01-20 17:20:51 -06:00
James Snyder
879642e1e1 Workaround for strexh/strexb same register error: http://lists.gnu.org/archive/html/bug-binutils/2011-12/msg00112.html 2012-01-18 19:01:43 -06:00
Martin Guy
a77fc80604 Tiny optimization in AVR32 UART code
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 =
2012-01-17 11:58:04 +01:00
Martin Guy
c8a82fa8bf Include 32768Hz crystal on Mizar32 - now it will be there. 2012-01-16 10:14:16 +01:00
Martin Guy
98d85709a9 Mizar32 conf: enable DHCP client by default 2012-01-16 07:00:07 +01:00
Martin Guy
dbf721b0cd jaFix typo in previous commit 2012-01-15 14:01:21 +01:00
Martin Guy
4019718521 AVR32: Move virtual timer channel definition to platform conf file
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.
2012-01-15 08:00:19 +01:00
Martin Guy
a5a20783a9 Fix tmr.getmaxdelay() with virtual and system timers when LUA_NUMBER_INTEGRAL
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.
2012-01-15 06:37:13 +01:00
Martin Guy
ffe0338b89 Fix commentary in previous commit
The new AVR32 delay code doesn't just handle up to 30 second delays;
it handles the whole range.
2012-01-02 14:26:29 +01:00
Martin Guy
89b78f288a Fix random 60-second pause bug in AVR32 I2C code
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.
2012-01-01 22:52:31 +01:00
Robert G. Jakabosky
6d26eed80f Update EGC to r6 from r4 2011-12-28 18:05:48 -06:00
Martin Guy
c9c4311f15 Apply fix to Lua 5.1.4 bug #11
See http://www.lua.org/bugs.html -> Lua 5.1.4 -> bug 11
"Parser may collect a prototype while building it."
2011-12-18 18:36:36 +01:00
Martin Guy
e7ec5a84fd Apply fix to Lua 5.1.4 bug #10
See http://www.lua.org/bugs.html -> Lua 5.1.4 -> bug 10
Repeat-by:
  meta={}
  setmetatable(meta, meta)
  meta.__newindex = function(t, key, value) print("set") end
  o = setmetatable({}, meta)
  o.x = 10    -- should print 'set'
Lua 5.1.4 fix adapted to eLua's rotable mods
2011-12-18 18:31:04 +01:00
Bogdan Marinescu
e823c8d3fc RFS server fix for serial connections
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.
2011-12-17 17:17:46 +02:00
Bogdan Marinescu
a0ecdc124b RFS server fix
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.
2011-12-15 23:35:17 +02:00
Martin Guy
3195763d16 Fix typo in tmr doc 2011-12-11 18:19:49 +01:00
Martin Guy
ddcec49ae1 Drop timer support in Mizar32 128k default build to that the image fits.
The default config for the 128K Mizar32 board no longer fitted into the
available 129KB of flash. This drops the timer modules so that it does.
2011-12-11 17:34:26 +01:00
Martin Guy
2f560fb16b Fix compilation error when optram=0
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
2011-12-11 17:19:24 +01:00
Martin Guy
bbd7c635b9 AVR32 platform: Replace literal constant with its symbolic name
Numer of hardware timer IDs is available as a symbolic constant
on AVR32. This uses it instead of a literal "3".
2011-12-11 14:38:52 +01:00
Martin Guy
3b5fd90fb2 Move saving of old LCD cursor position to after the arg checking. 2011-12-10 18:15:02 +01:00
Martin Guy
8e3e4a634b optimize LCD reset code, as it is now a single command 2011-12-10 18:03:42 +01:00
Martin Guy
fb1d9c464c For new LCD firmware, drop need to limit data to 31 bytes
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.
2011-12-10 17:51:03 +01:00
Martin Guy
991bcec20d Fix typos in interrupt docs 2011-12-10 15:31:15 +01:00
Martin Guy
a4389ed77c Fix signed/unsigned conflicts in i2c data and integer parameters 2011-12-10 13:33:44 +01:00
Martin Guy
d3948700bc When defining a user character, restore cursor position using getpos()
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
2011-12-10 13:16:37 +01:00
Martin Guy
b07f2fd6c2 Implement and document mizar32.lcd.{getpos,buttons}() functions
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.
2011-12-10 12:50:31 +01:00
Martin Guy
1a087dbc7b Conform in-bracket spacing to eLua convention 2011-12-10 10:49:08 +01:00
Martin Guy
d154d93523 Fix mizar32.lcd.*() documentation 2011-12-10 09:58:52 +01:00
Martin Guy
f35b786ccc Use a #define for the LCD_RESET command, not a literal value 2011-12-09 19:20:18 +01:00
Martin Guy
8f708346b0 Fix two spellos in commentary 2011-12-09 11:29:27 +01:00
James Snyder
1802aea31f Update README to include information about where to find doc 2011-12-02 18:44:34 -06:00
Bogdan Marinescu
7b58d26d01 fixed potential timer match interrupt overflow on STM32 2011-12-01 00:38:59 +02:00
Bogdan Marinescu
c18d019556 fixed potential timer match interrupt overflow on STR9 2011-12-01 00:35:49 +02:00
Bogdan Marinescu
583191e697 AVR32 timer interrupt on match bugfix 2011-11-30 23:36:39 +02:00
Martin Guy
8b60c5f44b Fix Mizar32 speed regression introduced by systimer commit
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.
2011-11-30 07:10:57 +01:00
Bogdan Marinescu
66975786cf Fixed error in getmindelay/getmaxdelay
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.
2011-11-28 22:58:10 +02:00
Martin Guy
b4acb4d2e7 Fix bugs in I2C speed setting for AVR32
- 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
2011-11-21 19:04:40 +01:00
Martin Guy
105d3ab458 Merge branch 'master' of github.com:elua/elua 2011-11-21 18:44:58 +01:00
James Snyder
e6eca3cd49 Remove extra unneeded set function from lua build system 2011-11-20 20:38:36 -06:00
James Snyder
f0047b1446 Added options to build systems to filter out certain file name patterns for ROMFS. 2011-11-20 20:36:44 -06:00
James Snyder
06cc867325 Remove requirement for hw_nvic.h inclusion in platform.c for LM3S which was causing redefinition complaints 2011-11-20 19:06:22 -06:00
Bogdan Marinescu
4045a35088 fixed LM3S periodic ETH interrupt triggering 2011-11-21 00:38:04 +02:00
Bogdan Marinescu
9218e6fc38 fixed LM3S interrupt handler order 2011-11-21 00:37:32 +02:00
James Snyder
d067d1f871 Missing USB support sources 2011-11-20 15:29:20 -06:00
James Snyder
745d3549fe Merge branch 'master' of github.com:elua/elua 2011-11-20 14:40:13 -06:00
James Snyder
b5b81e4b2a Correct merge to reflect system timer changes and uIP bug fix 2011-11-20 14:39:49 -06:00
Bogdan Marinescu
cc06690de4 STR9 GPIO interrupt fix 2011-11-20 21:05:10 +02:00
Bogdan Marinescu
79c287aeeb AVR32 GPIO interrupt support
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)
2011-11-20 20:55:33 +02:00