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.
Dependencies: mbed
Fork of nucleo_test_soft_serial by
main.cpp@1:2bd6dc642bb9, 2021-03-05 (annotated)
- Committer:
- eric11fr
- Date:
- Fri Mar 05 09:35:03 2021 +0000
- Revision:
- 1:2bd6dc642bb9
- Parent:
- 0:a563059f0473
a tester
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| eric11fr | 0:a563059f0473 | 1 | #include "mbed.h" |
| eric11fr | 1:2bd6dc642bb9 | 2 | #include "soft_uart.h" |
| eric11fr | 0:a563059f0473 | 3 | Serial pc(USBTX, USBRX); |
| eric11fr | 1:2bd6dc642bb9 | 4 | char tmp; |
| eric11fr | 0:a563059f0473 | 5 | int main() { |
| eric11fr | 0:a563059f0473 | 6 | |
| eric11fr | 0:a563059f0473 | 7 | pc.baud(9600); |
| eric11fr | 0:a563059f0473 | 8 | pc.printf("test"); |
| eric11fr | 0:a563059f0473 | 9 | init_uart(); |
| eric11fr | 1:2bd6dc642bb9 | 10 | pc.printf("cpuclock:%d",SystemCoreClock); |
| eric11fr | 0:a563059f0473 | 11 | //printStr("d\n\r"); |
| eric11fr | 1:2bd6dc642bb9 | 12 | wait(1); |
| eric11fr | 0:a563059f0473 | 13 | //printStr("Voila!\n\r"); |
| eric11fr | 0:a563059f0473 | 14 | //printStr("Voila!\n\r"); |
| eric11fr | 1:2bd6dc642bb9 | 15 | printStr("$PMTK314,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*29\r\n"); |
| eric11fr | 1:2bd6dc642bb9 | 16 | printStr("$PMTK314,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*29\r\n"); |
| eric11fr | 1:2bd6dc642bb9 | 17 | // printStr("$PMTK314,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*29\r\n"); |
| eric11fr | 1:2bd6dc642bb9 | 18 | wait(1); |
| eric11fr | 0:a563059f0473 | 19 | while(1){ |
| eric11fr | 0:a563059f0473 | 20 | // printStr("V"); |
| eric11fr | 1:2bd6dc642bb9 | 21 | // printStr("$PMTK314,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*28\r\n"); |
| eric11fr | 1:2bd6dc642bb9 | 22 | //pc.putc( _getchar() ); |
| eric11fr | 1:2bd6dc642bb9 | 23 | do |
| eric11fr | 1:2bd6dc642bb9 | 24 | { |
| eric11fr | 1:2bd6dc642bb9 | 25 | tmp= _getchar(); |
| eric11fr | 1:2bd6dc642bb9 | 26 | pc.printf("%c",tmp); |
| eric11fr | 1:2bd6dc642bb9 | 27 | |
| eric11fr | 1:2bd6dc642bb9 | 28 | }while(tmp!='\r'); |
| eric11fr | 0:a563059f0473 | 29 | //wait(0.1); |
| eric11fr | 0:a563059f0473 | 30 | } |
| eric11fr | 0:a563059f0473 | 31 | } |
