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.
Diff: Encoder.cpp
- Revision:
- 2:36572948b0d4
- Parent:
- 1:c44f4aa7a45d
- Child:
- 3:cf7ae37c6930
--- a/Encoder.cpp Wed Dec 30 17:29:45 2020 +0000
+++ b/Encoder.cpp Mon Jan 25 14:26:30 2021 +0000
@@ -19,6 +19,12 @@
timer.reset();
return;
}
+ for (int i = 0; i < 3; i++) {
+ if (!_pin_A) {
+ wait_us(10);
+ return;
+ }
+ }
int dt = now_time - last_time;
stop_checker.attach(callback(this, &Encoder::check_stop), 0.01);
update_raito(dt);