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.
interrupts.cpp
- Committer:
- bwang
- Date:
- 2017-03-10
- Revision:
- 82:5e741c5ffd9f
- Child:
- 83:eb3704d4943f
File content as of revision 82:5e741c5ffd9f:
#include "globals.h"
#include "CommandProcessor.h"
char linebuf[128];
int index = 0;
void rxCallback() {
while (io.pc->readable()) {
char c = io.pc->getc();
if (c != 127 && c != '\r' && c != '\t') {
linebuf[index] = c;
index++;
io.pc->putc(c);
} else if (c == 127) {
if (index > 0) {
index--;
io.pc->putc(c);
}
} else if (c == '\r') {
linebuf[index] = 0;
io.pc->putc(c);
processCmd(io.pc, io.pref, linebuf);
index = 0;
io.pc->putc('>');
}
}
}