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.
Revision 86:bb53196f7557, committed 2020-03-31
- Comitter:
- MarceloSalazar
- Date:
- Tue Mar 31 08:42:42 2020 +0000
- Parent:
- 85:b4c5dbbf74e3
- Commit message:
- serial passthrough - tested on K64
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
| mbed-os.lib | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Wed Dec 19 13:45:03 2018 +0000
+++ b/main.cpp Tue Mar 31 08:42:42 2020 +0000
@@ -1,24 +1,15 @@
-/* mbed Microcontroller Library
- * Copyright (c) 2018 ARM Limited
- * SPDX-License-Identifier: Apache-2.0
- */
-
#include "mbed.h"
-#include "stats_report.h"
-
-DigitalOut led1(LED1);
-
-// main() runs in its own thread in the OS
-int main()
-{
- SystemReport sys_state(500 /* Loop delay time in ms */);
-
- while (true) {
- // Blink LED and wait 0.5 seconds
- led1 = !led1;
- wait(0.5f);
-
- // Following the main thread wait, report on the current system status
- sys_state.report_state();
+
+RawSerial pc(USBTX, USBRX, 115200); // tx, rx
+RawSerial device(D1, D0, 115200); // tx, rx
+
+int main() {
+ while(1) {
+ if(pc.readable()) {
+ device.putc(pc.getc());
+ }
+ if(device.readable()) {
+ pc.putc(device.getc());
+ }
}
-}
+}
\ No newline at end of file
--- a/mbed-os.lib Wed Dec 19 13:45:03 2018 +0000 +++ b/mbed-os.lib Tue Mar 31 08:42:42 2020 +0000 @@ -1,1 +1,1 @@ -https://github.com/ARMmbed/mbed-os/#6a0a86538c0b9b2bfcc4583b1e2b7fea8f4e71e9 +https://github.com/ARMmbed/mbed-os/#ecb3c8c837162c73537bd0f3592c6e2a42994045