Browse Source

DUE/usb should use platform min/max

Scott Lahteine 5 years ago
parent
commit
c0e917ea83

+ 2
- 1
Marlin/src/HAL/HAL_DUE/usb/uotghs_device_due.c View File

@@ -40,6 +40,7 @@
40 40
  * \asf_license_stop
41 41
  *
42 42
  */
43
+
43 44
 /*
44 45
  * Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a>
45 46
  */
@@ -1904,7 +1905,7 @@ static void udd_ep_in_sent(udd_ep_id_t ep)
1904 1905
 		ptr_src = &ptr_job->buf[ptr_job->buf_cnt];
1905 1906
 		nb_remain = ptr_job->buf_size - ptr_job->buf_cnt;
1906 1907
 		// Fill a bank even if no data (ZLP)
1907
-		nb_data = MIN(nb_remain, pkt_size);
1908
+		nb_data = min(nb_remain, pkt_size);
1908 1909
 		// Modify job information
1909 1910
 		ptr_job->buf_cnt += nb_data;
1910 1911
 		ptr_job->buf_load = nb_data;

+ 1
- 1
Marlin/src/HAL/HAL_DUE/usb/uotghs_device_due.h View File

@@ -291,7 +291,7 @@ extern "C" {
291 291
   //! available greater size, then applies register format of UOTGHS controller
292 292
   //! for endpoint size bit-field.
293 293
 #undef udd_format_endpoint_size
294
-#define udd_format_endpoint_size(size)            (32 - clz(((uint32_t)MIN(MAX(size, 8), 1024) << 1) - 1) - 1 - 3)
294
+#define udd_format_endpoint_size(size)            (32 - clz(((uint32_t)min(max(size, 8), 1024) << 1) - 1) - 1 - 3)
295 295
   //! Configures the selected endpoint size
296 296
 #define udd_configure_endpoint_size(ep, size)     (Wr_bitfield(UOTGHS_ARRAY(UOTGHS_DEVEPTCFG[0], ep), UOTGHS_DEVEPTCFG_EPSIZE_Msk, udd_format_endpoint_size(size)))
297 297
   //! Gets the configured selected endpoint size

Loading…
Cancel
Save