From 1faeb6d0e72b43f161b2ca1d59216806d637d70c Mon Sep 17 00:00:00 2001 From: lathoub Date: Sat, 3 Nov 2018 11:06:10 +0100 Subject: [PATCH] use of the auto type specifier --- src/Ble_esp32.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Ble_esp32.h b/src/Ble_esp32.h index 9775854..74a084c 100644 --- a/src/Ble_esp32.h +++ b/src/Ble_esp32.h @@ -85,7 +85,7 @@ protected: and the MSB of both bytes are set to indicate that this is a header byte. Both bytes are placed into the first two position of an array in preparation for a MIDI message. */ - unsigned long currentTimeStamp = millis() & 0x01FFF; + auto currentTimeStamp = millis() & 0x01FFF; *header = ((currentTimeStamp >> 7) & 0x3F) | 0x80; // 6 bits plus MSB *timestamp = (currentTimeStamp & 0x7F) | 0x80; // 7 bits plus MSB @@ -370,7 +370,7 @@ bool BleMidiInterface::begin(const char* deviceName) pServer->setCallbacks(new MyServerCallbacks(this)); // Create the BLE Service - BLEService* pService = pServer->createService(BLEUUID(SERVICE_UUID)); + auto pService = pServer->createService(BLEUUID(SERVICE_UUID)); // Create a BLE Characteristic pCharacteristic = pService->createCharacteristic( @@ -384,7 +384,7 @@ bool BleMidiInterface::begin(const char* deviceName) // Start the service pService->start(); - BLEAdvertisementData advertisementData = BLEAdvertisementData(); + auto advertisementData = BLEAdvertisementData(); advertisementData.setFlags(0x04); advertisementData.setCompleteServices(BLEUUID(SERVICE_UUID)); advertisementData.setName(deviceName); @@ -440,7 +440,7 @@ void BleMidiInterface::receive(uint8_t *buffer, uint8_t bufferSize) //While statement contains incrementing pointers and breaks when buffer size exceeded. while (1) { //lastStatus used to capture runningStatus - uint8_t lastStatus = buffer[lPtr]; + auto lastStatus = buffer[lPtr]; if ( (buffer[lPtr] < 0x80) ) { //Status message not present, bail return;