Commit Graph

9 Commits

Author SHA1 Message Date
Markus Hitter a7240523e1 ARM: rename mbed-LPC11xx.h to cmsis-lpc11xx.h.
Part of the effort to rename all CMSIS-provided files to "cmsis-".
2015-08-12 14:26:36 +02:00
Markus Hitter e8299deb86 serial-arm.c: don't calculate serial line parameters at runtime.
This is a pretty complex and, as system clock and baudrate are
known at compile time and never changed at runtime, unneccessary.
Replacing this calculation with fixed values makes the binary
a whopping 564 bytes smaller.

However, how to get these values? Well, we do kind of an
easter-egg. If parameters arenot known, we calculate them at
runtime anyways, and also report them to the user. So she can
insert them into the code and after doing so, whoops, serial
fast and binary small :-)

With known parameters:

    SIZES          ARM...     lpc1114
    FLASH  :  1092 bytes           4%
    RAM    :   132 bytes           4%
    EEPROM :     0 bytes           0%

Without (1428 bytes more):

    SIZES          ARM...     lpc1114
    FLASH  :  2520 bytes           8%
    RAM    :   132 bytes           4%
    EEPROM :     0 bytes           0%
2015-08-12 14:26:35 +02:00
Markus Hitter fc124c14d4 serial-arm.c: allow sending arbitrarily long messages.
On ARM we use only the 16 byte hardware buffer for sending and
receiving over the serial line, which is often too short for
debugging messages. This implementation works fine and still
neither blocks nor introduces delays for short messages.

Costs 72 bytes binary size, mostly because it's the first usage
of delay_us():
    SIZES          ARM...     lpc1114
    FLASH  :  1656 bytes           6%
    RAM    :   136 bytes           4%
    EEPROM :     0 bytes           0%
2015-08-12 14:26:35 +02:00
Markus Hitter 8f90e63e85 serial-arm.c: don't store a pointer to the serial port.
As this pointer isn't used anywhere else, it's pointless. Saves
4 bytes binary size and 4 bytes RAM.

    SIZES          ARM...     lpc1114
    FLASH  :  1584 bytes           5%
    RAM    :   136 bytes           4%
    EEPROM :     0 bytes           0%
2015-08-12 14:26:35 +02:00
Markus Hitter e2df7733ee ARM: move system definitions from .c to .h.
More precisely, from mbed-system_LPC11xx.c to
mbed-system_LPC11xx.h. This way these definitions are available
elsewhere in the code.
2015-08-12 14:26:35 +02:00
Markus Hitter 52e2585f13 ARM: use arduino.h for UART pinout.
This removes another 36 bytes binary size and six(!) MBED files.

The mess of MBED files is now pretty much resolved, only a few
essential ones left.
2015-08-12 14:26:35 +02:00
Markus Hitter 52f5a56d71 ARM: move serial handling code directly into serial-arm.c.
This makes another seven mbed files obsolete and reduces binary
size by another 100 bytes Flash and 16 bytes RAM:

    SIZES          ARM...     lpc1114
    FLASH  :  1624 bytes           5%
    RAM    :   140 bytes           4%
    EEPROM :     0 bytes           0%
2015-08-12 14:26:34 +02:00
Markus Hitter 4cfeca08e1 ARM: get serial working based on MBED code.
Pretty complex, this MBED system, it requires no less than
24 additional files. This will be fleshd out before too long.

    SIZES          ARM...     lpc1114
    FLASH  :  5956 bytes          19%
    RAM    :   176 bytes           5%
    EEPROM :     0 bytes           0%
2015-08-12 14:26:34 +02:00
Markus Hitter 575174940f ARM: get a minimum amount of Teacup compiled for ARM.
Makefile can't even upload, yet.

    SIZES          ARM...     lpc1114
    FLASH  :   944 bytes           3%
    RAM    :   132 bytes           4%
    EEPROM :     0 bytes           0%
2015-08-12 14:26:33 +02:00