Commit graph

605 commits

Author SHA1 Message Date
Marti Bolivar 722cf3e90c stm32f2/rcc.h: Add FIXME for rcc_rtc_divider.
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-05-31 17:24:17 -04:00
Marti Bolivar b2b9a2ba87 stm32f2/rcc.h: Fix typo.
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-05-31 17:24:17 -04:00
Marti Bolivar 518b5f0b4b stm32f1/rcc.h: Add a FIXME.
Having a separate struct is stupid.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-05-31 17:24:17 -04:00
Marti Bolivar 6d1ebe4a67 RCC: Doxygen
Various changes to Doxygen structure, to help leaflabs-docs make sense
of everything.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-05-31 17:24:17 -04:00
Marti Bolivar 5108a85dfd rcc.c: Fix typo.
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-05-31 17:24:17 -04:00
Marti Bolivar 019d5af520 libmaple/rcc.h: Doxygen workarounds.
We need the arguments to be the same name everywhere, or
Breathe/Doxygen get confused.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-05-31 17:24:17 -04:00
Marti Bolivar d3369b63f9 libmaple/fsmc.h: Better Doxygen for memory bank bases.
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-05-31 17:24:17 -04:00
Marti Bolivar c02e5775f3 libmaple/fsmc.h: Don't use BIT().
As fsmc.h doesn't include util.h or libmaple.h, these usages are
actually in error.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-05-31 17:24:17 -04:00
Marti Bolivar 963a5a35b0 stm32f2/fsmc.c: Cosmetics.
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-05-31 17:24:17 -04:00
Marti Bolivar bd4f64b368 libmaple/iwdg.h: Remove BIT() usages.
This cleans up another unnecessary <libmaple/util.h> dependency.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-05-31 17:24:17 -04:00
Marti Bolivar f20568393e Don't try to build some libmaple files.
We can't do these on F2 right now.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-05-31 17:24:17 -04:00
Marti Bolivar f5f2fd2e75 Lose <libmaple/util.h> dependency in series/flash.h headers.
Switch from BIT(...) to (1U << ...).

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-05-09 17:56:35 -04:00
Marti Bolivar 2ed4c00c74 flash.h: Doxygen.
Document FLASH_BASE once. This is due to restrictions in the
documentation build system.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-05-09 17:53:45 -04:00
Marti Bolivar 2544e8f212 Change __DOXYGEN_PREDEFINED_HACK to __DOXYGEN__.
avr-gcc does it this way. Seems ok to me.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-05-09 15:09:52 -04:00
Marti Bolivar 9ff00606cf Make usart_irq() __always_inline.
Compiling with -Os can prevent this from inlining, and it's an IRQ
handler, so the space is worth spending.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-05-08 16:28:05 -04:00
Marti Bolivar d904623715 Mark Doxygen for Flash register maps as series-specific.
This will let help us verify that we got the right thing when we pull
it out of of Doxygen XML for the official HTML documentation.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-05-08 16:26:39 -04:00
Marti Bolivar 3a30b3329f libmaple/util.h: Doxygen cosmetics.
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-05-08 16:25:32 -04:00
Marti Bolivar e824cc5308 libmaple/flash.h: Doxygen for flash_enable_features().
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-05-08 16:24:42 -04:00
Marti Bolivar 7651d09560 libmaple/flash.h: Deprecate flash_enable_prefetch().
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-05-08 16:24:16 -04:00
Marti Bolivar 68eb47d7a7 libmaple/flash.c: Update Doxygen for flash_set_latency().
Update for STM32F2 support.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-05-08 16:23:45 -04:00
Marti Bolivar 306e19cb9f Fix a bunch of Doxygen file-level comments.
Fix @file in many places. Also fix up the descriptions where it's
appropriate. This standardizes the @file formatting across the library
to explicitly include any parent directories up to the repository
root.

Besides being nice, this will hopefully let us manage Doxygen's XML
output so as to make extracting series-specific pieces via Breathe in
the leaflabs-docs repo possible.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-05-08 16:22:41 -04:00
Marti Bolivar 06dace8e01 libmaple/flash.h: Fix Doxygen @file
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-05-08 15:05:01 -04:00
Marti Bolivar fc214a6266 libmaple/util.h: Doxygen fixups.
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-05-08 14:19:01 -04:00
Marti Bolivar df0cb433c1 ring_buffer.h: Fix Doxygen @file.
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-05-08 13:10:00 -04:00
Marti Bolivar d078c7fbc1 stm32f1: stm32.h: Tweak STM32_F1_LINE_xxx for mnemonic value.
Change the values of the STM32_F1_LINE_xxx macros to match the part
number better (so performance line, or F103s, now have
STM32_F1_LINE_PERFORMANCE==3, F100s have STM32_F1_LINE_VALUE==0,
etc.). This will hopefully make debugging or error checking easier for
someone at some point.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-05-08 11:47:50 -04:00
Marti Bolivar 483698e274 stm32f1: stm32.h: Doxygen.
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-05-08 11:44:55 -04:00
Marti Bolivar f2c4176478 libmaple/stm32.h: Doxygen.
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-05-08 11:41:03 -04:00
Marti Bolivar 397fbe3895 stm32f1: stm32.h: Cosmetics.
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-05-08 11:40:46 -04:00
Marti Bolivar 6249d996b1 stm32f1: stm32.h: Add Doxygen comments.
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-05-08 11:39:47 -04:00
Marti Bolivar d7e04595a5 stm32f1: stm32.h: Add hooks for USB access line.
There are five F1 lines in total. The necessary infrastructure for USB
access line (STM32F102 MCUs) support is missing, so add it.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-05-08 11:39:10 -04:00
Marti Bolivar 92ec2d47f4 stm32f1: stm32.h: Fix wrong comment.
We've got some value line values now.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-05-08 11:31:37 -04:00
Marti Bolivar b2416cb050 libmaple/bkp.h: Tweak for STM32F1 XL-density.
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-05-07 01:53:34 -04:00
Marti Bolivar 65f70ea102 adc: Add missing "static" on adc_dev adc3.
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-05-06 21:26:18 -04:00
Marti Bolivar bad7e605b5 Fix wrong comment in libmaple/rules.mk.
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-05-03 21:50:02 -04:00
Marti Bolivar 0f36bb2acd libmaple/adc.h: Cosmetics.
Add "extern" to mark portable interface routines that are implemented
individually by each series.

Move some code around.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-05-03 15:32:46 -04:00
Marti Bolivar 9108a9d807 stm32f1/adc.h: Add missing includes.
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-05-03 15:21:57 -04:00
Marti Bolivar 9f402f46f6 stm32f1/adc.c: Cosmetics.
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-05-03 15:20:02 -04:00
Marti Bolivar 423995d58d STM32F1: adc: Tweaks for XL-density MCUs.
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-05-03 15:19:13 -04:00
Marti Bolivar d10b5a3efa stm32f1: Resurrect DMA support. (sets up breaking change)
Breaking change set up: struct dma_handler_config is no longer part of
the public API in <libmaple/dma.h>. User code which was touching
these was always mistaken; it should be using dma_attach_interrupt()
or dma_detach_interrupt() instead.

Other than that, just move the nonportable bits in <libmaple/dma.h>
and libmaple/dma.c to the appropriate places under
libmaple/stm32f1/. (Ouch. This is almost everything.) Patch the
(new) STM32F1 <series/dma.h> here and there to make everything
compile; this is mostly limited to forward-declaring struct dma_dev
and providing a hack _dma_dev_regs() declaration so inline functions
in the series header can still access a device's registers.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-05-03 14:09:05 -04:00
Anton Eltchaninov 2fb91678e0 STM32VLDiscovery support files
Signed-off-by: Anton Eltchaninov <anton.eltchaninov@gmail.com>
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-05-03 14:09:05 -04:00
Marti Bolivar 50210b33f8 libmaple/stm32.h: Copyrights and cosmetics.
Fix copyright. Fix Doxygen @file. Update file-level documentation,
given this file's increased importance as an abstraction for porting
between series.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-05-03 14:09:05 -04:00
Marti Bolivar 56d7bac320 libmaple/dma.h: Fix Doxygen @file.
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-26 15:50:18 -04:00
Marti Bolivar 53a51ccf05 stm32.h: Various updates, mostly to help STM32F1 line support.
Add STM32_HAVE_USB feature test macro requirement for
<series/stm32.h>. This will let us test if we've got a USB peripheral.
wirish/stm32f1/boards_setup.cpp is set up to use this when turning on
USB CDC ACM support at init() time.

Rework the STM32F1 <series/stm32.h> to make it easier to support the
various lines that subdivide that series. We don't really support
anything besides performance line yet, but there's been enough
enthusiasm for value and connectivity line support in the past that
these hooks seem worth adding. This means adding an STM32_F1_LINE
macro and STM32_F1_LINE_[PERFORMANCE,VALUE,ACCESS,CONNECTIVITY] macros
for values that STM32_F1_LINE can take, and generalizing the rest of
the file to begin taking this into account. Some TODOs remain, but
filling these in is the responsibility of future libmaple porting
efforts.

One pleasant consequence of the F1 stm32.h rework is that the build
system no longer has to tell us what density of F103 we're building
for, so remove that from the relevant support/make/board-includes/
files.

Add some tweaks to <libmaple/stm32.h> and the STM32F2 stm32.h header
to make sure this went through properly, and continues to go through
properly in the future.
2012-04-24 05:01:28 -04:00
Marti Bolivar 44237e7b23 stm32f1: stm32.h: Fix comment typo. 2012-04-24 03:20:18 -04:00
Marti Bolivar 387baea3d6 stm32f1: stm32.h: Put MCU section first, allow overrides.
Put the section defining MCU-specific values before the other
sections. Surround the density-specific defines with #ifndef/#endif
pairs. This allows any of the settings in the STM32F1 stm32.h to be
overridden on a per-MCU basis. That's hopefully useful to e.g. people
porting libmaple to STM32F100 MCUs, which have slower clocks.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-23 13:30:07 -04:00
Marti Bolivar bddf33a448 libmaple/i2c.h: Rearrange i2c_dev members to improve packing.
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:57 -04:00
Marti Bolivar ed44ded739 stm32f2/gpio.h: Cosmetics.
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:57 -04:00
Marti Bolivar aae7c31b43 libmaple/stm32f1/spi.c: cosmetics.
Fix whitespace, move some definitions around.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:57 -04:00
Marti Bolivar fb13a241b8 libmaple/spi: Fixups, move nonportable bits into libmaple/stm32f1.
Standard family support refactoring: add STM32F1 series spi.h, spi.c,
and move anything that won't port to STM32F2 there.

As part of a general effort to be cleaner, remove the dependency on
libmaple/util.h from libmaple/spi.h by not using BIT(). Also forward
declare struct gpio_dev for spi_gpio_cfg() to remove that include.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:57 -04:00
Marti Bolivar 1ea6eb8971 libmaple/spi: Fix boilerplate.
Update Doxygen file headers and license copyright dates.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:57 -04:00
Marti Bolivar 6715377e27 STM32F2: Add timer support.
Standard series peripheral support patch, containing STM32F2 series
timer.h and timer.c.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:57 -04:00
Marti Bolivar 75421efa8a stm32f2/nvic.h: Add fake NVIC_TIMER6 irq number.
This is necessary to make some timer code portable, but I'm not sure
it's a good idea.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:57 -04:00
Marti Bolivar 8530a332ac libmaple/rcc.h: Fix Doxygen file header.
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:57 -04:00
Marti Bolivar cd61bfbaf0 stm32f2/rcc.h: Fix Doxygen file header.
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:57 -04:00
Marti Bolivar cbe37fa979 STM32F1: Add support for timers 9 through 14.
This applies to XL-density STM32F1 devices.

In stm32f1/timer.c, add timer_dev's for the new timers, using the
timer_private API. These definitions are conditionally compiled based
on the target density to avoid wasting space on smaller MCUs. Also add
calls to the appropriate timer_private.h dispatch routines within the
IRQ handlers for these timers. We need to change the IRQ handler names
to reflect this eventually, but put that off for now, as it could
break backwards compatibility in some exotic situations where the user
refers to the libmaple IRQ handlers directly.

In stm32f1/timer.h, add register map base pointers and device
declarations for the new timers. timer_dev* declarations are compiled
in only when the target MCU supports them, in keeping with the above
stm32f1/timer.c changes.

In libmaple/timer.c, update the (static) IRQ enable routines to
account for the additional timers. This adds some code that's
unnecessary on smaller STM32F1s, but it's minimal (40 extra bytes on
my machine), so portability and readability win out.

Size change, using GCC version "(Sourcery G++ Lite 2011.03-42) 4.5.2":

Before:

   text	   data	    bss	    dec	    hex	filename
    615	      0	      0	    615	    267	build/home/mbolivar/leaf/libmaple/libmaple/timer.o

After:

   text	   data	    bss	    dec	    hex	filename
    655	      0	      0	    655	    28f	build/home/mbolivar/leaf/libmaple/libmaple/timer.o

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:57 -04:00
Marti Bolivar c8915d3c91 libmaple/timer_private.h: Update to support TIM9-TIM14.
Add DECLARE_RESTRICTED_GENERAL_TIMER(), for declaring general-purpose
timers with limited interrupt support -- that is, for declaring timers
9 through 14. This helps avoid wasting space on pointers to user
handlers for interrupts that don't exist.

Add dispatch_tim_9_12() and dispatch_tim_10_11_13_14(), which are
special purpose dispatch routines for these "restricted" general
purpose timers, which only try to dispatch interrupts supported by
these timers.

Change dispatch_single_irq() to check the logical and of the DIER and
SR registers for the timer whose interrupt it's dispatching. This is
necessary due to increased muxing on the timer IRQ lines caused by the
new timers. See the comment in the patch for more details. This does
add overhead on medium- and high-density STM32F1s, where the extra
check is unnecessary, but it doesn't change dispatch_single_irq()'s
semantics, and keeps the implementation simple, so we'll live with it.

These changes will also work on F2 (and F4 AFAIK), which is why
they're part of the global private timer API, as opposed to
libmaple/stm32f1/timer.c.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:57 -04:00
Marti Bolivar 02545cab4d libmaple/timer_private.h: Add more explanatory comments.
Hopefully these will be helpful when adding timer support for
additional series in the future.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:56 -04:00
Marti Bolivar 16f81ef445 stm32f1/nvic.h: Add nvic_irq_num's for XL-density timers; Doxygen fixup.
This is a backwards-compatible change, but it deprecates some existing
functionality.

XL density STM32F1 devices have additional timers 9 through 14. These
share NVIC lines with timers 1 and 8. This scheme is also used on
e.g. STM32F2, so the corresponding nvic_irq_num enumerators on that
series have names like "NVIC_TIMER1_BRK_TIMER9" instead of
"NVIC_TIMER1_BRK". For portability (and XL-density support), it makes
sense to add these enumerators to the F1 version of nvic_irq_num,
which we do here.

For backwards compatibility, we keep the old enumerators (like
NVIC_TIMER1_BRK) around as aliases to the new ones (like
NVIC_TIMER1_BRK_TIMER9). These old enumerators are now deprecated.

Also fix up the Doxygen @file header.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:56 -04:00
Marti Bolivar 4b4de07958 stm32f2/nvic.h: Fix Doxygen @file directive.
This lets Doxygen pick it up.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:56 -04:00
Marti Bolivar 4c4d704956 stm32f2/rcc: Fix timer rcc_clk_id enumerators.
The timer enumerators are different tokens on F2 than they are on F1.
This is wrong (breaks portability), so fix it, and update the F2
rcc_dev_info table to match.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:56 -04:00
Marti Bolivar dc9a918288 stm32f1/timer.h: Whitespace tweaks.
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:56 -04:00
Marti Bolivar 2dd98d25b4 libmaple/timer.h: Minor tweaks.
Comments etc.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:56 -04:00
Marti Bolivar d7b930d055 timer: Fixes, rip out nonportable bits.
Fix copy-paste errors in, and add missing, register bit
definitions. For copy-paste errors that would result in source
incompatibilities with past releases, add some legacy defines.

Add series header and C file for STM32F1 which fills in the missing
API. Much of the F1 timer.c would be repeated on F2, so also add
timer_private.h to hold these.

Support for timers 9 through 14 is still missing.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:56 -04:00
Marti Bolivar 6e2a65e7df Don't conditionally compile rcc_clk_id or nvic_irq_num enumerators.
Whether or not a given peripheral is present on an F1 series MCU
doesn't matter. It doesn't take up any extra space to include these
enumerators, and it's convenient to have them defined so portable
libmaple routines can safely refer to them. This can prevent the need
for special series-specific versions of some functions.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:56 -04:00
Marti Bolivar b545d97c01 libmaple/libmaple_types.h: Add __always_inline.
We need this to ensure inlining when compiled with -Os.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:56 -04:00
Marti Bolivar e8d6ba0cdd libmaple/timer.h: Fixups.
Fix include guard define name, update copyright, fix Doxygen @file.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:56 -04:00
Marti Bolivar b370738ee0 libmaple/dac.h: Fixups.
Assert LeafLabs copyright; fix Doxygen @file, and add missing include.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:56 -04:00
Marti Bolivar 59a7811d05 Deprecate rcc_clk_init().
This function has been with us from the earliest days of libmaple.
It's showing its age, as the API it presents is tied to the
STM32F1. Deprecate it, and provide instructions for how to use newer,
more portable APIs. The new way is more verbose, but we can always add
a portable "just set up the PLL, dammit" convenience function later (a
nice candidate is to extract an interface from setup_clocks() in
boards.cpp).

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:56 -04:00
Marti Bolivar a949744d3c Resurrect ADC support.
Standard refactoring: add series headers for F1 and F2, along with
series adc.c files. There are some issues relating to adc_extsel_event
to hammer out later, but this will do for now.

We also add some new portability interfaces to libmaple/adc.h in order
for Wirish to use the same code to initialize the ADCs at init() time.

As usual, F1 is untested.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:56 -04:00
Marti Bolivar 5f81900107 libmaple/rules.mk: Cosmetics.
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:55 -04:00
Marti Bolivar 4dd092d705 Resurrect IWDG support.
This peripheral is identical on F1 and F2.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:55 -04:00
Marti Bolivar 88dc7e263a Resurrect PWR support for F1 and F2.
Just add the missing register bit definitions in new series headers.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:55 -04:00
Marti Bolivar a6644bcec1 Clean up rules.mk files.
Alphabetize targets and remove continuation lines.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:55 -04:00
Marti Bolivar 95f3f3bb0d libmaple/pwr.h: Fix register bits (breaking change).
This is a backwards-incompatible change. It is necessary to fix an
error.

The register bit definitions are given as if they were masks, but
they're actually bit numbers. E.g., PWR_CR_DBP, which should be the
mask for DBP in the power control register PWR_CR, is actually the
number of the bit that should be masked.

Fix this by adding _BIT to the definitions and adding proper
masks. Also add a mask for the PVD level selection bits in
PWR_CSR. Don't add any mask values for particular voltages selected as
these are not portable.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:55 -04:00
Marti Bolivar 918b98426c [UNTESTED] Resurrect FSMC support.
fsmc_sram_init_gpios() is now series-specific, so move its existing
implementation to the F1 backend, and add libmaple/stm32f2/fsmc.c for
the F2 backend.

Delete libmaple/fsmc.c; it is now empty.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:55 -04:00
Marti Bolivar 9cf06a9795 fsmc.h: Use STM32_HAVE_FSMC feature-test macro.
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:55 -04:00
Marti Bolivar 5da6d57717 stm32.h: Add STM32_HAVE_FSMC.
This is a feature test macro for the flexible static memory
controller (FSMC) peripheral.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:55 -04:00
Marti Bolivar e59a7442a3 [FIXME] Resurrected, shinier USART support.
FIXME:
- Test F1 support
- Solve problem of duplicated bytes being TXed unless delay is
  inserted after configuration but before first bytes are TXed.

Rip out nonportable bits from top-level interfaces. The USART register
maps are basically the same between F1 and F2, so leave these, but add
register bit definitions which had name changes to the libmaple header
to avoid needless repetition. There are also a few new bits in the F2
USART registers; add definitions for these in the F2 USART header. Add
Doxygen comments for all USART bit definitions.

Deprecate struct usart_dev's max_baud field. This is just bloat that
doesn't bring us much real benefit.

Add new series-specific USART files for F1 and F2:

- libmaple/stm32f[1,2]/usart.c
- libmaple/stm32f[1,2]/include/series/usart.h

These are standard series-specific files, providing register map base
pointers, defining devices, implementing nonportable routines, etc.

We need a portable way to configure the USART GPIOs. To this end, add
usart_async_gpio_cfg() to the top-level USART interface. This function
is implemented in new F1 and F2 USART backends to take the appropriate
action to configure the RX and TX pins for asynchronous full duplex
mode.

USART baud rate calculation is done differently on the different
series. Keep the usart_set_baud_rate() declaration in the top-level
USART header, but move the implementations into the series-specific
usart.c files.

In usart_set_baud_rate(), allow for deriving clock_speed automatically
by letting user tell us to figure out the peripheral clock speed by
mapping the device's rcc_clk_id onto an STM32_PCLK[1,2] value. This
preserves flexibility for users with non-default clock configurations,
but makes things easier on everyone else.

Add private USART files for portable private USART routines:

- libmaple/usart_private.h
- libmaple/usart_private.c

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:55 -04:00
Marti Bolivar 4a88656774 stm32f2: Improve GPIO alternate function support.
Add GPIO_AFRL and GPIO_AFRH bit definitions; these seem to have been
overlooked. Add enum gpio_af to give labels to the various
functions. Add gpio_set_af() convenience routine for configuring a
GPIO's alternate function.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:55 -04:00
Marti Bolivar 63de87bd60 rcc_reconfigure_pll(): Assert that the PLL is disabled.
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:55 -04:00
Marti Bolivar 454aab10af RCC: Add rcc_is_clk_on().
This is a convenience function for checking if a clock line is on.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:54 -04:00
Marti Bolivar 2240b54dfa Style change to libmaple/rules.mk.
New style makes for cleaner diffs.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:54 -04:00
Marti Bolivar 53fcafdedf stm32.h: Cleanups.
Fix include guard name. Remove unused STM32_FLASH_WAIT_STATES (which
was superseded by FLASH_SAFE_WAIT_STATES).

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:54 -04:00
Marti Bolivar a0e1657456 Add __weak to <libmaple/libmaple_types.h>.
This is just an alias for __attribute__((weak)).

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:54 -04:00
Marti Bolivar 8513d995ed RCC: Add new mechanism for configuring the main PLL.
The new style for configuring the PLL is to initialize
a (series-specific) struct rcc_pll_cfg, and pass a pointer to it to
rcc_configure_pll(). After that's done, you can use
rcc_turn_on_clk(RCC_CLK_PLL) to turn on the main PLL, and busy-wait
until rcc_is_clk_ready(RCC_CLK_PLL) is true to make sure the new
configuration took effect.

- libmaple/rcc.h:

  -- Add struct rcc_pll_cfg, which specifies a PLL configuration. This
     specifies a PLL source and a void pointer to series-specific PLL
     configuration data.

  -- Add rcc_configure_pll(), which takes a pointer to struct
     rcc_pll_cfg, and configures the main PLL. It's up to each series
     to define this function.

- stm32f1/rcc.h: Add struct stm32f1_rcc_pll_data, to store F1-specific
  PLL configuration state.

- stm32f1/rcc.c: Add an implementation for rcc_configure_pll().

- stm32f2/rcc.h: Add struct stm32f2_rcc_pll_data, to store F2-specific
  PLL configuration data.

- stm32f2/rcc.c: Add an implementation for rcc_configure_pll().

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:54 -04:00
Marti Bolivar 05212074eb stm32f1/rcc.h: Deprecate rcc_clk_init().
We're going to replace this with a more portable mechanism.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:54 -04:00
Marti Bolivar 8af1ff3f56 libmaple/rcc.h: Add rcc_enable_css(), rcc_disable_css().
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:54 -04:00
Marti Bolivar ec6dabfde7 libmaple_types.h: Add __deprecated.
This is a define for __attribute__((deprecated)).

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:54 -04:00
Marti Bolivar f20a281077 RCC: Clean up and sanitize interfaces across F1, F2 series.
Additions:

- rcc_switch_sysclk():

  For changing the clock used as SYSCLK's source.

- enum rcc_clk:

  One for each system and secondary clock source (e.g. HSE,
  LSE). These are defined on a per-series basis in each of the
  <series/rcc.h>.

- rcc_turn_on_clk(),
  rcc_turn_off_clk(),
  rcc_is_clk_ready():

  For turning on system and secondary clock sources, and checking
  whether or not they're ready. Uses enum rcc_clk.

Removals:

- rcc_clk_init(): There's no way to port this to F2. Move it to the F1
  header. This also means we can remove the empty implementation and
  enum rcc_pll_multiplier from the F2 RCC header, where it doesn't
  make any sense.

Also fix up some includes, and rewrite rcc_clk_init() in terms of the
new clock source management functions.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:54 -04:00
Marti Bolivar 32443a2222 Clean up Flash interface; add flash_enable_features().
Make a single function, flash_enable_features(), to control the access
characteristics of Flash memory (i.e. to write to the non-latency bits
of ACR).

In so doing, make everybody pretend to allow instruction and data
caching. On STM32F1, trying to turn these on simply has no
effect. This allows unconditionally trying to turn them on, which will
simplify users' lives.

This has the ancillary benefit of making the stm32f2- and
stm32f1-specific flash.c files unnecessary; delete these.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:54 -04:00
Marti Bolivar 4a4a2dd035 STM32F2 Flash support.
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:54 -04:00
Marti Bolivar 8643191193 stm32f2/stm32.h: Add support for STM32F207IG.
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:53 -04:00
Marti Bolivar 5447cc100c [UNDO] Rip out a bunch of F1-only bits from libmaple proper
We'll need to bring this functionality back online piecemeal as we add
F2 support.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:53 -04:00
Marti Bolivar f3f82bc87d Initial STM32F2 series/stm32.h.
This still has some FIXMEs, but it's enough to get going.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:53 -04:00
Marti Bolivar 52238ad3f5 Initial STM32F2 GPIO support.
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:53 -04:00
Marti Bolivar f3efe9039e Initial STM32F2 RCC support.
Largely untested.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:53 -04:00
Marti Bolivar 9696a3b383 libmaple_types.h: Add offsetof().
Rather than rely on newlib's stddef.h, define our own offsetof() in
terms of GCC's __builtin_offsetof(). Don't override an existing
offsetof() definition, in case the user already has one they prefer.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:53 -04:00
Marti Bolivar 9e8bc1bd40 STM32F2 NVIC support.
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:53 -04:00
Marti Bolivar ae88169058 STM32F2: Add vector table and weak ISR definitions.
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:53 -04:00
Marti Bolivar ec601e0e23 Add skeleton libmaple/stm32f2/rules.mk.
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:53 -04:00
Marti Bolivar 4956f08a8e Make BKP support STM32F1-only.
- libmaple/bkp.h: Mark availability restriction.

- Move libmaple/bkp.c to libmaple/stm32f1; adjust rules.mk files
  accordingly.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:53 -04:00
Marti Bolivar fcb6e1ed28 libmaple/stm32: Add enum stm32_series, STM32_MCU_SERIES.
enum stm32_series gives a tag to each STM32 series, including the ones
we don't yet support.

STM32_MCU_SERIES is a define which the series stm32.h header must
provide, identifying the series of the MCU being targeted.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:52 -04:00
Marti Bolivar 3efa31376b Great renaming: use "series" instead of "family".
This is for greater consistency with the ST application notes, which
refer to migrating "across" series (e.g. F1 to F2), but compatibility
"within" a family (e.g. F1).

So:

- Move libmaple/stm32x/include/family to .../include/series/ and fix
  up includes appropriately.
- Refer to "family" headers as "series" headers in comments.
- Make similar "find and replace"-style changes to build system
  variable names and comments.
- Move support/ld/stm32/family to .../stm32/series.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:52 -04:00
Marti Bolivar 3b8cad1d96 libmaple/flash: Add family-specific FLASH_SAFE_WAIT_STATES.
This is the smallest wait state value that is safe for use when the
MCU is at its fastest rate, not considering overclocking. This
requires moving the FLASH_WAIT_STATE defines above the family include,
so do that, and add the missing #defines (for wait states up to 7).

For the STM32F1, the correct value for FLASH_SAFE_WAIT_STATES is
FLASH_WAIT_STATE_2; say so in the F1-family flash.h.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:52 -04:00
Marti Bolivar 0f334dd868 libmaple/flash.h: Doxygen fixups.
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:52 -04:00
Marti Bolivar 7b84b059db Move nonportable bits of libmaple/stm32.h into libmaple/stm32f1.
These go in a new family header, libmaple/stm32f1/include/family/stm32.h.

While we're at it, do some reorganizing.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:52 -04:00
Marti Bolivar d0454eeafe libmaple/nvic.h: Explanatory commenting.
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:52 -04:00
Marti Bolivar 7f08784dea stm32f1: License headers, portability markers.
Add license headers to libmaple/stm32f1/isrs_performance.S and
libmaple/stm32f1/vector_table_performance.S. Copyright to Perry
Hung. I was present when Perry wrote these files. Also mark these as
STM32F1 specific (rather than "STM32", say "STM32F1").

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:51 -04:00
Marti Bolivar 72265603db stm32f1/rcc.c: Add cautionary comment.
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:51 -04:00
Marti Bolivar 3dd4f375c5 RCC: Break out some portable functionality from stm32f1/.
Portions of rcc_clk_enable(), rcc_reset_dev(), and rcc_set_prescaler()
are portable; break these into static inline helpers in
rcc_private.h. These guts of these are portable, but the arrays of
registers etc. are not.

Also add an extern declaration for rcc_dev_table into
rcc_private.h. This lets us put rcc_dev_clk() into a newly resurrected
libmaple/rcc.c, since that's portable.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:51 -04:00
Marti Bolivar 3c9e9a49bb libmaple: Add build infrastructure for private headers.
libmaple/rules.mk: Add LIBMAPLE_PRIVATE_INCLUDES, a place for storing
headers which should be commonly available throughout libmaple, but
not made public. Currently, this is just the libmaple directory.

Add LIBMAPLE_PRIVATE_INCLUDES to the target flags in the STM32F1 and
USB submodules.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:51 -04:00
Marti Bolivar 0794913537 Move GPIO support for STM32F1 to libmaple/stm32f1.
Make a new family header, libmaple/stm32f1/include/family/gpio.h, and
supporting libmaple/stm32f1/gpio.c.

Beyond registers and devices, these also include anything mentioning
AFIO, which doesn't exist on F2.

Update libmaple/stm32f1/rules.mk for new gpio.c.

Alter gpio_write_bit() to use dev->regs->BSRR only. BRRs are not
present on STM32F2.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:51 -04:00
Marti Bolivar cb8243bc20 libmaple/nvic.c: Cosmetics.
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:51 -04:00
Marti Bolivar 996983e54b Move NVIC support for STM32F1 to libmaple/stm32f1.
Backwards-compatible. Only the headers need to change.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:51 -04:00
Marti Bolivar 60f40eb3b6 Move Flash support for STM32F1 to libmaple/stm32f1/.
This is a backwards-compatible change.

The Flash registers on the STM32F2 line are different than on
STM32F1. Therefore, move the register map and bit definitions to new
libmaple/stm32f1/include/family/flash.h.

Move flash_enable_prefetch() from libmaple/flash.c to new
libmaple/stm32f1/flash.c. The remaining pieces of libmaple/flash.c use
a common subset of the Flash registers, so they're's portable to F2,
and that's all we're currently interested in.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:51 -04:00
Marti Bolivar 32b267512f Move RCC support for STM32F1 to libmaple/stm32f1/.
This is a backwards-compatible change.

Modify libmaple/rules.mk to include the family's include
directory. This allows libmaple/include/libmaple/rcc.h to include the
STM32F1 RCC header with #include <family/rcc.h>. We'll use this
convention henceforth to distinguish between top-level and
family-specific headers.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:51 -04:00
Marti Bolivar 198daa7907 libmaple/rules.mk: Reinstate -Werror.
This is OK across all boards now that USB is its own submodule.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:51 -04:00
Marti Bolivar 04760fa17b Make USB its own submodule.
Add libmaple/usb/rules.mk, which compiles the USB FS device firmware
submodule. Move the logic for compiling the USB stack from
libmaple/rules.mk into libmaple/usb/rules.mk.

Move libmaple/usb/usb_cdacm.h to libmaple/include/libmaple/. Its API
is sufficiently general that we'll be able to port it over to USB
OTG (either FS or HS) eventually, and that lets us include it from
Wirish using the new style for libmaple headers.

Fix the includes for public libmaple headers within libmaple/usb.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:51 -04:00
Marti Bolivar f4604a8263 usb_cdcacm.c: Fix warning for non-LeafLabs boards.
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:51 -04:00
Marti Bolivar 954f9e5065 Move public headers to include directories; related cleanups.
Move libmaple/*.h to (new) libmaple/include/libmaple/. The new
accepted way to include a libmaple header foo.h is with:

    #include <libmaple/foo.h>

This is more polite in terms of the include namespace. It also allows
us to e.g. implement the Arduino SPI library at all (which has header
SPI.h; providing it was previously impossible on case-insensitive
filesystems due to libmaple's spi.h).

Similarly for Wirish.

The old include style (#include "header.h") is now deprecated.

libmaple/*.h:

- Change include guard #defines from _FOO_H_ to _LIBMAPLE_FOO_H_.
- Add license headers where they're missing
- Add conditional extern "C" { ... } blocks where they're missing
  (they aren't always necessary, but we might was well do it against
  the future, while we're at it.).
- Change includes from #include "foo.h" to #include <libmaple/foo.h>.
- Move includes after extern "C".
- Remove extra trailing newlines

Note that this doesn't include the headers under libmaple/usb/ or
libmaple/usb/usb_lib. These will get fixed later.

libmaple/*.c:

- Change includes from #include "foo.h" to #include <libmaple/foo.h>.

Makefile:

- Add I$(LIBMAPLE_PATH)/include/libmaple to GLOBAL_FLAGS.  This allows
  for users (including Wirish) to migrate their code, but should go
  away ASAP, since it slows down compilation.

Wirish:

- Move wirish/**/*.h to (new) wirish/include/wirish/.  This ignores
  the USB headers, which, as usual, are getting handled after
  everything else.

- Similarly generify wirish/boards/ structure. For each supported
  board "foo", move wirish/boards/foo.h and wirish/boards/foo.cpp to
  wirish/boards/foo/include/board/board.h and
  wirish/boards/foo/board.cpp, respectively. Also remove the #ifdef
  hacks around the .cpp files.

- wirish/rules.mk: put wirish/boards/foo/include in the include path
  (and add wirish/boards/foo/board.cpp to the list of sources to be
  compiled). This allows saying:

      #include <board/board.h>

  instead of the hack currently in place. We can allow the user to
  override this setting later to make adding custom board definitions
  easier.

- Disable -Werror in libmaple/rules.mk, as the current USB warnings
  don't let the olimex_stm32_h103 board compile. We can re-enable
  -Werror once we've moved the board-specific bits out of libmaple
  proper.

libraries, examples:

- Update includes accordingly.
- Miscellaneous cosmetic fixups.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:56:50 -04:00
Marti Bolivar d70098ba26 Remove "CS3" prefix from libmaple symbol names.
We're no longer even marginally compatible with CS3, so it's
inappropriate to use that prefix in our names.

Rename:
    __cs3_stm32_vector_table -> __stm32_vector_table.
    __cs3_stack              -> __msp_init
    __cs3_reset              -> __exc_reset
    __cs3_start_c            -> start_c

Also add an MIT license header and assert LeafLabs copyright over
wirish/start.S and wirish/start_c.c.  These files are modified from
the original CodeSourcery versions, which were distributed under a
license that permits modifications to be distributed under a different
copyright and licensing terms than the originals.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:52:17 -04:00
Marti Bolivar 926710d872 Remove CS3-style initialization.
Remove libcs3-related bits from support/ld. Break them out into
libmaple proper and Wirish as appropriate: vector table definition and
ISR declarations go into libmaple proper, and startup code goes into
Wirish. Vector table symbols are included into common.inc from an
STM32 family-specific directory under support/ld/stm32.

This is a combination of 5 commits. Individual commit messages follow:

libcs3_stm32_src: Don't depend on cs3.h.

So we can use the existing toolchain.

Move ISR decls/vector table into libmaple proper.

This allows us to configure the vector table on a per-family basis.

- Move
        support/ld/libcs3_stm32_src/stm32_isrs.S
                                    stm32_vector_table.S
  to
        libmaple/stm32f1/isrs_performance.S
                         vector_table_performance.S,
  respectively.

  The directory libmaple/stm32f1/ is intended to hold all
  STM32F1-specific code within libmaple. Obviously, there's a lot of
  work to do before this becomes true.

- support/ld/libcs3_stm32_src/Makefile: Don't try to compile
  stm32_isrs.S and stm32_vector_table.S anymore.

- Add libmaple/stm32f1/rules.mk to include these new files in the
  standard libmaple build.

- support/make/target-config.mk: Add LIBMAPLE_MODULE_FAMILY, which
  selects a directory to use as a family-specific libmaple
  submodule.

- Makefile: Add LIBMAPLE_MODULE_FAMILY to LIBMAPLE_MODULES.

Remove support/ld/libcs3_stm32_src and derived object files.

From support/ld/libcs3_stm32_src, move start.S and start_c.c into
Wirish. Modify wirish/rules.mk accordingly.

Delete support/ld/libcs3_stm32_*_density.a. These are no longer
necessary, as the relevant objects are included in the standard Wirish
build. Remove the GROUP statements from the board linker scripts
accordingly.

Remove SEARCH_DIR(.) from common.inc; it's no longer necessary. Also
fix up some comments that are now out of date.

wirish/start_c.c: Don't use CS3-style memory initialization.

Switch memory initialization to a simpler style of initializing .data
if necessary, then zeroing .bss. Initializing .data is only necessary
during Flash builds, since during RAM builds, LOADADDR(.data) ==
ADDR(.data).

This makes libmaple completely incompatible with the CS3 startup
sequence. Subsequent commits will clean up the namespace to reflect
that fact.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-04-11 16:52:17 -04:00
Marti Bolivar 7c1a00a836 usb_descriptors.h: Remove usbVcomDescriptor[...] values.
These are CDC ACM-specific.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2011-10-21 19:21:08 -04:00
Marti Bolivar a83a6c2aed usb_descriptors.h: Whitespace and column cleanups.
Untabify, make (mostly) 80-column clean.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2011-10-21 19:19:03 -04:00
Marti Bolivar 824001c923 usb: Rename descriptors.h -> usb_descriptors.h.
Modify its include guard, and the files that include it, appropriately.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2011-10-21 18:17:09 -04:00
Marti Bolivar 061fae7206 usb.h: Move to libmaple/.
Apart from having an unstable API, usb.h is now a fairly good citizen
of libmaple, so move it to live with the rest of the libmaple headers.

Its device struct is still "struct usblib_dev".  Leave that there; the
asymmetry with the rest of the library is a good reminder that the API
isn't really on equal footing with the rest of the library.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2011-10-21 18:13:06 -04:00
Marti Bolivar 9be44ebd86 USB: API cleanups.
Modify usb.h functions (changing their names in some cases) to also
take a usblib_dev* argument, to fit in better with the rest of
libmaple.

Store an rcc_clk_id in struct usblib_dev for the same reason.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2011-10-21 18:13:05 -04:00
Marti Bolivar d21d68fd36 USB: API cleanups.
Remove usbSuspend(), usbResumeInit(), usbResume(), the USB
low-priority IRQ, and usbWaitReset() from usb.h.  Also remove
RESUME_STATE since it was only there for usbResume().

These functions don't need to be seen by anybody except for usb.c and
usb_cdcacm.c, so move them there (altering their names to fit with
libmaple style guidelines) and mark them static.

Clean up includes in usb.c while we're there.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2011-10-21 18:13:05 -04:00
Marti Bolivar ef5efb025b usb.h: Mark API unstable.
The USB API is heavily reliant on the ST stack, and additionally
assumes that all USB is the USB FS peripheral.  As such, it's going to
have to change as we go forward.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2011-10-21 18:13:00 -04:00
Marti Bolivar 4aebc879dd Oops; actually remove usb_config.h.
usb_config.h was supposed to be removed in
d7afdbe6b41a77938863854a1e719398e6c35094; however, it looks like some
merge conflicts stopped that from happening while I was rebasing.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2011-10-18 14:02:25 -04:00
Marti Bolivar 1717afad9e usb_cdcacm.c: Cleanups
Move the callbacks to the bottom of the file, and mark them static.
Replace empty callbacks with NOP_Process in the callback tables.
Remove prototype for nonexistent prep_and_reset().  Other
miscellaneous fixups.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2011-10-18 13:30:18 -04:00
Marti Bolivar 6dba382743 usb.h, usb.c: Cleanups
Remove wIstr. This cleans up the control flow. wIstr is still declared
in usb_lib/usb_regs.h, but it's unused throughout the code base.

Remove bIntPackSOF.  Only written, never read.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2011-10-18 13:30:18 -04:00
Marti Bolivar 04c2071095 Remove usb_int.h, usb_int.h, usb_int.c.
No longer used.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2011-10-18 13:30:18 -04:00
Marti Bolivar 1418bb4ff1 usb: Clean up some globals with new struct usblib_dev.
Add struct usblib_dev (and USBLIB, a pointer to the singleton) to
usb.h.  USBLIB contains the global state which is used by
functionality imported from usb_lib/.

Consolidating global state into USBLIB will make it easier to remove
later.

Initial fields in struct usblib_dev are endpoint interrupt callbacks,
a mask for what to handle in the low-priority USB interrupt, and
device state.  These replace pEpInt_IN, pEpInt_OUT; wInterrupt_Mask;
and bDeviceState, respectively from usb_lib/, so remove their
declarations from usb_lib_globals.h accordingly.  Also remove unused
SaveState declaration from usblib_globals.h. Move bDeviceState into
'state' field in usblib_dev.  Device state type changes from
DEVICE_STATE to usb_dev_state, volatile gets dropped, and enumerators
get a 'USB_' prefix, but it's otherwise the same.

usb_lib/ expects pInformation to point to   Device_Info,
                 pUser_Standard_Requests -> User_Standard_Requests, and
                 pProperty               -> Device_Property.

Alter usb_init_usblib() to reflect these assumptions.  Reorganize
usb_lib_globals.h to make these assumptions more apparent to the
reader.

Modify usb_init_usblib() to take endpoint callbacks as arguments;
update its caller in usb_cdcacm.c.

usb_lib/ defines pInformation, pProperty, and pUser_Standard_Requests
itself (in usb_init.c), but we have our own definitions (in usb.c).
Remove the duplicates from usb.c.  Also remove EPindex and Device_Info
definitions from usb.c. Unused, and anyways already defined in
usb_lib/usb_init.c.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2011-10-18 13:30:18 -04:00
Marti Bolivar d7afdbe6b4 Remove usb_config.h.
Move its defines into usb_cdcacm.c and usb.[hc] as appropriate.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2011-10-18 13:30:18 -04:00
Marti Bolivar 494f05b236 usb: Disentangle CDC ACM functionality.
Add new usb_cdcacm.h, which provides the virtual serial port API.
This file (and new usb_cdcacm.c) consolidate the VCOM support, which
was previously distributed through descriptors.[hc], usb.[hc],
usb_callbacks.[hc], and usb_config.h.

Add usb_init_usblib() to usb.h, as a way of initializing the USB
peripheral in terms of the data structures required by usb_lib.  This
is used by the new usb_cdcacm_enable().

Create new usb_lib_globals.h, with declarations for the usb_lib global
state which is most used throughout the rest of the libmaple USB stack.

Remove descriptors.c and usb_callbacks.[hc]; they are no longer
necessary.

Update the USB README accordingly.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2011-10-18 13:30:18 -04:00
Marti Bolivar fb3c7a1e09 usb.c: Use usb_reg_map.h; replace most of CTR_LP().
This cuts down on some of the uglier dependencies.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2011-10-18 13:30:17 -04:00
Marti Bolivar 07bc0c7001 usb: Remove usbPowerOff(), move usbPowerOn() to usb_callbacks.c.
Remove usbPowerOn(), usbPowerOff() prototypes from usb.h.  These
aren't used outside of the USB subsystem, so they don't belong here.

Move usbPowerOn() from usb.c to usb_callbacks.c.  This is the only
place where it's used.  Remove the unused usbPowerOff() (from usb.c)
altogether.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2011-10-18 13:30:17 -04:00
Marti Bolivar 51a2d9793b usb: Prepare for moving some files to usb_reg_map.h.
usb_config.h: Remove usb_regs.h dependency; fix includes; add license.

usb_callbacks.h: Change includes to the pieces of usb_lib/ it uses,
which doesn't include usb_regs.h.

descriptors.h: Remove unused usb_lib.h include.

usb.h: Remove unused usb_lib.h include.  Some cosmetic commenting.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2011-10-18 13:30:17 -04:00
Marti Bolivar ae3d80d796 Add usb_reg_map.h and usb_reg_map.c.
usb_reg_map.h contains the usual register map and register bit
definitions that libmaple convention requires.  It also contains a
variety of structs and convenience functions for accessing and
manipulating endpoint registers, BTABLE entries, and PMA buffers.

We'll be moving towards usb_reg_map.h instead of usb_lib/usb_regs.h.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2011-10-18 13:30:17 -04:00
Marti Bolivar 125f3d9338 usb: Update README file.
Various parts of it are no longer true, and some TODOs are now done.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2011-10-18 13:30:17 -04:00
Marti Bolivar e53edd3a7b Remove usb_hardware.c and usb_hardware.h.
These files contain a lot of duplicated and unused code.  Move the
relevant pieces that need to survive into usb.c and usb_callbacks.c.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2011-10-18 13:30:17 -04:00
Marti Bolivar 50f68b84c4 usb: Replace duplicated code with nvic.h API.
Replace calls to usbEnbISR()/usbDsbISR() with
nvic_irq_enable()/nvic_irq_disable(). Remove ST-style code. Use
nvic_sys_reset() instead of systemHardReset().  Rename some
conflicting #defines that including nvic.h created.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2011-10-18 13:30:17 -04:00
Marti Bolivar 17e67dff76 usb: Cleanups and renames.
Rename setupUSB() and disableUSB() to usb_cdcacm_enable() and
usb_cdcacm_disable(), respectively.

Remove usbSendHello(). This shouldn't exist.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2011-10-18 13:30:17 -04:00
Marti Bolivar 545aae4459 usb: Move some board-specific configuration to Wirish.
Create new BOARD_USB_DISC_DEV and BOARD_USB_DISC_BIT board-specific
values.  Use these as arguments to setupUSB() and disableUSB().  This
helps make the USB stack more generic, and goes towards the resolution
of an important FIXME.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2011-10-18 13:30:17 -04:00
Marti Bolivar 3b9f0a03bf timer.h: fix timer_oc_set_mode().
timer_oc_set_mode() incorrectly writes to CCMR1 when channel is 2; fix
this.

Thanks to ala42 for the fix.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2011-10-12 09:22:15 -04:00
Marti Bolivar 2d689be936 usart: Add usart_rx().
usart_rx() is a nonblocking USART receive.  Add it for symmetry with
usart_tx().
2011-10-07 14:38:33 -04:00
David Kiliani 1873871aea Add support for the Olimex STM32 H103 board.
Pin layout and header files for the STM32 H103 prototype board from
Olimex featuring an STM32F103RBT6 chip. This commit contains all
necessary changes to compile with BOARD=olimex_stm32_h103.

Signed-off-by: David Kiliani <mail@davidkiliani.de>
2011-09-27 16:44:53 -04:00
Marti Bolivar 958ead333f rcc: Add RCC_USB to rcc_clk_id/rcc_dev_table.
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2011-09-24 16:02:31 -04:00
Marti Bolivar 04b72e6fdb nvic: Add nvic_sys_reset().
This uses the SCB_AIRCR register to force a system reset.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2011-09-24 16:02:26 -04:00
Marti Bolivar f3345d6bb0 scb.h: Fix register map and bit definitions.
For the change log: This commit breaks backwards compatibility with
0.0.12.  However, it appears that the previous version was incorrect,
so these changes are necessary.

The SCB register map type (scb_reg_map) appears to be adapted from
versions specified by ARM; these include every possible register, and
do not necessarily apply to the STM32, since some registers are
implementation defined, to the extent that the implementation is
allowed not to feature them at all.  Thus, the current definition
appears to be an overreach, since libmaple is STM32-specific.  We
should thus revise it based on ST's PM0056, where the STM32 SCB is
specified.

However, the ST docs appear to be buggy.  In particular, they appear
to contradict requirements made by ARM v7-M ARM with respect to the
debug fault status register (DFSR), which ARM says must exist, but ST
fails to specify (it does leave a DFSR-sized hole in the SCB memory
layout, conveniently located next to some obvious typos which suggest
that the section was not well-proofread).  We defer to ARM and assume
ST just forgot to document the register, and leave the DFSR field in
struct scb_reg_map, since (based on my reading) its absence would be a
silicon bug.

All of the registers appearing in memory addresses higher than that of
SCB_BFAR are not specified by ST, but the v7-M ARM appears to give
some latitude on this to the implementation.  Leave them in the source
text, but put them in an appropriately-commented #if 0 block so that
users who know they're there can yell at us if they find them missing.
In this block, the Auxiliary Feature Register's field was "ADR"
instead of "AFR" in struct scb_reg_map; fix this.

Register bit definitions have been added which are named based on
PM0056 when possible, and on the November 2010 "Derrata 2010_Q3" issue
of the ARM v7-M Architecture Reference Manual, in the case of the
DFSR.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2011-09-24 16:02:15 -04:00
Marti Bolivar c32adf772e Merge remote branch 'rryan/usb_fixes' 2011-09-20 16:29:46 -04:00
RJ Ryan f549599c72 Missed one hard-coded structure size.
Signed-off-by: RJ Ryan <rryan@mit.edu>
2011-09-18 19:17:54 -04:00
RJ Ryan 8adc7e6127 Fix memory alignment of USB descriptor structures.
A variety of USB descriptor structures have been manually
"unpacked". Instead of using the struct, their members were unpacked
into the struct they were nested in. Additionally sizeof()'s were
commented in favor of manual calculation of structure sizes.

After uncommenting these changes, the USB CDC peripheral stopped
correctly configuring with the host. The root problem with the
structures is that GCC is padding them. By applying
__attribute__((__packed__)), these problems are fixed. I removed all
the instances of the workaround I saw within the USB code.

Signed-off-by: RJ Ryan <rryan@mit.edu>
2011-09-18 15:39:28 -04:00
RJ Ryan c4e0847720 Add a libc abort() implementation.
The STL in particular relies on abort() for entering an error
state. Without an abort() definition, the use of many STL primitives
results in a link error because the default implementation of abort()
uses _kill, _exit, and _getpid -- none of which are present. My
abort() implementation writes an error message to the error USART and
enters the throbbing-LED error state.

Signed-off-by: RJ Ryan <rryan@mit.edu>
2011-09-16 22:14:42 -04:00
RJ Ryan c731833c2d Add an __assert_func assertion handler so that libc does not use its
default implementation. This allows the use of assert() from libc's
assert.h.

Signed-off-by: RJ Ryan <rryan@mit.edu>
2011-09-16 21:31:34 -04:00
Michael Hope b9be2450f0 Added more doxygen file level headers. Documented a few more functions.
Signed-off-by: Michael Hope <michaelh@juju.net.nz>
2011-09-13 19:35:12 +12:00
Marti Bolivar f711c740e0 syscalls.c: Allow environment to specify heap boundaries.
Rename HEAP_START/HEAP_END macros CONFIG_HEAP_START/CONFIG_HEAP_END,
to mark them as build-time configuration options.  Wrap their
definitions with #ifndefs appropriately.
2011-09-12 20:59:12 -04:00
Marti Bolivar f4f8197745 usart.h: Deprecate rx_buf field in usart_dev.
nzmichaelh rightly argues that actual RX buffers should be
heap-allocated, to avoid wastage for unused devices.  Deprecate the
field for 0.0.12, since that's coming out soon.  This will let us get
rid of this field in master immediately after 0.0.12 gets shipped.
2011-09-12 20:11:59 -04:00
Marti Bolivar fc4bd8eb9e [support/ld] Add linker support for reconfigurable heap.
- common_header.inc: Declare EXTERN symbols _lm_heap_start and
  _lm_heap_end.

- common_rom.inc: Check for _lm_heap_start and _lm_heap_end.  If they
  are defined, preserve their values.  Otherwise, _lm_heap_start is
  starts after .bss, and _lm_heap_end is the end of SRAM.

  This allows existing linker scripts to continue using the old heap
  scheme, but allows for customizability elsewhere.

- syscalls.c: Respect the addresses of _lm_heap_start and _lm_heap_end
  as the boundaries of the heap in _sbrk().
2011-09-12 17:25:01 -04:00
Marti Bolivar 3c0a3ee251 syscalls.c: Bugfix _sbrk() implementation.
Fix _sbrk() implementation so it properly rejects negative arguments
which would send the program break below the heap start.  Fix
incorrect check against argument causing heap overflow.  Also set
errno properly to ENOMEM when the call fails.

Beginning and end of the heap are now determined by HEAP_START and
HEAP_END macros.  Their current values seem to work OK for heaps on
the internal SRAM, but they'll need to get generalized for Maple
Native.
2011-09-07 23:34:24 -04:00
Marti Bolivar aa4f3b6645 stm32.h: Add STM32_SRAM_END. 2011-09-07 23:34:24 -04:00
Marti Bolivar aad2377ae3 Update outdated stm32.h usages.
stm32.h has been updated to prefix its definitions.  Update the rest
of libmaple to take this into account.
2011-09-07 23:34:23 -04:00
Marti Bolivar 53f804e335 stm32.h: Remove SRAM_SIZE, prefix all #defines.
Remove SRAM_SIZE define.  This seems like a bad idea given that
bootloader builds drop user code at an offset from the SRAM start
address.

Prefix every #define with "STM32_" to avoid polluting the namespace.
Keep and deprecate the remaining ones (except for aforementioned
SRAM_SIZE), but define them to be the same as their prefixed variant.

Take a little extra care to break libmaple builds which specify PCLK1
and PCLK2 instead of the prefixed versions.  Some libmaple forks make
use of these; they will break in mysterious ways if they don't handle
this change properly.
2011-09-07 23:34:23 -04:00
Marti Bolivar a1772c16e1 syscalls.c: Remove fictitious uart_send() and broken comments.
uart_send() is not part of libmaple, and nm doesn't show it getting
linked in from anywhere else, so I don't believe it exists.  Remove it.

Also remove some commented-out sections from getch(), putch(),
_write(), and fgets().  These either reference uart_send() or use old
libmaple APIs which no longer exist.
2011-09-07 23:34:23 -04:00
Marti Bolivar 28c5b81f6d util.c: Respect stm32.h. 2011-09-07 23:34:23 -04:00
Marti Bolivar 53fede57a9 usart.h: Remove unnecessary local in usart_putc(). 2011-08-30 18:21:38 -04:00
Marti Bolivar 075f073c2c stm32.h: Doxygen tweaks.
For some unfathomable reason, Doxygen happily believes in PCLK2, but
but not PCLK1, so Breathe can't find the docs for PCLK1, and all the
children are unhappy.  As a workaround, move all the Doxgyen crap into
__DOXYGEN_PREDEFINED_HACK sections immediately preceding the actual
definitions.
2011-08-30 01:11:33 -04:00
Marti Bolivar cad3a5422b dma.c: Fix Doxygen syntax for dma_get_irq_cause(). 2011-08-30 00:09:07 -04:00
Marti Bolivar 3887713e69 util.h: Doxygen 2011-08-22 23:29:59 -04:00
Marti Bolivar bada156b62 stm32.h: Doxygen 2011-08-22 23:29:59 -04:00
Marti Bolivar 1d337f535f stm32.h: Doxygen 2011-08-22 23:29:59 -04:00
Marti Bolivar 13ce8aa6fa scb.h: Doxygen 2011-08-22 23:29:59 -04:00
Marti Bolivar 92f87d80de nvic.h: Doxygen 2011-08-22 23:29:59 -04:00
Marti Bolivar 24cf6f17e3 i2c.h: Doxygen 2011-08-22 23:29:58 -04:00
Marti Bolivar f3599645ec gpio.h: Doxygen 2011-08-22 23:29:58 -04:00
Marti Bolivar 86b7cfea48 flash.c: Doxygen 2011-08-22 23:29:58 -04:00
Marti Bolivar b2d244dd6a exti.c: Doxygen improvements. 2011-08-22 23:29:58 -04:00
Marti Bolivar 97e4a6d8a6 rcc: Doxygen improvements. 2011-08-22 23:29:55 -04:00
Marti Bolivar 6bdb5eaef4 dma.h: Doxygen improvements. 2011-08-22 18:08:53 -04:00
Marti Bolivar aa05fa2276 Typos. 2011-08-11 02:56:09 -04:00
Marti Bolivar c075041100 exti.c: Optimize multiplexed IRQ handlers.
Rewrite existing IRQ handlers in terms of new functions
dispatch_single_exti() and dispatch_extis().  dispatch_single_exti()
handles EXTIs which have a dedicated IRQ line, and thus doesn't have
to check EXTI_PR; it is mostly equivalent to the (now removed)
handle_exti().  dispatch_extis() handles multiple EXTIs sharing an IRQ
line.  Using dispatch_extis() instead of calling handle_exti()
multiple times avoids unnecessary I/O to the (volatile) EXTI_BASE->PR
register.

These changes are in the flavor of the timer IRQ optimizations
performed in f5016b15be.
2011-08-03 17:34:03 -04:00
Marti Bolivar 487a60946d exti.c: Cleanups. 2011-08-03 17:34:03 -04:00
Marti Bolivar aee5bceb0f exti.c: Remove enable_irq() and maybe_disable_irq().
These functions incorrectly replicate functionality that is already
accomplished by manipulating EXTI_IMR directly.
2011-08-03 17:34:03 -04:00
Marti Bolivar 5a7ad93ab2 exti.c: Clean up some bit-banding usages. 2011-08-03 17:34:03 -04:00
Marti Bolivar f5935ef477 exti.c: Cleanups.
Add new handle_exti() instead of calling clear_pending() and
dispatch_handler() each time.
2011-08-03 17:34:03 -04:00
Marti Bolivar dab7dd44f2 util.h: Properly parenthesize IS_POWER_OF_TWO(). 2011-08-03 17:34:03 -04:00
Marti Bolivar 4e50d36db8 timer.c: Minor IRQ dispatch tweaks.
Read TIMx_SR before grabbing a pointer to the user handlers instead of
after.  This should shave a couple of cycles off of the time between
IRQ entry and SR read.
2011-07-21 15:22:19 -04:00
Marti Bolivar f5016b15be timer.c: Optimize IRQ dispatch routines.
Remove dispatch_irq() and dispatch_cc_irqs().

For IRQs which handle exactly one timer interrupt, add new
dispatch_single_irq().  The mere fact that the IRQ has been called
suffices to prove that its interrupt enable bit (in TIMx_DIER) and
interrupt flag (in TIMx_SR) are set.  These facts are combined in
dispatch_single_irq(), which only needs to check if the timer_dev
handler is non-null before calling it and clearing the SR flag.

For IRQs which serve multiple timer interrupts, replace the
composition of calls to dispatch_irq() and dispatch_cc_irqs() with
individualized routines.  These eliminate unnecessary timer register
reads/writes, and, in the case of capture/compare interrupts, have a
loop unrolling performed.
2011-07-20 14:02:30 -04:00
Marti Bolivar f362c91d2f timer.c: Fix dispatch_irq() and dispatch_cc_irqs().
Modify them to check whether the relevant interrupts are enabled
before attempting to handle them.
2011-07-19 01:19:38 -04:00
Marti Bolivar f7a4e9c268 timer.c: Fix off-by-one error in NR_GEN_HANDLERS. 2011-07-18 23:59:32 -04:00
Marti Bolivar a6bd904db8 stm32.h: Add license header. 2011-07-18 14:24:59 -04:00
Marti Bolivar 3131e09e38 stm32.h: Trivial comment tweak. 2011-07-18 14:24:33 -04:00
Marti Bolivar 3061d3f600 Add DELAY_US_MULT, for use in generalizing delay_us().
The delay_us() implementation multiplies its specified delay target by
a fixed constant in order to turn it into a busy-loop.  This magic
number doesn't work properly when the clock configuration isn't the
same as a stock LeafLabs board.  Add DELAY_US_MULT to the MCU-specific
configuration in stm32.h in order to allow other chips to use delay_us().
2011-07-18 14:19:04 -04:00
Marti Bolivar 9dde5488a4 Move STM32 config from libmaple.h into stm32.h. 2011-07-18 14:07:17 -04:00
Andrew J Meyer 02d4ea34e5 fixed a bug in usbreceivebytes
bug prevented consecutive SerialUSB.read() calls from returning consecutive bytes
2011-07-01 16:28:40 -04:00
Marti Bolivar 72e45660ab systick.c: Updating systick_uptime_millis before handling user callback.
Thanks to x893 for the suggestion.
2011-06-24 14:45:24 -04:00
Marti Bolivar 8e8975a8f5 Merge branch 'freertos' 2011-06-24 14:38:35 -04:00
Marti Bolivar 55ec285642 Make FreeRTOS changes comply with the coding standard.
Don't modify the core FreeRTOS code; only change source that's
specific to libmaple.
2011-06-24 14:37:54 -04:00
Marti Bolivar 3844dc7467 systick.h: Comment typo 2011-06-21 22:10:11 -04:00