Browse Source

Clear up some more compile warnings

Scott Lahteine 6 years ago
parent
commit
50270b53a0

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

@@ -217,7 +217,7 @@ extern "C" {
217 217
 #define udd_raise_msof()                          (UOTGHS->UOTGHS_DEVIFR = UOTGHS_DEVIFR_MSOFS)
218 218
 #define Is_udd_msof()                             (Tst_bits(UOTGHS->UOTGHS_DEVISR, UOTGHS_DEVISR_MSOF))
219 219
 #define udd_micro_frame_number()                  \
220
-	(Rd_bitfield(UOTGHS->UOTGHS_DEVFNUM, (UOTGHS_DEVFNUM_FNUM_Msk|UOTGHS_DEVFNUM_MFNUM_Msk)))
220
+  (Rd_bitfield(UOTGHS->UOTGHS_DEVFNUM, (UOTGHS_DEVFNUM_FNUM_Msk|UOTGHS_DEVFNUM_MFNUM_Msk)))
221 221
 //! @}
222 222
 
223 223
 //! Manage suspend event
@@ -266,10 +266,10 @@ extern "C" {
266 266
 #define Is_udd_endpoint_enabled(ep)               (Tst_bits(UOTGHS->UOTGHS_DEVEPT, UOTGHS_DEVEPT_EPEN0 << (ep)))
267 267
   //! resets the selected endpoint
268 268
 #define udd_reset_endpoint(ep)                                         \
269
-	do {                                                               \
270
-		Set_bits(UOTGHS->UOTGHS_DEVEPT, UOTGHS_DEVEPT_EPRST0 << (ep)); \
271
-		Clr_bits(UOTGHS->UOTGHS_DEVEPT, UOTGHS_DEVEPT_EPRST0 << (ep)); \
272
-	} while (0)
269
+  do {                                                               \
270
+    Set_bits(UOTGHS->UOTGHS_DEVEPT, UOTGHS_DEVEPT_EPRST0 << (ep)); \
271
+    Clr_bits(UOTGHS->UOTGHS_DEVEPT, UOTGHS_DEVEPT_EPRST0 << (ep)); \
272
+  } while (0)
273 273
   //! Tests if the selected endpoint is being reset
274 274
 #define Is_udd_resetting_endpoint(ep)             (Tst_bits(UOTGHS->UOTGHS_DEVEPT, UOTGHS_DEVEPT_EPRST0 << (ep)))
275 275
 
@@ -290,6 +290,7 @@ extern "C" {
290 290
   //! Bounds given integer size to allowed range and rounds it up to the nearest
291 291
   //! available greater size, then applies register format of UOTGHS controller
292 292
   //! for endpoint size bit-field.
293
+#undef udd_format_endpoint_size
293 294
 #define udd_format_endpoint_size(size)            (32 - clz(((uint32_t)MIN(MAX(size, 8), 1024) << 1) - 1) - 1 - 3)
294 295
   //! Configures the selected endpoint size
295 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)))
@@ -307,14 +308,14 @@ extern "C" {
307 308
 
308 309
   //! Configures selected endpoint in one step
309 310
 #define udd_configure_endpoint(ep, type, dir, size, bank) (\
310
-	Wr_bits(UOTGHS_ARRAY(UOTGHS_DEVEPTCFG[0], ep), UOTGHS_DEVEPTCFG_EPTYPE_Msk |\
311
-			UOTGHS_DEVEPTCFG_EPDIR  |\
312
-			UOTGHS_DEVEPTCFG_EPSIZE_Msk |\
313
-			UOTGHS_DEVEPTCFG_EPBK_Msk ,   \
314
-			(((uint32_t)(type) << UOTGHS_DEVEPTCFG_EPTYPE_Pos) & UOTGHS_DEVEPTCFG_EPTYPE_Msk) |\
315
-			(((uint32_t)(dir ) << UOTGHS_DEVEPTCFG_EPDIR_Pos ) & UOTGHS_DEVEPTCFG_EPDIR) |\
316
-			( (uint32_t)udd_format_endpoint_size(size) << UOTGHS_DEVEPTCFG_EPSIZE_Pos) |\
317
-			(((uint32_t)(bank) << UOTGHS_DEVEPTCFG_EPBK_Pos) & UOTGHS_DEVEPTCFG_EPBK_Msk))\
311
+  Wr_bits(UOTGHS_ARRAY(UOTGHS_DEVEPTCFG[0], ep), UOTGHS_DEVEPTCFG_EPTYPE_Msk |\
312
+      UOTGHS_DEVEPTCFG_EPDIR  |\
313
+      UOTGHS_DEVEPTCFG_EPSIZE_Msk |\
314
+      UOTGHS_DEVEPTCFG_EPBK_Msk ,   \
315
+      (((uint32_t)(type) << UOTGHS_DEVEPTCFG_EPTYPE_Pos) & UOTGHS_DEVEPTCFG_EPTYPE_Msk) |\
316
+      (((uint32_t)(dir ) << UOTGHS_DEVEPTCFG_EPDIR_Pos ) & UOTGHS_DEVEPTCFG_EPDIR) |\
317
+      ( (uint32_t)udd_format_endpoint_size(size) << UOTGHS_DEVEPTCFG_EPSIZE_Pos) |\
318
+      (((uint32_t)(bank) << UOTGHS_DEVEPTCFG_EPBK_Pos) & UOTGHS_DEVEPTCFG_EPBK_Msk))\
318 319
 )
319 320
   //! Tests if current endpoint is configured
320 321
 #define Is_udd_endpoint_configured(ep)            (Tst_bits(UOTGHS_ARRAY(UOTGHS_DEVEPTISR[0], ep), UOTGHS_DEVEPTISR_CFGOK))
@@ -540,7 +541,7 @@ extern "C" {
540 541
   //! @warning It is up to the user of this macro to make sure that used HSB
541 542
   //! addresses are identical to the DPRAM internal pointer modulo 32 bits.
542 543
 #define udd_get_endpoint_fifo_access(ep, scale) \
543
-		(((volatile TPASTE2(U, scale) (*)[0x8000 / ((scale) / 8)])UOTGHS_RAM_ADDR)[(ep)])
544
+    (((volatile TPASTE2(U, scale) (*)[0x8000 / ((scale) / 8)])UOTGHS_RAM_ADDR)[(ep)])
544 545
 
545 546
 //! @name UOTGHS endpoint DMA drivers
546 547
 //! These macros manage the common features of the endpoint DMA channels.
@@ -572,60 +573,60 @@ extern "C" {
572 573
   //! @{
573 574
       //! Structure for DMA next descriptor register
574 575
 typedef struct {
575
-	uint32_t *NXT_DSC_ADD;
576
+  uint32_t *NXT_DSC_ADD;
576 577
 } uotghs_dma_nextdesc_t;
577 578
       //! Structure for DMA control register
578 579
 typedef struct {
579
-	uint32_t CHANN_ENB:1,
580
-		LDNXT_DSC:1,
581
-		END_TR_EN:1,
582
-		END_B_EN:1,
583
-		END_TR_IT:1,
584
-		END_BUFFIT:1,
585
-		DESC_LD_IT:1,
586
-		BUST_LCK:1,
587
-		reserved:8,
588
-		BUFF_LENGTH:16;
580
+  uint32_t CHANN_ENB:1,
581
+    LDNXT_DSC:1,
582
+    END_TR_EN:1,
583
+    END_B_EN:1,
584
+    END_TR_IT:1,
585
+    END_BUFFIT:1,
586
+    DESC_LD_IT:1,
587
+    BUST_LCK:1,
588
+    reserved:8,
589
+    BUFF_LENGTH:16;
589 590
 } uotghs_dma_control_t;
590 591
       //! Structure for DMA status register
591 592
 typedef struct {
592
-	uint32_t CHANN_ENB:1,
593
-		CHANN_ACT:1,
594
-		reserved0:2,
595
-		END_TR_ST:1,
596
-		END_BF_ST:1,
597
-		DESC_LDST:1,
598
-		reserved1:9,
599
-		BUFF_COUNT:16;
593
+  uint32_t CHANN_ENB:1,
594
+    CHANN_ACT:1,
595
+    reserved0:2,
596
+    END_TR_ST:1,
597
+    END_BF_ST:1,
598
+    DESC_LDST:1,
599
+    reserved1:9,
600
+    BUFF_COUNT:16;
600 601
 } uotghs_dma_status_t;
601 602
       //! Structure for DMA descriptor
602 603
 typedef struct {
603
-	union {
604
-		uint32_t nextdesc;
605
-		uotghs_dma_nextdesc_t NEXTDESC;
606
-	};
607
-	uint32_t addr;
608
-	union {
609
-		uint32_t control;
610
-		uotghs_dma_control_t CONTROL;
611
-	};
612
-	uint32_t reserved;
604
+  union {
605
+    uint32_t nextdesc;
606
+    uotghs_dma_nextdesc_t NEXTDESC;
607
+  };
608
+  uint32_t addr;
609
+  union {
610
+    uint32_t control;
611
+    uotghs_dma_control_t CONTROL;
612
+  };
613
+  uint32_t reserved;
613 614
 } sam_uotghs_dmadesc_t, uotghs_dmadesc_t;
614 615
       //! Structure for DMA registers in a channel
615 616
 typedef struct {
616
-	union {
617
-		uint32_t nextdesc;
618
-		uotghs_dma_nextdesc_t NEXTDESC;
619
-	};
620
-	uint32_t addr;
621
-	union {
622
-		uint32_t control;
623
-		uotghs_dma_control_t CONTROL;
624
-	};
625
-	union {
626
-		unsigned long status;
627
-		uotghs_dma_status_t STATUS;
628
-	};
617
+  union {
618
+    uint32_t nextdesc;
619
+    uotghs_dma_nextdesc_t NEXTDESC;
620
+  };
621
+  uint32_t addr;
622
+  union {
623
+    uint32_t control;
624
+    uotghs_dma_control_t CONTROL;
625
+  };
626
+  union {
627
+    unsigned long status;
628
+    uotghs_dma_status_t STATUS;
629
+  };
629 630
 } sam_uotghs_dmach_t, uotghs_dmach_t;
630 631
       //! DMA channel control command
631 632
 #define UDD_ENDPOINT_DMA_STOP_NOW                 (0)

+ 0
- 1
Marlin/src/HAL/HAL_LPC1768/u8g_com_HAL_LPC1768_st7920_sw_spi.cpp View File

@@ -70,7 +70,6 @@ static uint8_t SPI_speed = 0;
70 70
 static uint8_t rs_last_state = 255;
71 71
 
72 72
 static void u8g_com_LPC1768_st7920_write_byte_sw_spi(uint8_t rs, uint8_t val) {
73
-  uint8_t i;
74 73
 
75 74
   if (rs != rs_last_state) {  // time to send a command/data byte
76 75
     rs_last_state = rs;

+ 1
- 1
Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp View File

@@ -443,7 +443,7 @@
443 443
       uint16_t segments = lroundf(cartesian_xy_mm * (1.0 / (DELTA_SEGMENT_MIN_LENGTH))); // cartesian fixed segment length
444 444
     #endif
445 445
 
446
-    NOLESS(segments, 1);                        // must have at least one segment
446
+    NOLESS(segments, 1U);                        // must have at least one segment
447 447
     const float inv_segments = 1.0 / segments;  // divide once, multiply thereafter
448 448
 
449 449
     #if IS_SCARA // scale the feed rate from mm/s to degrees/s

+ 1
- 1
Marlin/src/gcode/lcd/M300.cpp View File

@@ -37,7 +37,7 @@ void GcodeSuite::M300() {
37 37
   uint16_t duration = parser.ushortval('P', 1000);
38 38
 
39 39
   // Limits the tone duration to 0-5 seconds.
40
-  NOMORE(duration, 5000);
40
+  NOMORE(duration, 5000U);
41 41
 
42 42
   BUZZ(duration, frequency);
43 43
 }

+ 2
- 2
Marlin/src/module/motion.cpp View File

@@ -570,7 +570,7 @@ float soft_endstop_min[XYZ] = { X_MIN_BED, Y_MIN_BED, Z_MIN_POS },
570 570
     #endif
571 571
 
572 572
     // At least one segment is required
573
-    NOLESS(segments, 1);
573
+    NOLESS(segments, 1U);
574 574
 
575 575
     // The approximate length of each segment
576 576
     const float inv_segments = 1.0 / float(segments),
@@ -717,7 +717,7 @@ float soft_endstop_min[XYZ] = { X_MIN_BED, Y_MIN_BED, Z_MIN_POS },
717 717
       // The length divided by the segment size
718 718
       // At least one segment is required
719 719
       uint16_t segments = cartesian_mm / segment_size;
720
-      NOLESS(segments, 1);
720
+      NOLESS(segments, 1U);
721 721
 
722 722
       // The approximate length of each segment
723 723
       const float inv_segments = 1.0 / float(segments),

Loading…
Cancel
Save