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: RN52.cpp
- Revision:
- 13:968af0520530
- Parent:
- 11:74844f6ca8cf
- Child:
- 14:3f4098e94c29
diff -r 4194c47ca60b -r 968af0520530 RN52.cpp --- a/RN52.cpp Fri Jan 29 20:27:37 2016 +0000 +++ b/RN52.cpp Sat Jan 30 21:03:52 2016 +0000 @@ -19,11 +19,13 @@ Serial serial(p13, p14); // tx, rx DigitalIn event_pin(p20); +DigitalOut enable_pin(p5); Timer responsetime; char dummy_response[255]; void RN52::init(){ + enable(); serial.baud(115200); printf("Serial baudrate set\r\n"); @@ -35,6 +37,14 @@ } } +void RN52::enable(){ + enable_pin = 1; +} + +void RN52::disable(){ + enable_pin = 0; +} + bool RN52::check_event(RN52_RESULT * result){ clear_serial(); if(event_pin == 0) {