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: SDFileSystem mbed
Fork of PES4_Programme by
header/serialConnection.h@89:f63e4736d875, 2018-04-09 (annotated)
- Committer:
- itslinear
- Date:
- Mon Apr 09 15:19:36 2018 +0000
- Revision:
- 89:f63e4736d875
- Child:
- 93:32cd0af29c2b
added not working serialConnection
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| itslinear | 89:f63e4736d875 | 1 | #pragma once |
| itslinear | 89:f63e4736d875 | 2 | #include "mbed.h" |
| itslinear | 89:f63e4736d875 | 3 | /* |
| itslinear | 89:f63e4736d875 | 4 | |
| itslinear | 89:f63e4736d875 | 5 | void Tx_interrupt(); |
| itslinear | 89:f63e4736d875 | 6 | void Rx_interrupt(); |
| itslinear | 89:f63e4736d875 | 7 | void send_line(); |
| itslinear | 89:f63e4736d875 | 8 | void read_line(); |
| itslinear | 89:f63e4736d875 | 9 | |
| itslinear | 89:f63e4736d875 | 10 | // Circular buffers for serial TX and RX data - used by interrupt routines |
| itslinear | 89:f63e4736d875 | 11 | const int buffer_size = 1024; |
| itslinear | 89:f63e4736d875 | 12 | |
| itslinear | 89:f63e4736d875 | 13 | // might need to increase buffer size for high baud rates |
| itslinear | 89:f63e4736d875 | 14 | char tx_buffer[buffer_size+1]; |
| itslinear | 89:f63e4736d875 | 15 | char rx_buffer[buffer_size+1]; |
| itslinear | 89:f63e4736d875 | 16 | |
| itslinear | 89:f63e4736d875 | 17 | // Circular buffer pointers |
| itslinear | 89:f63e4736d875 | 18 | // volatile makes read-modify-write atomic |
| itslinear | 89:f63e4736d875 | 19 | volatile int tx_in=0; |
| itslinear | 89:f63e4736d875 | 20 | volatile int tx_out=0; |
| itslinear | 89:f63e4736d875 | 21 | volatile int rx_in=0; |
| itslinear | 89:f63e4736d875 | 22 | volatile int rx_out=0; |
| itslinear | 89:f63e4736d875 | 23 | |
| itslinear | 89:f63e4736d875 | 24 | // Line buffers for sprintf and sscanf |
| itslinear | 89:f63e4736d875 | 25 | char tx_line[80]; |
| itslinear | 89:f63e4736d875 | 26 | char rx_line[80]; |
| itslinear | 89:f63e4736d875 | 27 | |
| itslinear | 89:f63e4736d875 | 28 | */ |
