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.
SWDSerial.cpp@0:e1f35ee051ae, 2013-09-08 (annotated)
- Committer:
- va009039
- Date:
- Sun Sep 08 14:14:30 2013 +0000
- Revision:
- 0:e1f35ee051ae
first commit
Who changed what in which revision?
| User | Revision | Line number | New contents of line | 
|---|---|---|---|
| va009039 | 0:e1f35ee051ae | 1 | #include "mbed_interface.h" | 
| va009039 | 0:e1f35ee051ae | 2 | #include "SWDSerial.h" | 
| va009039 | 0:e1f35ee051ae | 3 | |
| va009039 | 0:e1f35ee051ae | 4 | #define SYS_WRITEC 0x03 | 
| va009039 | 0:e1f35ee051ae | 5 | |
| va009039 | 0:e1f35ee051ae | 6 | namespace mbed { | 
| va009039 | 0:e1f35ee051ae | 7 | int readable() { return 0;} | 
| va009039 | 0:e1f35ee051ae | 8 | int writeable() { return 1; } | 
| va009039 | 0:e1f35ee051ae | 9 | int SWDSerial::_getc() { | 
| va009039 | 0:e1f35ee051ae | 10 | return 0; | 
| va009039 | 0:e1f35ee051ae | 11 | } | 
| va009039 | 0:e1f35ee051ae | 12 | |
| va009039 | 0:e1f35ee051ae | 13 | int SWDSerial::_putc(int c) { | 
| va009039 | 0:e1f35ee051ae | 14 | if (!mbed_interface_connected()) { | 
| va009039 | 0:e1f35ee051ae | 15 | return c; | 
| va009039 | 0:e1f35ee051ae | 16 | } | 
| va009039 | 0:e1f35ee051ae | 17 | return __semihost(SYS_WRITEC, &c); | 
| va009039 | 0:e1f35ee051ae | 18 | } | 
| va009039 | 0:e1f35ee051ae | 19 | |
| va009039 | 0:e1f35ee051ae | 20 | } // namespace mbed |