This PR adds the possibility of specifying a memory error callback in
the "ram" element of the "config" section. The new configuration
attribute is called "memory_error_callback" and its value is the name of
a function with the signature "void f(size_t)" that will be called
automatically in the following cases:
- when malloc, calloc, or realloc (with the 'size' argument greater than
0) return NULL. The callback function will be called with the 'size'
argument of the allocation function.
- when the allocator encounters an internal error (only when using the
'multiple' allocator). The callback function will be called with the
argument set to 0.
For now, this feature is only availabsle when using the multiple
allocator or the simple allocator, not the built-in libc allocator.
Usage example (in the board configuration file):
```
config = {
ram = { memory_error_callback = "memory_error" }
}
```
This commit allows the build system to be used with directories outside of the eLua tree,
using the new "conf" and "extraconf" arguments to the builder.
This commit contains code from both @jsnyder and @darren1713.
It is now possible to configure each individual command that will be compiled in the shell:
```
shell = { commands = {'ls', 'ver', 'type' } }
```
If not specified, all the available commands will be compiled (which is backwards compatible).
Also, the `advanced_shell` attribute is gone, replaced with an `advanced` key in the shell
configuration. So write this:
```
shell = { advanced = true }
```
instead of this:
```
advanced_shell = true
```
- Use the proper suffix in Windows for cross-compilation
- Add a boolean attribute type
- Increased number of virtual UARTs
- Updated README.asciidoc with more information on how to cross-compile
in Windows
This should really be more than one commit, but here it goes anyway:
- added STM32F4 CDC UART support. For some reason, it seems to work only
on the OTG_FS interface, the OTG_HS interface enumerates it, but
doesn't seem to send/receive any data.
- removed the "platform interface" functions for CDC UART. That was
never really a platform interface, just a couple of functions reading
and writing data from/to a CDC UART. Now each backend takes care of this
as a special case in its platform_uart_xxx functions.
- added buffering support for CDC UARTs
- added uart.CDC to the uart module, so the CDC uart can be used directly
from Lua.
- stm32f4discovery now defaults to using the CDC, since it doesn't have
a dedicated UART connector.
- build_release.lua changed to use the new build system
- checked for proper compilation of all known configurations (boards/known/)
- fixed various small issues in the builder/utils library
- added 'disp_mode=minimal'
Conflicts:
.gitignore
src/common_tmr.c
src/platform/lm3s/platform.c
src/platform/lm3s/platform_conf.h
src/platform/sim/platform_conf.h
src/platform/stm32/platform_conf.h
src/platform/str9/platform_conf.h
utils/build.lua
Also fixed some minor issues in the builder.
- AVR32 platform converted to use the new build system
- new section in configuration: 'build'. Used to set predefined
build parameters (such as allocator, target, boot mode...)
- LPC288x platform converted to the new build system
- changed generation for the 'extmem' attribute
- added combined attributes (validated against two or more possible types)
- more build configuration attributes (allocator, target)
- more sanity checks
- more color in the builder
- 'romfs' is now a separate builder target, not a function being called separately
- added mappings for the configurator attributes