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.
Dependents: TestVirtualisation Bf_SoftSerial_IR
Diff: SoftSerial_rx_IR.cpp
- Revision:
- 13:2b5649a1278a
- Parent:
- 12:79d63607bbb1
- Child:
- 14:dc766032cdd6
diff -r 79d63607bbb1 -r 2b5649a1278a SoftSerial_rx_IR.cpp
--- a/SoftSerial_rx_IR.cpp Mon Dec 17 03:38:12 2018 +0000
+++ b/SoftSerial_rx_IR.cpp Thu Dec 20 00:43:12 2018 +0000
@@ -1,6 +1,9 @@
+// Apply for Infrared LED and IR-Detector
+// Modified by JH1PJL Dec. 19th, 2018
+
#include "SoftSerial_IR.h"
-uint32_t overhead_us_IR = 200 * 1000000 / SystemCoreClock; //Random estimation of the overhead of mbed libs, makes slow devices like LPC812 @ 12MHz perform better
+//extern DigitalOut myled; // Debug
int SoftSerial_IR::_getc( void ) {
while(!readable());
@@ -14,7 +17,8 @@
//Start receiving byte
void SoftSerial_IR::rx_gpio_irq_handler(void) {
- rxticker.prime();
+ //myled = !myled; // Debug
+ rxticker.prime(timestamp_offset);
rxticker.setNext(bit_period + (bit_period >> 1) - overhead_us_IR);
rx->fall(NULL);
rx_bit = 0;
@@ -22,6 +26,7 @@
};
void SoftSerial_IR::rx_handler(void) {
+ //myled = !myled; // Debug
//Receive data
int val = rx->read();
@@ -81,4 +86,3 @@
rxticker.detach();
rx->fall(this, &SoftSerial_IR::rx_gpio_irq_handler);
}
-