mirror of https://github.com/ARMmbed/mbed-os.git
NFC: Convert to Chrono
parent
d1ae0d570c
commit
89f67b2985
|
@ -20,6 +20,8 @@
|
||||||
|
|
||||||
#include "stack/transceiver/transceiver.h"
|
#include "stack/transceiver/transceiver.h"
|
||||||
|
|
||||||
|
using std::milli;
|
||||||
|
using namespace std::chrono;
|
||||||
using namespace mbed;
|
using namespace mbed;
|
||||||
using namespace mbed::nfc;
|
using namespace mbed::nfc;
|
||||||
|
|
||||||
|
@ -181,12 +183,9 @@ void NFCController::scheduler_process(bool hw_interrupt)
|
||||||
_timeout.detach(); // Cancel timeout - if it triggers, it's ok as we'll have an "early" iteration which will likely be a no-op
|
_timeout.detach(); // Cancel timeout - if it triggers, it's ok as we'll have an "early" iteration which will likely be a no-op
|
||||||
|
|
||||||
// Process stack events
|
// Process stack events
|
||||||
uint32_t timeout_ms = nfc_scheduler_iteration(_scheduler, hw_interrupt ? EVENT_HW_INTERRUPT : EVENT_NONE);
|
duration<uint32_t, milli> timeout{nfc_scheduler_iteration(_scheduler, hw_interrupt ? EVENT_HW_INTERRUPT : EVENT_NONE)};
|
||||||
|
|
||||||
_timeout.attach_us(
|
_timeout.attach(callback(this, &NFCController::on_timeout), timeout);
|
||||||
callback(this, &NFCController::on_timeout),
|
|
||||||
timeout_ms * (us_timestamp_t) 1000
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void NFCController::on_hw_interrupt()
|
void NFCController::on_hw_interrupt()
|
||||||
|
|
Loading…
Reference in New Issue