Skip to content

Commit

Permalink
legacy: fix LMS_GetChipTemperature() to return chip's temperature, no…
Browse files Browse the repository at this point in the history
…t the onboard sensor value
  • Loading branch information
rjonaitis committed May 27, 2024
1 parent bdaea45 commit a29540d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/API/LMS_APIWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include "comms/IComms.h"
#include "lime/LimeSuite.h"
#include "limesuiteng/limesuiteng.hpp"
#include "limesuiteng/LMS7002M.h"
#include "chips/LMS7002M/LMS7002MCSR_Data.h"
#include "MemoryPool.h"
#include "utilities/DeltaVariable.h"
Expand Down Expand Up @@ -1339,7 +1340,14 @@ API_EXPORT int CALL_CONV LMS_GetChipTemperature(lms_device_t* dev, size_t ind, f
}

if (temp)
*temp = apiDevice->device->GetTemperature(apiDevice->moduleIndex);
{
// TODO: replace with generic RFSOC interface
lime::LMS7002M* chip = reinterpret_cast<LMS7002M*>(apiDevice->device->GetInternalChip(apiDevice->moduleIndex));
if (!chip)
return -1;

*temp = chip->GetTemperature();
}
return 0;
}

Expand Down

0 comments on commit a29540d

Please sign in to comment.