Code for our FYDP -only one IMU works right now -RTOS is working

Dependencies:   mbed

Committer:
majik
Date:
Wed Mar 18 22:23:48 2015 +0000
Revision:
0:964eb6a2ef00
This is our FYDP code, but only one IMU works with the RTOS.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
majik 0:964eb6a2ef00 1 /* $Id:$
majik 0:964eb6a2ef00 2 1.32 12th October 2013
majik 0:964eb6a2ef00 3 * Improved claim documentation: http://mbed.org/questions/1817/Redirect-stdout-via-MODSERIAL-is-this-po/ by http://mbed.org/users/WiredHome/
majik 0:964eb6a2ef00 4
majik 0:964eb6a2ef00 5 1.31 11th October 2013
majik 0:964eb6a2ef00 6 * Added claim function to redirect for example stdout
majik 0:964eb6a2ef00 7
majik 0:964eb6a2ef00 8 1.30 1st September 2013
majik 0:964eb6a2ef00 9 * Removed all DMA related code (not supported in this version currently)
majik 0:964eb6a2ef00 10 * Minor bug fix
majik 0:964eb6a2ef00 11
majik 0:964eb6a2ef00 12 1.29 12th July 2013
majik 0:964eb6a2ef00 13 * Added KL25Z support + split code in device dependent and independent part
majik 0:964eb6a2ef00 14
majik 0:964eb6a2ef00 15 1.26 10th June 2013
majik 0:964eb6a2ef00 16 * _uidx reference in DMA code replaced by _serial.index
majik 0:964eb6a2ef00 17
majik 0:964eb6a2ef00 18 1.25 8th January 2013
majik 0:964eb6a2ef00 19
majik 0:964eb6a2ef00 20 * Bring back into line with MBed libraries.
majik 0:964eb6a2ef00 21 * Credits:
majik 0:964eb6a2ef00 22 Erik Olieman : http://mbed.org/users/Sissors/code/MODSERIAL/rev/3ba4341d74d6
majik 0:964eb6a2ef00 23 Erik Olieman : http://mbed.org/users/Sissors/code/MODSERIAL/rev/a469aa702bab
majik 0:964eb6a2ef00 24
majik 0:964eb6a2ef00 25
majik 0:964eb6a2ef00 26 1.24 6th Dec 2012
majik 0:964eb6a2ef00 27
majik 0:964eb6a2ef00 28 * Beta release for new Mbed library.
majik 0:964eb6a2ef00 29
majik 0:964eb6a2ef00 30 1.23 25th July 2012
majik 0:964eb6a2ef00 31
majik 0:964eb6a2ef00 32 * LPC1768 code as was. This release includes "alpha" support for the LPC11U24
majik 0:964eb6a2ef00 33
majik 0:964eb6a2ef00 34 1.22 19th April 2012
majik 0:964eb6a2ef00 35
majik 0:964eb6a2ef00 36 * http://mbed.org/forum/bugs-suggestions/topic/2936/
majik 0:964eb6a2ef00 37 * Bug fix, protect important buffer pointers from IRQ corruption.
majik 0:964eb6a2ef00 38 * Credits:
majik 0:964eb6a2ef00 39 Anthony Wieser http://mbed.org/users/WieserSoftwareLtd/ for the fix.
majik 0:964eb6a2ef00 40 BlazeX http://mbed.org/users/BlazeX/ for the alert that a fix was needed!
majik 0:964eb6a2ef00 41
majik 0:964eb6a2ef00 42 1.21 10 May 2011
majik 0:964eb6a2ef00 43
majik 0:964eb6a2ef00 44 * http://mbed.org/forum/mbed/topic/2264
majik 0:964eb6a2ef00 45
majik 0:964eb6a2ef00 46 1.20 26 April 2011
majik 0:964eb6a2ef00 47
majik 0:964eb6a2ef00 48 * Bug fix, not blocking on transmit
majik 0:964eb6a2ef00 49 by Erik Petrich, http://mbed.org/forum/bugs-suggestions/topic/2200
majik 0:964eb6a2ef00 50
majik 0:964eb6a2ef00 51 1.19 20 April 2011
majik 0:964eb6a2ef00 52
majik 0:964eb6a2ef00 53 * Fixed some doxygen comment bugs.
majik 0:964eb6a2ef00 54
majik 0:964eb6a2ef00 55 1.18 20 April 2011
majik 0:964eb6a2ef00 56
majik 0:964eb6a2ef00 57 * All callbacks now use MODSERIAL_callback (rather than Mbed's FunctionPointer[1] type)
majik 0:964eb6a2ef00 58 to store and invoke it's callbacks. This allows MODSERIAL to pass a parameter
majik 0:964eb6a2ef00 59 to callbacks. The function prototype is now void func(MODSERIAL_IRQ_INFO *q).
majik 0:964eb6a2ef00 60 * Callbacks now pass a pointer to a MODSERIAL_IRQ_INFO class type.
majik 0:964eb6a2ef00 61 This class holds a pointer to the MODSERIAL object that invoked the callback
majik 0:964eb6a2ef00 62 thus freeing callbacks need to use the global variable of the original
majik 0:964eb6a2ef00 63 MODSERIAL instance.
majik 0:964eb6a2ef00 64 * MODSERIAL_IRQ_INFO also declares public functions that are protected within MODSERIAL
majik 0:964eb6a2ef00 65 thus allowing certain functions to be restricted to callback context only.
majik 0:964eb6a2ef00 66 * New function MODSERIAL_IRQ_INFO::rxDiscardLastChar() allows an rxCallback function
majik 0:964eb6a2ef00 67 to remove the character that was just placed into the RX buffer.
majik 0:964eb6a2ef00 68
majik 0:964eb6a2ef00 69 [1] http://mbed.org/users/AjK/libraries/FPointer/latest/docs/
majik 0:964eb6a2ef00 70
majik 0:964eb6a2ef00 71 1.17 08/Mar/2011
majik 0:964eb6a2ef00 72 Fixed a memory leak in the DMA code.
majik 0:964eb6a2ef00 73
majik 0:964eb6a2ef00 74 1.16 - 12 Feb 2011
majik 0:964eb6a2ef00 75
majik 0:964eb6a2ef00 76 * Missed one, doh!
majik 0:964eb6a2ef00 77
majik 0:964eb6a2ef00 78 1.15 - 12 Feb 2011
majik 0:964eb6a2ef00 79
majik 0:964eb6a2ef00 80 * Fixed some typos.
majik 0:964eb6a2ef00 81
majik 0:964eb6a2ef00 82 1.14 - 7 Feb 2011
majik 0:964eb6a2ef00 83
majik 0:964eb6a2ef00 84 * Fixed a bug in __putc() that caused the output buffer pointer to
majik 0:964eb6a2ef00 85 become corrupted.
majik 0:964eb6a2ef00 86
majik 0:964eb6a2ef00 87 1.13 - 20/01/2011
majik 0:964eb6a2ef00 88
majik 0:964eb6a2ef00 89 * Added extra documentation.
majik 0:964eb6a2ef00 90 * Fixed some typos.
majik 0:964eb6a2ef00 91
majik 0:964eb6a2ef00 92 1.12 - 20/01/2011
majik 0:964eb6a2ef00 93
majik 0:964eb6a2ef00 94 * Added new "autoDetectChar()" function. To use:-
majik 0:964eb6a2ef00 95 1st: Add a callback to invoke when the char is detected:-
majik 0:964eb6a2ef00 96 .attach(&detectedChar, MODSERIAL::RxAutoDetect);
majik 0:964eb6a2ef00 97 2nd: Send the char to detect.
majik 0:964eb6a2ef00 98 .autoDectectChar('\n');
majik 0:964eb6a2ef00 99 Whenever that char goes into the RX buffer your callback will be invoked.
majik 0:964eb6a2ef00 100 Added example2.cpp to demo a simple messaging system using this auto feature.
majik 0:964eb6a2ef00 101
majik 0:964eb6a2ef00 102
majik 0:964eb6a2ef00 103 1.11 - 23/11/2010
majik 0:964eb6a2ef00 104
majik 0:964eb6a2ef00 105 * Fixed a minor issue with 1.10 missed an alteration of name change.
majik 0:964eb6a2ef00 106
majik 0:964eb6a2ef00 107 1.10 - 23/11/2010
majik 0:964eb6a2ef00 108
majik 0:964eb6a2ef00 109 * Rename the DMA callback from attach_dma_complete() to attach_dmaSendComplete()
majik 0:964eb6a2ef00 110
majik 0:964eb6a2ef00 111 1.9 - 23/11/2010
majik 0:964eb6a2ef00 112
majik 0:964eb6a2ef00 113 * Added support for DMA sending of characters. Required is
majik 0:964eb6a2ef00 114 the MODDMA library module:-
majik 0:964eb6a2ef00 115 http://mbed.org/users/AjK/libraries/MODDMA/latest
majik 0:964eb6a2ef00 116 See example_dma.cpp for more information.
majik 0:964eb6a2ef00 117
majik 0:964eb6a2ef00 118 1.8 - 22/11/2010
majik 0:964eb6a2ef00 119
majik 0:964eb6a2ef00 120 * Added code so that if a buffer is set to zero length then
majik 0:964eb6a2ef00 121 MODSERIAL defaults to just using the FIFO for that stream
majik 0:964eb6a2ef00 122 thus making the library "fall back" to teh same operation
majik 0:964eb6a2ef00 123 that the Mbed Serial library performs.
majik 0:964eb6a2ef00 124 * Removed dmaSend() function that should have been removed
majik 0:964eb6a2ef00 125 at 1.7
majik 0:964eb6a2ef00 126
majik 0:964eb6a2ef00 127 1.7 - 21/11/2010
majik 0:964eb6a2ef00 128
majik 0:964eb6a2ef00 129 * Remove the DMA enum from MODSERIAL.h as it's not currently
majik 0:964eb6a2ef00 130 ready for release.
majik 0:964eb6a2ef00 131 * Added page doxygen comments.
majik 0:964eb6a2ef00 132
majik 0:964eb6a2ef00 133 1.6 - 21/11/2010
majik 0:964eb6a2ef00 134
majik 0:964eb6a2ef00 135 * Version 1.5 solved a blocking problem on putc() when called
majik 0:964eb6a2ef00 136 from another ISR. However, isr_tx() invokes a callback of it's
majik 0:964eb6a2ef00 137 own when a byte is tranferred from TX buffer to TX FIFO. User
majik 0:964eb6a2ef00 138 programs may interpret that as an IRQ callback. That's an ISR
majik 0:964eb6a2ef00 139 call from within an existing ISR which is not good. So the
majik 0:964eb6a2ef00 140 TxIrq callback from isr_tx is now conditional. It will only
majik 0:964eb6a2ef00 141 be called when isr_tx() is actually within it's own ISR and
majik 0:964eb6a2ef00 142 not when called from alternate ISR handlers.
majik 0:964eb6a2ef00 143
majik 0:964eb6a2ef00 144 1.5 - 21/11/2010
majik 0:964eb6a2ef00 145
majik 0:964eb6a2ef00 146 * Calling putc() (or any derived function that uses it like
majik 0:964eb6a2ef00 147 printf()) while inside an interrupt service routine can
majik 0:964eb6a2ef00 148 cause the system to lock up if the TX buffer is full. This
majik 0:964eb6a2ef00 149 is because bytes are only transferred from the TX buffer to
majik 0:964eb6a2ef00 150 the TX FIFO via the TX ISR. If we are, say in an RX ISR already,
majik 0:964eb6a2ef00 151 then the TX ISR will never trigger. The TX buffer stays full and
majik 0:964eb6a2ef00 152 there is never space to putc() the byte. So, while putc() blocks
majik 0:964eb6a2ef00 153 waiting for space it calls isr_tx() to ensure if TX FIFO space
majik 0:964eb6a2ef00 154 becomes available it will move bytes from the TX buffer to TX
majik 0:964eb6a2ef00 155 FIFO thus removing the blocking condition within putc().
majik 0:964eb6a2ef00 156
majik 0:964eb6a2ef00 157 1.4 - 21/11/2010
majik 0:964eb6a2ef00 158
majik 0:964eb6a2ef00 159 * Removed all the new DMA code. I wish mbed.org had proper SVN
majik 0:964eb6a2ef00 160 versioning, I'm use to working in HEAD and BRANCHES after I've
majik 0:964eb6a2ef00 161 released a project. Getting bug reports in current releases
majik 0:964eb6a2ef00 162 while trying to dev new code is hard to manage without source
majik 0:964eb6a2ef00 163 control of some type!
majik 0:964eb6a2ef00 164
majik 0:964eb6a2ef00 165 1.3 - 21/11/2010
majik 0:964eb6a2ef00 166
majik 0:964eb6a2ef00 167 * Fixed a macro problem with txIsBusy()
majik 0:964eb6a2ef00 168 * Started adding code to use "block data" sending using DMA
majik 0:964eb6a2ef00 169 * Removed #include "IOMACROS.h"
majik 0:964eb6a2ef00 170
majik 0:964eb6a2ef00 171 1.2 - 21/11/2010
majik 0:964eb6a2ef00 172
majik 0:964eb6a2ef00 173 * Removed unsed variables from flushBuffer()
majik 0:964eb6a2ef00 174 * Fixed a bug where both RX AND TX fifos are cleared/reset
majik 0:964eb6a2ef00 175 when just TX OR RX should be cleared.
majik 0:964eb6a2ef00 176 * Fixed a bug that cleared IIR when in fact it should be left
majik 0:964eb6a2ef00 177 alone so that any pending interrupt after flush is handled.
majik 0:964eb6a2ef00 178 * Merged setBase() into init() as it wasn't required anywhere else.
majik 0:964eb6a2ef00 179 * Changed init() to enforce _uidx is set by Serial to define the _base
majik 0:964eb6a2ef00 180 address of the Uart in use.
majik 0:964eb6a2ef00 181
majik 0:964eb6a2ef00 182 1.1 - 20/11/2010
majik 0:964eb6a2ef00 183
majik 0:964eb6a2ef00 184 * Added this file
majik 0:964eb6a2ef00 185 * Removed cruft from GETC.cpp
majik 0:964eb6a2ef00 186 * "teh" should be "the", why do my fingers do that?
majik 0:964eb6a2ef00 187
majik 0:964eb6a2ef00 188 1.0 - 20/11/2010
majik 0:964eb6a2ef00 189
majik 0:964eb6a2ef00 190 * First release.
majik 0:964eb6a2ef00 191
majik 0:964eb6a2ef00 192 */