test
Dependents: HEPTA_assembly template HEPTA_GS
Diff: HeptaSerial.cpp
- Revision:
- 7:a41100627f55
- Parent:
- 6:c11f48bbb567
--- a/HeptaSerial.cpp Sat Aug 05 13:36:04 2017 +0000 +++ b/HeptaSerial.cpp Sat Aug 05 14:20:51 2017 +0000 @@ -12,7 +12,7 @@ * @param rx A pin for receive. * @param baud Baud rate. (Default is Baud14400.) */ -HeptaSerial::HeptaSerial(PinName tx, PinName rx) : serial(tx, rx) +HeptaSerial::HeptaSerial(PinName tx, PinName rx, PinName CAM, PinName GPS) : serial(tx, rx), CAM_SW(CAM), GPS_SW(GPS) { //serial.baud(baud); } @@ -610,11 +610,17 @@ return true; } +void HeptaSerial::camera_setting(void) +{ + CAM_SW = 1; + GPS_SW = 0; + serial.setTimeout(1); +} + void HeptaSerial::Sync(void) { - serial.setTimeout(1); + camera_setting(); HeptaSerial::ErrorNumber err = HeptaSerial::NoError; - err = sync(); int count=0; while(err) { @@ -696,6 +702,8 @@ //*********************serial*********************// void HeptaSerial::gps_setting(void) { + CAM_SW = 0; + GPS_SW = 1; serial._baud(9600); serial.setTimeout(9999); }