Skip to content

Commit

Permalink
bugfix instanciation of cpp api
Browse files Browse the repository at this point in the history
  • Loading branch information
David Michaeli committed Jan 31, 2024
1 parent 8ca8b6a commit f98c85d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 3 additions & 2 deletions software/libcariboulite/src/CaribouLiteCpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ CaribouLite &CaribouLite::GetInstance(bool asyncApi, bool forceFpgaProg, LogLeve
{
try
{
_instance = std::shared_ptr<CaribouLite>(new CaribouLite(forceFpgaProg, asyncApi, logLvl));
_instance = std::shared_ptr<CaribouLite>(new CaribouLite(asyncApi, forceFpgaProg, logLvl));
}
catch (std::exception& e)
{
Expand All @@ -75,7 +75,8 @@ CaribouLite::CaribouLite(bool asyncApi, bool forceFpgaProg, LogLevel logLvl)
// get information
DetectBoard(&_systemVersion, _productName, _productGuid);

CaribouLiteRadio::ApiType api_type = asyncApi ? CaribouLiteRadio::ApiType::Async : CaribouLiteRadio::ApiType::Sync;
//printf("API TYPE: %d\n", asyncApi);
CaribouLiteRadio::ApiType api_type = (asyncApi) ? CaribouLiteRadio::ApiType::Async : CaribouLiteRadio::ApiType::Sync;

// populate the radio devices
cariboulite_radio_state_st *radio_s1g = cariboulite_get_radio(cariboulite_channel_s1g);
Expand Down
6 changes: 5 additions & 1 deletion software/libcariboulite/src/CaribouLiteRadioCpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ void CaribouLiteRadio::CaribouLiteRxThread(CaribouLiteRadio* radio)
CaribouLiteMeta* rx_meta_buffer = new CaribouLiteMeta[mtu_size];
std::complex<float>* rx_copmlex_data = new std::complex<float>[mtu_size];

//printf("Enterred Thread\n");

while (radio->_rx_thread_running)
{
if (!radio->_rx_is_active)
Expand Down Expand Up @@ -139,11 +141,12 @@ void CaribouLiteRadio::CaribouLiteTxThread(CaribouLiteRadio* radio)
CaribouLiteRadio::CaribouLiteRadio( const cariboulite_radio_state_st* radio,
RadioType type,
ApiType api_type,
const CaribouLite* parent)
const CaribouLite* parent)
: _radio(radio), _device(parent), _type(type), _rxCallbackType(RxCbType::None), _api_type(api_type)
{
if (_api_type == Async)
{
//printf("Creating Radio Type %d ASYNC\n", type);
_rx_thread_running = true;
_rx_thread = new std::thread(CaribouLiteRadio::CaribouLiteRxThread, this);

Expand All @@ -152,6 +155,7 @@ CaribouLiteRadio::CaribouLiteRadio( const cariboulite_radio_state_st* radio,
}
else
{
//printf("Creating Radio Type %d SYNC\n", type);
_read_samples = NULL;
_read_metadata = NULL;
size_t mtu_size = GetNativeMtuSample();
Expand Down

0 comments on commit f98c85d

Please sign in to comment.