NEC Near Field Communication RF module library for mbed H001-000003-001 (950MHz), H001-000013-001 (920MHz), TY24FM-E2024 (2.4GHz)
Dependents: NECnfc_sample Drone_air Drone_ground
NEC Near Field Communication RF module library
NEC製の近距離無線モジュール用のライブラリです。
Diff: NECnfc_hal.cpp
- Revision:
- 5:e5a358e9ed94
- Parent:
- 4:07e752ff8dce
--- a/NECnfc_hal.cpp Tue Sep 15 06:17:57 2015 +0000 +++ b/NECnfc_hal.cpp Mon Oct 19 01:36:35 2015 +0000 @@ -53,11 +53,11 @@ int NECnfc::sleep (int wait) { - if (!_wakeup && !_wmode) return -1; + if (!_wakeup) return -1; DBG("sleep\r\n"); _wakeup->write(1); - if (wait) { + if (wait && _wmode) { while (! _wmode->read()); } return 0; @@ -65,11 +65,11 @@ int NECnfc::wakeup (int wait) { - if (!_wakeup && !_wmode) return -1; + if (!_wakeup) return -1; DBG("wakeup\r\n"); _wakeup->write(0); - if (wait) { + if (wait && _wmode) { while (_wmode->read()); } return 0;