Преглед изворни кода

DUE/usb should use platform min/max

Scott Lahteine пре 6 година
родитељ
комит
c0e917ea83

+ 2
- 1
Marlin/src/HAL/HAL_DUE/usb/uotghs_device_due.c Прегледај датотеку

40
  * \asf_license_stop
40
  * \asf_license_stop
41
  *
41
  *
42
  */
42
  */
43
+
43
 /*
44
 /*
44
  * Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a>
45
  * Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a>
45
  */
46
  */
1904
 		ptr_src = &ptr_job->buf[ptr_job->buf_cnt];
1905
 		ptr_src = &ptr_job->buf[ptr_job->buf_cnt];
1905
 		nb_remain = ptr_job->buf_size - ptr_job->buf_cnt;
1906
 		nb_remain = ptr_job->buf_size - ptr_job->buf_cnt;
1906
 		// Fill a bank even if no data (ZLP)
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
 		// Modify job information
1909
 		// Modify job information
1909
 		ptr_job->buf_cnt += nb_data;
1910
 		ptr_job->buf_cnt += nb_data;
1910
 		ptr_job->buf_load = nb_data;
1911
 		ptr_job->buf_load = nb_data;

+ 1
- 1
Marlin/src/HAL/HAL_DUE/usb/uotghs_device_due.h Прегледај датотеку

291
   //! available greater size, then applies register format of UOTGHS controller
291
   //! available greater size, then applies register format of UOTGHS controller
292
   //! for endpoint size bit-field.
292
   //! for endpoint size bit-field.
293
 #undef udd_format_endpoint_size
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
   //! Configures the selected endpoint size
295
   //! Configures the selected endpoint size
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)))
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
   //! Gets the configured selected endpoint size
297
   //! Gets the configured selected endpoint size

Loading…
Откажи
Сачувај