From c0e917ea8303d9dff3d3428adcbc69374731a1f7 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 9 Jul 2019 19:30:51 -0500 Subject: [PATCH] DUE/usb should use platform min/max --- Marlin/src/HAL/HAL_DUE/usb/uotghs_device_due.c | 3 ++- Marlin/src/HAL/HAL_DUE/usb/uotghs_device_due.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Marlin/src/HAL/HAL_DUE/usb/uotghs_device_due.c b/Marlin/src/HAL/HAL_DUE/usb/uotghs_device_due.c index 0dfcd5ac1f..c714f10653 100644 --- a/Marlin/src/HAL/HAL_DUE/usb/uotghs_device_due.c +++ b/Marlin/src/HAL/HAL_DUE/usb/uotghs_device_due.c @@ -40,6 +40,7 @@ * \asf_license_stop * */ + /* * Support and FAQ: visit Atmel Support */ @@ -1904,7 +1905,7 @@ static void udd_ep_in_sent(udd_ep_id_t ep) ptr_src = &ptr_job->buf[ptr_job->buf_cnt]; nb_remain = ptr_job->buf_size - ptr_job->buf_cnt; // Fill a bank even if no data (ZLP) - nb_data = MIN(nb_remain, pkt_size); + nb_data = min(nb_remain, pkt_size); // Modify job information ptr_job->buf_cnt += nb_data; ptr_job->buf_load = nb_data; diff --git a/Marlin/src/HAL/HAL_DUE/usb/uotghs_device_due.h b/Marlin/src/HAL/HAL_DUE/usb/uotghs_device_due.h index 1cd6914f85..97877994bf 100644 --- a/Marlin/src/HAL/HAL_DUE/usb/uotghs_device_due.h +++ b/Marlin/src/HAL/HAL_DUE/usb/uotghs_device_due.h @@ -291,7 +291,7 @@ extern "C" { //! available greater size, then applies register format of UOTGHS controller //! for endpoint size bit-field. #undef udd_format_endpoint_size -#define udd_format_endpoint_size(size) (32 - clz(((uint32_t)MIN(MAX(size, 8), 1024) << 1) - 1) - 1 - 3) +#define udd_format_endpoint_size(size) (32 - clz(((uint32_t)min(max(size, 8), 1024) << 1) - 1) - 1 - 3) //! Configures the selected endpoint size #define udd_configure_endpoint_size(ep, size) (Wr_bitfield(UOTGHS_ARRAY(UOTGHS_DEVEPTCFG[0], ep), UOTGHS_DEVEPTCFG_EPSIZE_Msk, udd_format_endpoint_size(size))) //! Gets the configured selected endpoint size