mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-15 21:01:45 -05:00
LimeRFE USB support: reviewed closing device
This commit is contained in:
parent
e3bea93676
commit
e6f945bd41
@ -60,16 +60,12 @@ LimeRFEController::LimeRFEController() :
|
||||
|
||||
LimeRFEController::~LimeRFEController()
|
||||
{
|
||||
if (m_rfeDevice) {
|
||||
closeDevice();
|
||||
}
|
||||
closeDevice();
|
||||
}
|
||||
|
||||
int LimeRFEController::openDevice(const std::string& serialDeviceName)
|
||||
{
|
||||
if (m_rfeDevice) {
|
||||
closeDevice();
|
||||
}
|
||||
closeDevice();
|
||||
|
||||
rfe_dev_t *rfeDevice = RFE_Open(serialDeviceName.c_str(), nullptr);
|
||||
|
||||
@ -85,8 +81,11 @@ int LimeRFEController::openDevice(const std::string& serialDeviceName)
|
||||
|
||||
void LimeRFEController::closeDevice()
|
||||
{
|
||||
RFE_Close(m_rfeDevice);
|
||||
m_rfeDevice = nullptr;
|
||||
if (m_rfeDevice)
|
||||
{
|
||||
RFE_Close(m_rfeDevice);
|
||||
m_rfeDevice = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
int LimeRFEController::configure()
|
||||
|
Loading…
Reference in New Issue
Block a user