diff --git a/iio/iio_app/iio_app.c b/iio/iio_app/iio_app.c index fbf92b830d8..dab60cbcbf7 100644 --- a/iio/iio_app/iio_app.c +++ b/iio/iio_app/iio_app.c @@ -92,7 +92,7 @@ static inline uint32_t _calc_uart_xfer_time(uint32_t len, uint32_t baudrate) return ms; } -#if !defined(LINUX_PLATFORM) && !defined(NO_OS_NETWORKING) +#if !defined(LINUX_PLATFORM) && !defined(NO_OS_NETWORKING) && !defined(NO_OS_USB_UART) static int32_t iio_print_uart_info_message(struct no_os_uart_desc **uart_desc, struct no_os_uart_init_param *user_uart_params, char *message, int32_t msglen) @@ -116,7 +116,7 @@ static int32_t iio_print_uart_info_message(struct no_os_uart_desc **uart_desc, static int32_t print_uart_hello_message(struct no_os_uart_desc **uart_desc, struct no_os_uart_init_param *user_uart_params) { -#if defined(LINUX_PLATFORM) || defined(NO_OS_NETWORKING) || defined(NO_OS_LWIP_NETWORKING) +#if defined(LINUX_PLATFORM) || defined(NO_OS_NETWORKING) || defined(NO_OS_LWIP_NETWORKING) || defined(NO_OS_USB_UART) return 0; #else const char *uart_data_size[] = { "5", "6", "7", "8", "9" }; @@ -151,7 +151,7 @@ static int32_t print_uart_error_message(struct no_os_uart_desc **uart_desc, uint32_t msglen = sprintf(message, "IIOD server failed with code %d.\n", (int)status); -#if defined(LINUX_PLATFORM) || defined(NO_OS_NETWORKING) || defined(NO_OS_LWIP_NETWORKING) +#if defined(LINUX_PLATFORM) || defined(NO_OS_NETWORKING) || defined(NO_OS_LWIP_NETWORKING) || defined(NO_OS_USB_UART) (void)msglen; printf("%s", message); return 0; diff --git a/tools/scripts/generic_variables.mk b/tools/scripts/generic_variables.mk index 9fdb49876e1..964288b0b82 100644 --- a/tools/scripts/generic_variables.mk +++ b/tools/scripts/generic_variables.mk @@ -33,6 +33,10 @@ GIT_VERSION := $(subst heads/,,$(GIT_VERSION)) GIT_VERSION := $(subst -0-g,-,$(GIT_VERSION)) CFLAGS += -DNO_OS_VERSION=$(GIT_VERSION) \ -DNO_OS_PROJECT=$(notdir $(PROJECT)) + +ifeq '$(NO_OS_USB_UART)' 'y' +CFLAGS += -DNO_OS_USB_UART +endif #------------------------------------------------------------------------------ # EVALUATE PLATFORM #------------------------------------------------------------------------------ diff --git a/tools/scripts/maxim.mk b/tools/scripts/maxim.mk index c8669101201..b044eb343f6 100644 --- a/tools/scripts/maxim.mk +++ b/tools/scripts/maxim.mk @@ -114,6 +114,20 @@ ifeq ($(TARGET_LCASE), max32650) INCS := $(filter-out $(MAXIM_LIBRARIES)/CMSIS/Device/Maxim/$(TARGET_UCASE)/Include/mxc_device.h, $(INCS)) endif +ifeq ($(NO_OS_USB_UART),y) +SRCS += $(MAXIM_LIBRARIES)/MAXUSB/src/core/usb_event.c +INCS += $(MAXIM_LIBRARIES)/MAXUSB/include/core/usb.h \ + $(MAXIM_LIBRARIES)/MAXUSB/include/core/usb_protocol.h \ + $(MAXIM_LIBRARIES)/MAXUSB/include/core/usb_event.h \ + $(PLATFORM_DRIVERS)/maxim_usb_uart_descriptors.h +SRC_DIRS += $(MAXIM_LIBRARIES)/MAXUSB/src/core/musbhsfc \ + $(MAXIM_LIBRARIES)/MAXUSB/src/enumerate \ + $(MAXIM_LIBRARIES)/MAXUSB/src/devclass \ + $(MAXIM_LIBRARIES)/MAXUSB/include/core/musbhsfc \ + $(MAXIM_LIBRARIES)/MAXUSB/include/enumerate \ + $(MAXIM_LIBRARIES)/MAXUSB/include/devclass +endif + $(PLATFORM)_project: $(call print, Building for target $(TARGET_LCASE)) $(call print,Creating IDE project)