Aaron Silva
/
HSP_RPC_GUI
publishing
Diff: HSP/Hsp_BLE/HspBLE.cpp
- Revision:
- 4:f7d1e5d9c73e
- Parent:
- 3:abd6159877fe
- Child:
- 5:0fdc04a80278
diff -r abd6159877fe -r f7d1e5d9c73e HSP/Hsp_BLE/HspBLE.cpp --- a/HSP/Hsp_BLE/HspBLE.cpp Fri Mar 10 00:12:40 2017 +0000 +++ b/HSP/Hsp_BLE/HspBLE.cpp Fri Mar 10 22:26:07 2017 +0000 @@ -100,7 +100,7 @@ bluetoothLE->initService(serialNumberPtr, deviceName, sizeof(deviceName),envServiceUUID); bluetoothLE->onDataWritten(&HspBLE::_onDataWritten); - ticker.attach(this, &HspBLE::tickerHandler, 0.02); + ticker.attach(this, &HspBLE::tickerHandler, 0.125); } void HspBLE::_onDataWritten(int index) { @@ -176,11 +176,10 @@ case CHARACTERISTIC_ECG: { int i; uint8_t *bytePtr; - uint32_t *ecgArray; MAX30001::max30001_ecg ecgData; Peripherals::max30001()->max30001_ReadECGData(&ecgData); if (Peripherals::max30001()->max30001_status.bit.eint == 1 || Peripherals::max30001()->max30001_status.bit.pint == 1) { - if(ecgData.etag == 0b000 && ecgData.etag == 0b010){ + if(ecgData.etag != 0b110){ bytePtr = reinterpret_cast<uint8_t *>(&Peripherals::max30001()->max30001_ECG_FIFO_buffer); for (i = 0; i < sizeof(Peripherals::max30001()->max30001_ECG_FIFO_buffer); i++) data[i] = bytePtr[i]; @@ -204,8 +203,8 @@ //bluetoothLE->notifyCharacteristic(CHARACTERISTIC_TEMP_BOTTOM, data); //pollSensor(CHARACTERISTIC_ACCELEROMETER, data); //bluetoothLE->notifyCharacteristic(CHARACTERISTIC_ACCELEROMETER, data); - pollSensor(CHARACTERISTIC_HEARTRATE, data); - bluetoothLE->notifyCharacteristic(CHARACTERISTIC_HEARTRATE, data); + //pollSensor(CHARACTERISTIC_HEARTRATE, data); +// bluetoothLE->notifyCharacteristic(CHARACTERISTIC_HEARTRATE, data); pollSensor(CHARACTERISTIC_ECG, data); for(int i = 0; i < 8; i++){ uint8_t tempData[16];