 
   //setup BLE
   while (Serial1.available()) Serial1.read(); //clear the incoming Serial1 (BT) buffer
-  ble.setupBLE(myTympan);
-
+  #if USE_REV_E
+    //V7 firmware (ie, RevE)
+    ble.advertise(true);
+  #else
+    //V5 firmware (ie, RevD)
+    ble.set_BC127_firmware_ver(5);
+    ble.setupBLE(myTympan);
+  #endif
+  
   //Create the GUI description (but not yet transmitted to the App...that's after it connects)
   createTympanRemoteLayout();
 

//here are the libraries that we need
#include <Tympan_Library.h>  //include the Tympan Library

//create audio library objects for handling the audio
Tympan                    myTympan(TympanRev::D);  //do TympanRev::D or TympanRev::C
AudioInputI2S_F32         i2s_in;        //Digital audio *from* the Tympan AIC.
AudioEffectGain_F32       gain1, gain2;  //Applies digital gain to audio data.
AudioOutputI2S_F32        i2s_out;       //Digital audio *to* the Tympan AIC.  Always list last to minimize latency

  }

  //service the BLE advertising state
   ble.updateAdvertising(millis(),5000); //check every 5000 msec to ensure it is advertising (if not connected)

} //end loop();

