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

699 Commits

Author SHA1 Message Date
Martin Guy
ae73382af2 Omit AVR32 UART pin definitions for UARTS 3 and 4 when NUM_UART <= 2
(which is the usual case)
2011-04-13 13:16:04 +02:00
Martin Guy
3b77200eda EVK1100 has two UARTS, not four. USARTs 2 and 3 are used for SPI, and calling
uart.setup() on them can crash the board.
2011-04-13 13:06:53 +02:00
Martin Guy
d5b8f534ae Avoid compiler warning about adc_int_handler() when NUM_ADC == 0 2011-04-13 12:06:19 +02:00
Martin Guy
0c0fe83457 Revert "Avoid compiler warning about adc_int_handler() when NUM_ADC == 0"
This reverts commit d0eae8c43349e422a306d8b51fd10c531d359964.
2011-04-13 12:04:38 +02:00
Martin Guy
d0eae8c433 Avoid compiler warning about adc_int_handler() when NUM_ADC == 0 2011-04-13 12:01:51 +02:00
Martin Guy
2873ac892a Comment rationale behind Mizar32 pull-up resistor code on UART0 RX pin
and make it happen before the UART (interrupt) is initialized.
2011-04-13 11:56:00 +02:00
Martin Guy
a0cda92c75 Fix typos in pio refman doc 2011-04-13 11:38:26 +02:00
Martin Guy
d6042df51f Fix two typos in refman_gen_cpu doc 2011-04-13 11:34:31 +02:00
Martin Guy
873c731568 Fix typo in i2c doc: u23 -> u32 2011-04-13 09:32:05 +02:00
Martin Guy
d55aa8cf10 Add minimal documentation at the head of build_elua.lua
saying how to install dependencies and where to find out the
command-line flags
2011-04-12 17:05:08 +02:00
Martin Guy
1fd500623e Make build-elua.lua also a directly executable script (#! ...) 2011-04-12 16:34:42 +02:00
Martin Guy
28c2c86847 Fix typos in I2C documentation 2011-04-12 16:23:25 +02:00
Martin Guy
fe4c8d86f7 Integrated Martin Guy's emBLOD bootloader patch in eLua. Original patch message:
emBLOD is Marcus Jansson's second-stage boot loader for AVR32UC3A
parts as used in the EVK1100 and Mizar32 boards, designed to allow
firmware images larger than the on-chip flash memory by loading the
eLua binary from SD card into SDRAM and executing it there.

The source for the emBLOD loader is here https://github.com/cmp1084/emBLOD

When compilation option  bootloader=emblod is given to scons, a special
version is compiled that
- locates the program at the start of SDRAM
- doesn't initialize the system clocks and SDRAM controller, as these
are already set up by emBLOD.

If the bootloader= option is not given, eLua is compiled exactly as before.

The changes I've made to Marcus' originally posted patches are to put
DATA and BSS in internal static RAM, the same as before, since in the
best case (memcpy) the SDRAM is three times slower than access to
static RAM
http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=80657

This also has an impact on code speed: the interpreter runs 9 times
slower in external SDRAM than it does in internal flash.

Tested and working on Mizar32
2011-04-07 22:35:10 +03:00
Bogdan Marinescu
091b5d31e9 Lua build system improvements and bug fixes
- specify -Dmacro on the builder command line to automatically include the macro in the compiler command line
- refactoring: option handling code now moved to utils/utils.lua
- various small bugfixes
2011-04-07 17:38:10 +03:00
Martin Guy
01bcb32034 Apply Roberto's security and bug fixes to Lua 5.1.4 updating it to 5.1.4-3
See http://www.lua.org/ftp/patch-lua-5.1.4-3
2011-04-06 19:31:39 +02:00
Martin Guy
6a46c6d425 Fix pio.port.getval() on AVR32 and AT91SAM7X platforms.
See http://tracker.eluaproject.net/issues/188 for details
2011-04-06 19:00:42 +02:00
Martin Guy
044ca8cadd The AVR32 timer setup code is pointlessly complex, defining two structures
identical to the ones in the avr32 headers, then copying the bitfields one
by one.  This commit just uses the avr32 bitfields and writes them to the
regiters as 32-bit words. Code saving: 240 bytes (and it's faster of course)
2011-04-06 18:55:30 +02:00
Martin Guy
c7a698ff5e Merge branch 'master' of github.com:elua/elua 2011-04-06 18:07:31 +02:00
Martin Guy
7ae5518bf9 First version of AVR32 PWM driver and module for Mizar32 and EVK1100. 2011-04-06 18:04:16 +02:00
Martin Guy
c99a357f91 Fix typo in PWM refman 2011-04-05 18:11:31 +02:00
James Snyder
e1b64e77d9 github supports asciidoc markup, replace readme, add a bit more from overview page 2011-04-04 18:02:01 -05:00
Martin Guy
7fed22f40e Regularize indentation to two spaces and strip trailing spaces from lines
in src/platform/avr32/platform.c
2011-04-03 16:57:27 +02:00
Martin Guy
1acf8b88af :Integer mathlib for eLua
------------------------
This adds the functions of mathlib that make sense when numbers are integers:
  functions [abs,max,min,random,randomseed,sqrt] and constant "huge"
so that idioms like this (from p.195 of Programming in Lua) also work:
  for i = 1,math.huge do
    ...
    if ... then break end
    ...
  end

The square root gives the integer square root of positive numbers
(which would be floor(sqrt(f)) in a floating point world).
2011-03-30 12:48:24 +02:00
Martin Guy
ec73001dca Reduce default stack size on AVR32 from 8192 to 4096.
The figure is verified by instrumenting the C stack and parsing a large (50KB)
Lua program, whose high-water-mark is 3948 bytes.
2011-03-28 06:41:15 +02:00
Martin Guy
60eb74f3cd Fix compiler warning about unused variable 2011-03-23 03:52:15 +01:00
Martin Guy
9d5d30ca45 Allow compilation when _FS_READONLY == 1 in src/fatfs/ffconf.h 2011-03-20 02:57:53 +01:00
Martin Guy
68be85c008 Allow compilation when _USE_LFN = 0 or _CODE_PAGE = 1 (in src/fatfs/ffconf.h) 2011-03-20 02:10:44 +01:00
Martin Guy
13b84a2ca0 Reformat long lines (>2k!) to 80 columns 2011-03-20 01:56:28 +01:00
James Snyder
7e6189d2c1 minor adc and avr32 cleanup 2011-03-18 17:40:53 -05:00
James Snyder
fdbdbcc335 Implement basic ADC module for AVR32 (only tested on EVK1100), add crosstools-ng avr32 toolchain to lua-based build system.
- add basic (no clock support) ADC implementation for AVR32, works on EVK1100
- add avr32-unknown-none-gcc to new lua-based build system to support crosstools-ng avr32 toolchain
2011-03-18 15:20:27 -05:00
James Snyder
5aa2558cc3 Merge branch 'master' of https://github.com/elua/elua 2011-03-17 14:59:39 -05:00
James Snyder
bf17fc216f Don't automatically compile functions we're not using in FatFs for mmcfs. Won't reduce code size for most platforms since we garbage collect when we link, but we don't need to compile these anyways. 2011-03-17 14:57:58 -05:00
nuccio
346132a806 resolved the -Os issue 2011-03-16 09:15:47 +01:00
Martin Guy
2d14535e76 Fix comment to reflect reality 2011-03-16 00:55:04 +01:00
Martin Guy
a4af4ea2b2 Revert "Decrease AVR32 stack size from 8192 to 2048, the same as the other small"
With 2048, the Lua parser dies on "life.lua".

This reverts commit 9a3abb6b1025814875a73753a11ceb1401f67d82.
2011-03-15 22:12:30 +01:00
Martin Guy
70a2dd4d04 Merge branch 'master' of github.com:elua/elua 2011-03-15 05:37:13 +01:00
Martin Guy
cf9c3bd3d1 Do use the internal SRAM for the start of the heap (and then the SDRAM)
because this makes small program (up to 16KB heap) run about twice as fast.
2011-03-15 05:18:27 +01:00
Martin Guy
efbe36d4ed Fix variable name in commentary 2011-03-15 05:16:42 +01:00
Martin Guy
9a3abb6b10 Decrease AVR32 stack size from 8192 to 2048, the same as the other small
platforms. In brief testing, it still seems to work down to 256 bytes
2011-03-15 05:15:14 +01:00
James Snyder
3e1248ebc6 Fix to allow STM32 PWM frequencies to go below 1100 Hz 2011-03-14 17:02:15 -05:00
Martin Guy
957dab161d Fix spello in toolchain doc: "reffer"->"refer" 2011-03-14 05:27:20 +01:00
nuccio
c5579aa4f4 Added AVR32 network support, please note here is a issue with -Os optimisation, fix it before git pull 2011-03-13 17:41:05 +01:00
Bogdan Marinescu
ab5e07bf10 Small fix for running build_elua.lua in Windows 2011-03-06 13:06:45 +02:00
Bogdan Marinescu
9cde5334a8 Compiled files are now found automatically
The files that will be compiled to link an eLua image are now found automatically,
there's no need to specify them explicitly anymore. This applies only to the main
'build_elua.lua' build file, each target's 'conf.lua' still needs to specify them
explicitly (but can use the same automatic source file finding as the main build file).
2011-03-06 03:29:31 +02:00
Bogdan Marinescu
2764ae4c57 Added 'summary' display mode in builder
Added a 'summary' display mode in the builder which displays less information
(thus making the output more readable) and also adds colors :) Not exactly
very useful but I saw this recently in cmake and I _had_ to implement it :)
Activate with "disp_mode=summary" in the command line.
2011-03-05 21:42:20 +02:00
Bogdan Marinescu
77ac825d39 Targets can be reffered to by name now
Now a target can be reffered to also by its name, not only by the
corresponding _target object. Also added 'utils.lua' as a separate
file in utils/ (it used to be a part of build.lua)
2011-03-05 20:22:11 +02:00
Bogdan Marinescu
bcc81ba5fe added README.md for github 2011-03-02 11:20:11 +02:00
James Snyder
4e68621295 Correct a few issues related to flow control setup on STM32:
- RTS/CTS pins may not have been configured in correct modes
 - ensure that remapping for CAN peripheral occurs during startup so USART1's RTS pin is usable
2011-03-01 19:04:01 -06:00
Bogdan Marinescu
163870081d Yeah, you guessed it: even more improvements to the build system :) 2011-02-27 18:31:09 +00:00
James Snyder
5dd26401bd allow avr32-unknown-none variant of avr32 toolchain created by crosstools-ng for avr32 2011-02-27 04:27:29 +00:00