Skip to content

Commit 27c6952

Browse files
committed
whb04b: Remove unneccesary code
1 parent 010897f commit 27c6952

4 files changed

Lines changed: 3 additions & 27 deletions

File tree

src/hal/user_comps/xhc-whb04b-6/usb.cc

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -125,16 +125,6 @@ ConstantUsbPackages::ConstantUsbPackages() :
125125
{
126126
}
127127
// ----------------------------------------------------------------------
128-
uint16_t Usb::getUsbVendorId() const
129-
{
130-
return usbVendorId;
131-
}
132-
// ----------------------------------------------------------------------
133-
uint16_t Usb::getUsbProductId() const
134-
{
135-
return usbProductId;
136-
}
137-
// ----------------------------------------------------------------------
138128
bool Usb::isDeviceOpen() const
139129
{
140130
return deviceHandle != nullptr;
@@ -150,11 +140,6 @@ bool Usb::getDoReconnect() const
150140
return mDoReconnect;
151141
}
152142
// ----------------------------------------------------------------------
153-
void Usb::setDoReconnect(bool doReconnect)
154-
{
155-
this->mDoReconnect = doReconnect;
156-
}
157-
// ----------------------------------------------------------------------
158143
void Usb::setUsbProductId(uint16_t usbProductId)
159144
{
160145
this->usbProductId = usbProductId;
@@ -215,7 +200,7 @@ void Usb::sendDisplayData()
215200
if (r < 0)
216201
{
217202
std::cerr << "transmission failed, try to reconnect ..." << endl;
218-
setDoReconnect(true);
203+
mDoReconnect = true;
219204
return;
220205
}
221206
}
@@ -604,7 +589,7 @@ Usb::InitStatus Usb::init()
604589
*verboseInitOut << "." << std::flush;
605590
sleep(1);
606591
}
607-
setDoReconnect(false);
592+
mDoReconnect=false;
608593
*verboseInitOut << " done" << endl;
609594
}
610595

src/hal/user_comps/xhc-whb04b-6/usb.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -284,13 +284,10 @@ class Usb : public UsbRawInputListener
284284
//! \param onDataReceivedCallback called when received data is ready
285285
Usb(const char* name, OnUsbInputPackageListener& onDataReceivedCallback, Hal &hal);
286286
~Usb();
287-
uint16_t getUsbVendorId() const;
288-
uint16_t getUsbProductId() const;
289287
void setUsbProductId(uint16_t usbProductId);
290288
bool isDeviceOpen() const;
291289
bool isWaitForPendantBeforeHalEnabled() const;
292290
bool getDoReconnect() const;
293-
void setDoReconnect(bool doReconnect);
294291
void onUsbDataReceived(struct libusb_transfer* transfer) override;
295292
void setSimulationMode(bool isSimulationMode);
296293
void setIsRunning(bool enableRunning);

src/hal/user_comps/xhc-whb04b-6/xhc-whb04b6.cc

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ int XhcWhb04b6Component::run()
450450
if (mUsb.isDeviceOpen())
451451
{
452452
*mInitCout << "init enabling reception ...";
453-
if (!enableReceiveAsyncTransfer())
453+
if (!mUsb.setupAsyncTransfer())
454454
{
455455
std::cerr << endl << "failed to enable reception" << endl;
456456
return EXIT_FAILURE;
@@ -470,11 +470,6 @@ void XhcWhb04b6Component::linuxcncSimulate()
470470
{
471471
}
472472
// ----------------------------------------------------------------------
473-
bool XhcWhb04b6Component::enableReceiveAsyncTransfer()
474-
{
475-
return mUsb.setupAsyncTransfer();
476-
}
477-
// ----------------------------------------------------------------------
478473
void XhcWhb04b6Component::setSimulationMode(bool enableSimulationMode)
479474
{
480475
mIsSimulationMode = enableSimulationMode;

src/hal/user_comps/xhc-whb04b-6/xhc-whb04b6.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ class XhcWhb04b6Component :
5151
void initWhb();
5252
void initHal();
5353
void teardownHal();
54-
bool enableReceiveAsyncTransfer();
5554
void updateDisplay();
5655
void linuxcncSimulate();
5756
void requestTermination(int signal = -42);

0 commit comments

Comments
 (0)