Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions host/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,9 @@ endif()
# Process subdirectories
################################################################################
add_subdirectory(libraries)
add_subdirectory(misc)
add_subdirectory(utilities)
add_subdirectory(common)
#add_subdirectory(misc)
#add_subdirectory(utilities)
#add_subdirectory(common)

################################################################################
# Create uninstall target
Expand Down
14 changes: 7 additions & 7 deletions host/libraries/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ cmake_minimum_required(VERSION 3.5)
add_subdirectory(libbladeRF)

# Conditionally add the test directory
option(TEST_LIBBLADERF "Enables libbladeRF test output" ON)
if(TEST_LIBBLADERF)
message(STATUS "libbladeRF_test: enabled")
add_subdirectory(libbladeRF_test)
else()
message(STATUS "libbladeRF_test: disabled")
endif()
# option(TEST_LIBBLADERF "Enables libbladeRF test output" ON)
# if(TEST_LIBBLADERF)
# message(STATUS "libbladeRF_test: enabled")
# add_subdirectory(libbladeRF_test)
# else()
# message(STATUS "libbladeRF_test: disabled")
# endif()
24 changes: 24 additions & 0 deletions host/libraries/libbladeRF/src/backend/usb/libusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1003,6 +1003,29 @@ static inline void cancel_all_transfers(struct bladerf_stream *stream)
int status;
struct lusb_stream_data *stream_data = stream->backend_data;

#ifdef __APPLE__
/* For macOS and iOS, canceling one transfer will cause all transfers
* on the same endpoint to be cancelled.
*/
bool have_cancelled = false;

for (i = 0; i < stream_data->num_transfers; i++) {
if (stream_data->transfer_status[i] == TRANSFER_IN_FLIGHT) {
if (!have_cancelled) {
status = libusb_cancel_transfer(stream_data->transfers[i]);
if (status < 0 && status != LIBUSB_ERROR_NOT_FOUND) {
log_error("Error canceling transfer (%d): %s\n",
status, libusb_error_name(status));
} else {
stream_data->transfer_status[i] = TRANSFER_CANCEL_PENDING;
}
have_cancelled = true;
} else {
stream_data->transfer_status[i] = TRANSFER_CANCEL_PENDING;
}
}
}
#else
for (i = 0; i < stream_data->num_transfers; i++) {
if (stream_data->transfer_status[i] == TRANSFER_IN_FLIGHT) {
status = libusb_cancel_transfer(stream_data->transfers[i]);
Expand All @@ -1014,6 +1037,7 @@ static inline void cancel_all_transfers(struct bladerf_stream *stream)
}
}
}
#endif
}

static inline size_t transfer_idx(struct lusb_stream_data *stream_data,
Expand Down
1 change: 1 addition & 0 deletions host/utilities/bladeRF-power/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ project(bladeRF-power LANGUAGES C)

set (CURSES_NEED_NCURSES TRUE)
set (CURSES_NEED_WIDE TRUE)
set (CMAKE_PREFIX_PATH /opt/homebrew/opt/ncurses)
find_package(Curses REQUIRED)

include_directories(
Expand Down