Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of frdm_echo by
shell.cpp@15:a32db434af65, 2014-04-25 (annotated)
- Committer:
- silverpanda
- Date:
- Fri Apr 25 16:22:54 2014 +0000
- Revision:
- 15:a32db434af65
- Parent:
- 14:73ef945b8def
debugged
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
silverpanda | 5:03b7c237c4c4 | 1 | #include "mbed.h" |
silverpanda | 7:19da09fe546b | 2 | #include "LEDColors.h" |
silverpanda | 5:03b7c237c4c4 | 3 | #include "shell.h" |
silverpanda | 5:03b7c237c4c4 | 4 | |
silverpanda | 7:19da09fe546b | 5 | extern LEDColors *ledColors; |
silverpanda | 7:19da09fe546b | 6 | |
silverpanda | 5:03b7c237c4c4 | 7 | // create contructor |
silverpanda | 5:03b7c237c4c4 | 8 | Shell::Shell(uint32_t thisBaudRate) |
silverpanda | 5:03b7c237c4c4 | 9 | { |
silverpanda | 5:03b7c237c4c4 | 10 | usbSerial = new Serial(USBTX, USBRX); |
silverpanda | 5:03b7c237c4c4 | 11 | usbSerial->baud(115200); |
silverpanda | 8:b715912d684b | 12 | characterCount = 0; |
silverpanda | 8:b715912d684b | 13 | characterPointer = 0; |
silverpanda | 5:03b7c237c4c4 | 14 | } |
silverpanda | 5:03b7c237c4c4 | 15 | //----------------------------------------------------------------------------- |
silverpanda | 5:03b7c237c4c4 | 16 | |
silverpanda | 5:03b7c237c4c4 | 17 | void Shell::sendText(char *thisText) |
silverpanda | 5:03b7c237c4c4 | 18 | { |
silverpanda | 5:03b7c237c4c4 | 19 | // this can send any text |
silverpanda | 5:03b7c237c4c4 | 20 | usbSerial->printf(thisText); |
silverpanda | 5:03b7c237c4c4 | 21 | } |
silverpanda | 5:03b7c237c4c4 | 22 | //----------------------------------------------------------------------------- |
silverpanda | 5:03b7c237c4c4 | 23 | |
silverpanda | 12:b846b64e3980 | 24 | void Shell::sendStartMessage() |
silverpanda | 5:03b7c237c4c4 | 25 | { |
silverpanda | 5:03b7c237c4c4 | 26 | // sends the first greeting |
silverpanda | 12:b846b64e3980 | 27 | sendText("> ** K64 LED controller **\n"); |
silverpanda | 12:b846b64e3980 | 28 | sendText(">\n"); |
silverpanda | 12:b846b64e3980 | 29 | sendText("> use commands like: turn blue LED on\n"); |
silverpanda | 12:b846b64e3980 | 30 | sendText("> or: turn red LED off\n"); |
silverpanda | 12:b846b64e3980 | 31 | sendText(">\n> "); |
silverpanda | 5:03b7c237c4c4 | 32 | } |
silverpanda | 5:03b7c237c4c4 | 33 | //----------------------------------------------------------------------------- |
silverpanda | 5:03b7c237c4c4 | 34 | |
silverpanda | 5:03b7c237c4c4 | 35 | void Shell::scanUSBSerialRx() |
silverpanda | 5:03b7c237c4c4 | 36 | { |
silverpanda | 5:03b7c237c4c4 | 37 | // check if there is something to read |
silverpanda | 5:03b7c237c4c4 | 38 | if(usbSerial->readable()) { |
silverpanda | 9:f9efd3a69c2d | 39 | |
silverpanda | 5:03b7c237c4c4 | 40 | // if so ... |
silverpanda | 5:03b7c237c4c4 | 41 | char character = usbSerial->getc(); |
silverpanda | 9:f9efd3a69c2d | 42 | |
silverpanda | 5:03b7c237c4c4 | 43 | // see if this is a semi colon or a carriage return |
silverpanda | 5:03b7c237c4c4 | 44 | // if so, give a new line cursor |
silverpanda | 7:19da09fe546b | 45 | if((character == ';') || (character == 13)) { |
silverpanda | 9:f9efd3a69c2d | 46 | finishCharacterBuffer(); |
silverpanda | 9:f9efd3a69c2d | 47 | parseCommands(); |
silverpanda | 7:19da09fe546b | 48 | usbSerial->printf("\n> "); |
silverpanda | 11:4c6c6d6c0ebe | 49 | // ledColors->flashWhite(10); |
silverpanda | 11:4c6c6d6c0ebe | 50 | ledColors->flash(lcBlue, 10); |
silverpanda | 7:19da09fe546b | 51 | } |
silverpanda | 9:f9efd3a69c2d | 52 | |
silverpanda | 5:03b7c237c4c4 | 53 | // if not, just print the character |
silverpanda | 9:f9efd3a69c2d | 54 | else if(addCharacterToBuffer(character)) { |
silverpanda | 9:f9efd3a69c2d | 55 | usbSerial->printf("%c", character); |
silverpanda | 11:4c6c6d6c0ebe | 56 | ledColors->flash(lcGreen, 10); |
silverpanda | 7:19da09fe546b | 57 | } |
silverpanda | 5:03b7c237c4c4 | 58 | } |
silverpanda | 5:03b7c237c4c4 | 59 | } |
silverpanda | 5:03b7c237c4c4 | 60 | //----------------------------------------------------------------------------- |
silverpanda | 9:f9efd3a69c2d | 61 | |
silverpanda | 9:f9efd3a69c2d | 62 | bool Shell::addCharacterToBuffer(char newCharacter) |
silverpanda | 8:b715912d684b | 63 | { |
silverpanda | 9:f9efd3a69c2d | 64 | bool accept = (characterPointer < ItsInputBufferSize_); |
silverpanda | 9:f9efd3a69c2d | 65 | if(accept) { |
silverpanda | 8:b715912d684b | 66 | inputBuffer[characterPointer++] = newCharacter; |
silverpanda | 8:b715912d684b | 67 | characterCount = characterPointer; |
silverpanda | 8:b715912d684b | 68 | } |
silverpanda | 9:f9efd3a69c2d | 69 | return accept; |
silverpanda | 8:b715912d684b | 70 | } |
silverpanda | 8:b715912d684b | 71 | //----------------------------------------------------------------------------- |
silverpanda | 8:b715912d684b | 72 | |
silverpanda | 8:b715912d684b | 73 | void Shell::finishCharacterBuffer() |
silverpanda | 8:b715912d684b | 74 | { |
silverpanda | 10:85a8da3b7e5e | 75 | inputBuffer[characterCount] = 0; |
silverpanda | 10:85a8da3b7e5e | 76 | characterCount = characterPointer; |
silverpanda | 8:b715912d684b | 77 | characterPointer = 0; |
silverpanda | 8:b715912d684b | 78 | } |
silverpanda | 9:f9efd3a69c2d | 79 | //----------------------------------------------------------------------------- |
silverpanda | 9:f9efd3a69c2d | 80 | |
silverpanda | 11:4c6c6d6c0ebe | 81 | char Shell::lowercase(char thisChar) |
silverpanda | 11:4c6c6d6c0ebe | 82 | { |
silverpanda | 11:4c6c6d6c0ebe | 83 | // check if this character is uppercase |
silverpanda | 11:4c6c6d6c0ebe | 84 | if((thisChar >= 'A') && (thisChar <= 'Z')) thisChar += 32; |
silverpanda | 11:4c6c6d6c0ebe | 85 | |
silverpanda | 11:4c6c6d6c0ebe | 86 | return thisChar; |
silverpanda | 11:4c6c6d6c0ebe | 87 | } |
silverpanda | 11:4c6c6d6c0ebe | 88 | //----------------------------------------------------------------------------- |
silverpanda | 11:4c6c6d6c0ebe | 89 | |
silverpanda | 11:4c6c6d6c0ebe | 90 | bool Shell::findString(char *thisString) |
silverpanda | 9:f9efd3a69c2d | 91 | { |
silverpanda | 9:f9efd3a69c2d | 92 | bool found = false; |
silverpanda | 11:4c6c6d6c0ebe | 93 | uint32_t startPointer = 0, characterPointer, newStartLocation, stringLength = 0; |
silverpanda | 9:f9efd3a69c2d | 94 | char firstChar, secondChar; |
silverpanda | 11:4c6c6d6c0ebe | 95 | |
silverpanda | 11:4c6c6d6c0ebe | 96 | // determine the length of thisString |
silverpanda | 11:4c6c6d6c0ebe | 97 | while(thisString[stringLength]) stringLength++; |
silverpanda | 11:4c6c6d6c0ebe | 98 | |
silverpanda | 10:85a8da3b7e5e | 99 | // start at the start position (0) on the input buffer |
silverpanda | 11:4c6c6d6c0ebe | 100 | while(!found |
silverpanda | 11:4c6c6d6c0ebe | 101 | && (characterCount >= stringLength) |
silverpanda | 11:4c6c6d6c0ebe | 102 | && (startPointer <= characterCount - stringLength)) { |
silverpanda | 11:4c6c6d6c0ebe | 103 | |
silverpanda | 10:85a8da3b7e5e | 104 | // start at the beginning of the compare string (thisString) |
silverpanda | 9:f9efd3a69c2d | 105 | found = true; |
silverpanda | 9:f9efd3a69c2d | 106 | characterPointer = 0; |
silverpanda | 9:f9efd3a69c2d | 107 | while(found && (characterPointer < stringLength)) { |
silverpanda | 11:4c6c6d6c0ebe | 108 | |
silverpanda | 10:85a8da3b7e5e | 109 | // get and compare characters |
silverpanda | 9:f9efd3a69c2d | 110 | firstChar = inputBuffer[startPointer + characterPointer]; |
silverpanda | 9:f9efd3a69c2d | 111 | secondChar = thisString[characterPointer]; |
silverpanda | 11:4c6c6d6c0ebe | 112 | found = (lowercase(firstChar) == lowercase(secondChar)); |
silverpanda | 11:4c6c6d6c0ebe | 113 | |
silverpanda | 10:85a8da3b7e5e | 114 | // for debugging |
silverpanda | 9:f9efd3a69c2d | 115 | // usbSerial->printf("(compare %c with %c)\n", firstChar, secondChar); |
silverpanda | 11:4c6c6d6c0ebe | 116 | |
silverpanda | 10:85a8da3b7e5e | 117 | // move up to next characters |
silverpanda | 9:f9efd3a69c2d | 118 | characterPointer++; |
silverpanda | 9:f9efd3a69c2d | 119 | } |
silverpanda | 11:4c6c6d6c0ebe | 120 | |
silverpanda | 10:85a8da3b7e5e | 121 | // move start position |
silverpanda | 10:85a8da3b7e5e | 122 | if(found) { |
silverpanda | 10:85a8da3b7e5e | 123 | newStartLocation = startPointer + stringLength; |
silverpanda | 11:4c6c6d6c0ebe | 124 | |
silverpanda | 10:85a8da3b7e5e | 125 | // clean up from buffer |
silverpanda | 10:85a8da3b7e5e | 126 | characterPointer = newStartLocation; |
silverpanda | 10:85a8da3b7e5e | 127 | while(characterPointer < characterCount) { |
silverpanda | 10:85a8da3b7e5e | 128 | firstChar = inputBuffer[characterPointer]; |
silverpanda | 10:85a8da3b7e5e | 129 | inputBuffer[characterPointer - newStartLocation] = firstChar; |
silverpanda | 10:85a8da3b7e5e | 130 | characterPointer++; |
silverpanda | 10:85a8da3b7e5e | 131 | } |
silverpanda | 10:85a8da3b7e5e | 132 | characterCount -= newStartLocation; |
silverpanda | 10:85a8da3b7e5e | 133 | inputBuffer[characterCount] = 0; |
silverpanda | 11:4c6c6d6c0ebe | 134 | |
silverpanda | 10:85a8da3b7e5e | 135 | // for debugging send buffer |
silverpanda | 10:85a8da3b7e5e | 136 | /* |
silverpanda | 10:85a8da3b7e5e | 137 | if(characterCount) { |
silverpanda | 10:85a8da3b7e5e | 138 | sendText(" is now \""); |
silverpanda | 10:85a8da3b7e5e | 139 | sendText(inputBuffer); |
silverpanda | 10:85a8da3b7e5e | 140 | sendText("\""); |
silverpanda | 10:85a8da3b7e5e | 141 | } |
silverpanda | 10:85a8da3b7e5e | 142 | */ |
silverpanda | 10:85a8da3b7e5e | 143 | } |
silverpanda | 11:4c6c6d6c0ebe | 144 | |
silverpanda | 9:f9efd3a69c2d | 145 | startPointer++; |
silverpanda | 9:f9efd3a69c2d | 146 | } |
silverpanda | 11:4c6c6d6c0ebe | 147 | |
silverpanda | 10:85a8da3b7e5e | 148 | // report |
silverpanda | 9:f9efd3a69c2d | 149 | return found; |
silverpanda | 9:f9efd3a69c2d | 150 | } |
silverpanda | 9:f9efd3a69c2d | 151 | //----------------------------------------------------------------------------- |
silverpanda | 9:f9efd3a69c2d | 152 | |
silverpanda | 9:f9efd3a69c2d | 153 | void Shell::parseCommands() |
silverpanda | 9:f9efd3a69c2d | 154 | { |
silverpanda | 11:4c6c6d6c0ebe | 155 | if(findString("set")) sendText(" -- \"set\" found!"); |
silverpanda | 11:4c6c6d6c0ebe | 156 | if(findString("Clark")) sendText(" -- \"Clark\" found!"); |
silverpanda | 11:4c6c6d6c0ebe | 157 | if(findString("Stefan")) sendText(" -- Hi \"Stefan\"!"); |
silverpanda | 11:4c6c6d6c0ebe | 158 | if(findString("Ralph")) sendText(" -- Hey, that's me!"); |
silverpanda | 11:4c6c6d6c0ebe | 159 | |
silverpanda | 12:b846b64e3980 | 160 | if(findString("turn")) parseLEDState(); |
silverpanda | 14:73ef945b8def | 161 | if(findString("generate")) parseGenerate(); |
silverpanda | 15:a32db434af65 | 162 | if(findString("get")) parseGet(); |
silverpanda | 9:f9efd3a69c2d | 163 | } |
silverpanda | 9:f9efd3a69c2d | 164 | //----------------------------------------------------------------------------- |
silverpanda | 11:4c6c6d6c0ebe | 165 | |
silverpanda | 12:b846b64e3980 | 166 | void Shell::parseLEDState() |
silverpanda | 11:4c6c6d6c0ebe | 167 | { |
silverpanda | 11:4c6c6d6c0ebe | 168 | // example text: turn blue LED on |
silverpanda | 11:4c6c6d6c0ebe | 169 | |
silverpanda | 11:4c6c6d6c0ebe | 170 | eLEDColor ledColor = lcNone; |
silverpanda | 11:4c6c6d6c0ebe | 171 | if(findString("red")) ledColor = lcRed; |
silverpanda | 11:4c6c6d6c0ebe | 172 | if(findString("blue")) ledColor = lcBlue; |
silverpanda | 11:4c6c6d6c0ebe | 173 | if(findString("green")) ledColor = lcGreen; |
silverpanda | 11:4c6c6d6c0ebe | 174 | |
silverpanda | 12:b846b64e3980 | 175 | // check if color is specified |
silverpanda | 11:4c6c6d6c0ebe | 176 | if(ledColor == lcNone) { |
silverpanda | 11:4c6c6d6c0ebe | 177 | sendText(" -- missing LED color: red, blue or green"); |
silverpanda | 11:4c6c6d6c0ebe | 178 | sendExample(); |
silverpanda | 11:4c6c6d6c0ebe | 179 | } |
silverpanda | 11:4c6c6d6c0ebe | 180 | else { |
silverpanda | 12:b846b64e3980 | 181 | |
silverpanda | 12:b846b64e3980 | 182 | // check if LED is specified |
silverpanda | 11:4c6c6d6c0ebe | 183 | if(findString("LED")) { |
silverpanda | 11:4c6c6d6c0ebe | 184 | |
silverpanda | 12:b846b64e3980 | 185 | // check for state |
silverpanda | 11:4c6c6d6c0ebe | 186 | eState state = stNone; |
silverpanda | 11:4c6c6d6c0ebe | 187 | if(findString("on")) state = stOn; |
silverpanda | 11:4c6c6d6c0ebe | 188 | if(findString("off")) state = stOff; |
silverpanda | 11:4c6c6d6c0ebe | 189 | |
silverpanda | 11:4c6c6d6c0ebe | 190 | if(state == stNone) { |
silverpanda | 12:b846b64e3980 | 191 | |
silverpanda | 12:b846b64e3980 | 192 | // state not specified |
silverpanda | 11:4c6c6d6c0ebe | 193 | sendText(" -- missing state: on or off"); |
silverpanda | 11:4c6c6d6c0ebe | 194 | sendExample(); |
silverpanda | 11:4c6c6d6c0ebe | 195 | } |
silverpanda | 11:4c6c6d6c0ebe | 196 | else { |
silverpanda | 12:b846b64e3980 | 197 | |
silverpanda | 12:b846b64e3980 | 198 | // check if state has changed |
silverpanda | 12:b846b64e3980 | 199 | if(ledColors->getState(ledColor) == state) { |
silverpanda | 12:b846b64e3980 | 200 | |
silverpanda | 12:b846b64e3980 | 201 | // state not changed |
silverpanda | 12:b846b64e3980 | 202 | sendText(" -- already "); |
silverpanda | 12:b846b64e3980 | 203 | (state == stOn) ? sendText("on") : sendText("off"); |
silverpanda | 12:b846b64e3980 | 204 | } |
silverpanda | 12:b846b64e3980 | 205 | else { |
silverpanda | 12:b846b64e3980 | 206 | |
silverpanda | 12:b846b64e3980 | 207 | // state has changed |
silverpanda | 12:b846b64e3980 | 208 | sendText(" -- done!"); |
silverpanda | 12:b846b64e3980 | 209 | ledColors->turn(ledColor, state); |
silverpanda | 12:b846b64e3980 | 210 | } |
silverpanda | 11:4c6c6d6c0ebe | 211 | } |
silverpanda | 11:4c6c6d6c0ebe | 212 | } |
silverpanda | 11:4c6c6d6c0ebe | 213 | else { |
silverpanda | 12:b846b64e3980 | 214 | |
silverpanda | 12:b846b64e3980 | 215 | // LED was not specified |
silverpanda | 11:4c6c6d6c0ebe | 216 | sendText(" -- specify LED"); |
silverpanda | 11:4c6c6d6c0ebe | 217 | sendExample(); |
silverpanda | 11:4c6c6d6c0ebe | 218 | } |
silverpanda | 11:4c6c6d6c0ebe | 219 | } |
silverpanda | 11:4c6c6d6c0ebe | 220 | } |
silverpanda | 11:4c6c6d6c0ebe | 221 | //----------------------------------------------------------------------------- |
silverpanda | 11:4c6c6d6c0ebe | 222 | |
silverpanda | 11:4c6c6d6c0ebe | 223 | void Shell::sendExample() |
silverpanda | 11:4c6c6d6c0ebe | 224 | { |
silverpanda | 11:4c6c6d6c0ebe | 225 | sendText(" -> example: turn red LED on"); |
silverpanda | 11:4c6c6d6c0ebe | 226 | } |
silverpanda | 13:019e24491f32 | 227 | //----------------------------------------------------------------------------- |
silverpanda | 13:019e24491f32 | 228 | |
silverpanda | 14:73ef945b8def | 229 | void Shell::parseGenerate() |
silverpanda | 14:73ef945b8def | 230 | { |
silverpanda | 14:73ef945b8def | 231 | if(findString("pi")) generatePi(); |
silverpanda | 14:73ef945b8def | 232 | else sendText(" -- generate what?"); |
silverpanda | 14:73ef945b8def | 233 | } |
silverpanda | 14:73ef945b8def | 234 | //----------------------------------------------------------------------------- |
silverpanda | 14:73ef945b8def | 235 | |
silverpanda | 15:a32db434af65 | 236 | void Shell::parseGet() |
silverpanda | 15:a32db434af65 | 237 | { |
silverpanda | 15:a32db434af65 | 238 | if(findString("pi")) generatePi(); |
silverpanda | 15:a32db434af65 | 239 | else sendText(" -- get what?"); |
silverpanda | 15:a32db434af65 | 240 | } |
silverpanda | 15:a32db434af65 | 241 | //----------------------------------------------------------------------------- |
silverpanda | 15:a32db434af65 | 242 | |
silverpanda | 13:019e24491f32 | 243 | void Shell::reportPushButtonPress(ePushButton thisPushButton) |
silverpanda | 13:019e24491f32 | 244 | { |
silverpanda | 13:019e24491f32 | 245 | switch(thisPushButton) { |
silverpanda | 13:019e24491f32 | 246 | case pb2: sendText("SW2"); break; |
silverpanda | 13:019e24491f32 | 247 | case pb3: sendText("SW3"); break; |
silverpanda | 13:019e24491f32 | 248 | } |
silverpanda | 13:019e24491f32 | 249 | sendText(" pressed\n> "); |
silverpanda | 13:019e24491f32 | 250 | } |
silverpanda | 14:73ef945b8def | 251 | //----------------------------------------------------------------------------- |
silverpanda | 14:73ef945b8def | 252 | |
silverpanda | 14:73ef945b8def | 253 | void Shell::generatePi() |
silverpanda | 14:73ef945b8def | 254 | { |
silverpanda | 15:a32db434af65 | 255 | const int n = 1000, len = 10 * n / 3 + 1; |
silverpanda | 15:a32db434af65 | 256 | int i, j, k, q = 0, x, nines = 0, predigit = 0, digits = 0, a[len]; |
silverpanda | 14:73ef945b8def | 257 | |
silverpanda | 15:a32db434af65 | 258 | decimalCounter = 0; |
silverpanda | 15:a32db434af65 | 259 | for(j = 0; j < len; j++) a[j] = 2; |
silverpanda | 15:a32db434af65 | 260 | for(j = 0; j < n; j++) { |
silverpanda | 14:73ef945b8def | 261 | q = 0; |
silverpanda | 15:a32db434af65 | 262 | for(i = len; i > 0; i--) { |
silverpanda | 15:a32db434af65 | 263 | x = 10 * a[i] + q * i; |
silverpanda | 15:a32db434af65 | 264 | a[i] = x % (2 * i - 1); |
silverpanda | 15:a32db434af65 | 265 | q = x / (2 * i - 1); |
silverpanda | 14:73ef945b8def | 266 | } |
silverpanda | 14:73ef945b8def | 267 | a[1] = q % 10; |
silverpanda | 15:a32db434af65 | 268 | q /= 10; |
silverpanda | 15:a32db434af65 | 269 | if(q == 9) nines++; |
silverpanda | 15:a32db434af65 | 270 | else { |
silverpanda | 15:a32db434af65 | 271 | if(q == 10) { |
silverpanda | 15:a32db434af65 | 272 | sendDecimal(predigit + 1); |
silverpanda | 15:a32db434af65 | 273 | for(k = 0; k < nines; k++) sendDecimal(0); |
silverpanda | 14:73ef945b8def | 274 | predigit = 0; |
silverpanda | 14:73ef945b8def | 275 | } else { |
silverpanda | 15:a32db434af65 | 276 | sendDecimal(predigit); |
silverpanda | 14:73ef945b8def | 277 | predigit = q; |
silverpanda | 15:a32db434af65 | 278 | for(k = 0; k < nines; k++) sendDecimal(9); |
silverpanda | 14:73ef945b8def | 279 | } |
silverpanda | 15:a32db434af65 | 280 | nines = 0; |
silverpanda | 15:a32db434af65 | 281 | digits += nines + 1; |
silverpanda | 14:73ef945b8def | 282 | } |
silverpanda | 14:73ef945b8def | 283 | } |
silverpanda | 14:73ef945b8def | 284 | } |
silverpanda | 14:73ef945b8def | 285 | //----------------------------------------------------------------------------- |
silverpanda | 15:a32db434af65 | 286 | |
silverpanda | 15:a32db434af65 | 287 | void Shell::sendDecimal(uint8_t decimal) |
silverpanda | 15:a32db434af65 | 288 | { |
silverpanda | 15:a32db434af65 | 289 | switch(decimalCounter) { |
silverpanda | 15:a32db434af65 | 290 | case 0: break; |
silverpanda | 15:a32db434af65 | 291 | case 1: usbSerial->printf(" -- pi = %d.", decimal); break; |
silverpanda | 15:a32db434af65 | 292 | default: usbSerial->printf("%d", decimal); |
silverpanda | 15:a32db434af65 | 293 | } |
silverpanda | 15:a32db434af65 | 294 | decimalCounter++; |
silverpanda | 15:a32db434af65 | 295 | } |
silverpanda | 15:a32db434af65 | 296 | //----------------------------------------------------------------------------- |