Software serial, for when you are out of serial pins
Dependents: BufferedSoftSerial neurGAI_Seeed_BLUETOOTH LPC-SD-35 ESP-WROOM-02_test ... more
Revision 7:7de3e1019e23, committed 2014-04-27
- Comitter:
- Sissors
- Date:
- Sun Apr 27 19:48:17 2014 +0000
- Parent:
- 6:517082212c00
- Child:
- 8:332b66de89d3
- Commit message:
- Added send_break code
Changed in this revision
| SoftSerial_tx.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/SoftSerial_tx.cpp Sun Apr 27 08:33:17 2014 +0000
+++ b/SoftSerial_tx.cpp Sun Apr 27 19:48:17 2014 +0000
@@ -10,6 +10,15 @@
return 0;
}
+void SoftSerial::send_break(void) {
+ while(!writeable());
+ tx_bit = 0; //Just to make sure it appears as non-writable to other threads/IRQs
+ tx->write(0);
+ wait_us(bit_period * _total_bits * 3 / 2);
+ tx->write(1);
+ tx_bit = -1;
+}
+
int SoftSerial::writeable(void)
{
if (!tx_en)
Erik -