forked SoftSerial
Fork of SoftSerial by
Diff: SoftSerial_rx.cpp
- Revision:
- 6:517082212c00
- Parent:
- 4:c010265ed202
- Child:
- 10:236fce2e5b8c
--- a/SoftSerial_rx.cpp Sat Apr 26 20:55:02 2014 +0000
+++ b/SoftSerial_rx.cpp Sun Apr 27 08:33:17 2014 +0000
@@ -12,16 +12,15 @@
//Start receiving byte
void SoftSerial::rx_gpio_irq_handler(void) {
- rxout.attach_us(this, &SoftSerial::rx_handler, bit_period + (bit_period >> 1)); //Start reading first data byte
+ rxticker.prime();
+ rxticker.setNext(bit_period + (bit_period >> 1));
rx->fall(NULL);
rx_bit = 0;
rx_error = false;
};
void SoftSerial::rx_handler(void) {
- if (!rx_bit)
- rxticker.attach_us(this, &SoftSerial::rx_handler, bit_period);
-
+ rxticker.setNext(bit_period);
rx_bit++;
//Receive data
