Renamed clearAllVariables() to Initialize()

This commit is contained in:
Kristian Lauszus 2013-12-01 16:02:23 +01:00
parent 6004d61de2
commit c84dce8e00
2 changed files with 5 additions and 5 deletions

View file

@ -39,7 +39,7 @@ bPollEnable(false) // Don't start polling before dongle is connected
for (uint8_t i = 0; i < BTD_NUMSERVICES; i++) for (uint8_t i = 0; i < BTD_NUMSERVICES; i++)
btService[i] = NULL; btService[i] = NULL;
clearAllVariables(); // Set all variables, endpoint structs etc. to default values Initialize(); // Set all variables, endpoint structs etc. to default values
if (pUsb) // Register in USB subsystem if (pUsb) // Register in USB subsystem
pUsb->RegisterDeviceClass(this); // Set devConfig[] entry pUsb->RegisterDeviceClass(this); // Set devConfig[] entry
@ -52,7 +52,7 @@ uint8_t BTD::ConfigureDevice(uint8_t parent, uint8_t port, bool lowspeed) {
UsbDevice *p = NULL; UsbDevice *p = NULL;
EpInfo *oldep_ptr = NULL; EpInfo *oldep_ptr = NULL;
clearAllVariables(); // Set all variables, endpoint structs etc. to default values Initialize(); // Set all variables, endpoint structs etc. to default values
AddressPool &addrPool = pUsb->GetAddressPool(); // Get memory address of USB device address pool AddressPool &addrPool = pUsb->GetAddressPool(); // Get memory address of USB device address pool
#ifdef EXTRADEBUG #ifdef EXTRADEBUG
@ -290,7 +290,7 @@ Fail:
return rcode; return rcode;
} }
void BTD::clearAllVariables() { void BTD::Initialize() {
uint8_t i; uint8_t i;
for (i = 0; i < BTD_MAX_ENDPOINTS; i++) { for (i = 0; i < BTD_MAX_ENDPOINTS; i++) {
epInfo[i].epAddr = 0; epInfo[i].epAddr = 0;
@ -367,7 +367,7 @@ void BTD::PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR* ep_ptr) {
/* Performs a cleanup after failed Init() attempt */ /* Performs a cleanup after failed Init() attempt */
uint8_t BTD::Release() { uint8_t BTD::Release() {
clearAllVariables(); // Set all variables, endpoint structs etc. to default values Initialize(); // Set all variables, endpoint structs etc. to default values
pUsb->GetAddressPool().FreeAddress(bAddress); pUsb->GetAddressPool().FreeAddress(bAddress);
return 0; return 0;
} }

2
BTD.h
View file

@ -488,7 +488,7 @@ protected:
void PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR* ep_ptr); void PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR* ep_ptr);
private: private:
void clearAllVariables(); // Set all variables, endpoint structs etc. to default values void Initialize(); // Set all variables, endpoint structs etc. to default values
BluetoothService* btService[BTD_NUMSERVICES]; BluetoothService* btService[BTD_NUMSERVICES];
uint16_t PID, VID; // PID and VID of device connected uint16_t PID, VID; // PID and VID of device connected