Ver código fonte

- Rename WRITE_E_STEP for consistency

- Add BIT and TEST macros
- Add _APPLY_ macros to stepper.cpp to help with consolidation
- Consolidate code in stepper.cpp using macros
- Apply standards in stepper.cpp
- Use >= 0 instead of > -1 as a better semantic
- Replace DUAL_Y_CARRIAGE with Y_DUAL_STEPPER_DRIVERS
Scott Lahteine 9 anos atrás
pai
commit
c37f7d15c9

+ 3
- 0
Marlin/Marlin.h Ver arquivo

32
   #include "WProgram.h"
32
   #include "WProgram.h"
33
 #endif
33
 #endif
34
 
34
 
35
+#define BIT(b) (1<<(b))
36
+#define TEST(n,b) ((n)&BIT(b)!=0)
37
+
35
 // Arduino < 1.0.0 does not define this, so we need to do it ourselves
38
 // Arduino < 1.0.0 does not define this, so we need to do it ourselves
36
 #ifndef analogInputToDigitalPin
39
 #ifndef analogInputToDigitalPin
37
   #define analogInputToDigitalPin(p) ((p) + 0xA0)
40
   #define analogInputToDigitalPin(p) ((p) + 0xA0)

+ 2
- 2
Marlin/Marlin.ino Ver arquivo

47
   #endif
47
   #endif
48
 #endif
48
 #endif
49
 
49
 
50
-#if defined(DIGIPOTSS_PIN) && DIGIPOTSS_PIN > -1
51
-#include <SPI.h>
50
+#if HAS_DIGIPOTSS
51
+  #include <SPI.h>
52
 #endif
52
 #endif
53
 
53
 
54
 #if defined(DIGIPOT_I2C)
54
 #if defined(DIGIPOT_I2C)

+ 2
- 2
Marlin/Marlin.pde Ver arquivo

47
   #endif
47
   #endif
48
 #endif
48
 #endif
49
 
49
 
50
-#if defined(DIGIPOTSS_PIN) && DIGIPOTSS_PIN > -1
51
-#include <SPI.h>
50
+#if HAS_DIGIPOTSS
51
+  #include <SPI.h>
52
 #endif
52
 #endif
53
 
53
 
54
 #if defined(DIGIPOT_I2C)
54
 #if defined(DIGIPOT_I2C)

+ 1
- 1
Marlin/MarlinSerial.cpp Ver arquivo

76
   #endif
76
   #endif
77
   
77
   
78
   if (useU2X) {
78
   if (useU2X) {
79
-    M_UCSRxA = 1 << M_U2Xx;
79
+    M_UCSRxA = BIT(M_U2Xx);
80
     baud_setting = (F_CPU / 4 / baud - 1) / 2;
80
     baud_setting = (F_CPU / 4 / baud - 1) / 2;
81
   } else {
81
   } else {
82
     M_UCSRxA = 0;
82
     M_UCSRxA = 0;

+ 2
- 2
Marlin/MarlinSerial.h Ver arquivo

97
     }
97
     }
98
 
98
 
99
     FORCE_INLINE void write(uint8_t c) {
99
     FORCE_INLINE void write(uint8_t c) {
100
-      while (!((M_UCSRxA) & (1 << M_UDREx)))
100
+      while (!TEST(M_UCSRxA, M_UDREx))
101
         ;
101
         ;
102
 
102
 
103
       M_UDRx = c;
103
       M_UDRx = c;
104
     }
104
     }
105
 
105
 
106
     FORCE_INLINE void checkRx(void) {
106
     FORCE_INLINE void checkRx(void) {
107
-      if ((M_UCSRxA & (1<<M_RXCx)) != 0) {
107
+      if (TEST(M_UCSRxA, M_RXCx)) {
108
         unsigned char c  =  M_UDRx;
108
         unsigned char c  =  M_UDRx;
109
         int i = (unsigned int)(rx_buffer.head + 1) % RX_BUFFER_SIZE;
109
         int i = (unsigned int)(rx_buffer.head + 1) % RX_BUFFER_SIZE;
110
 
110
 

+ 6
- 6
Marlin/Marlin_main.cpp Ver arquivo

62
   #include "Servo.h"
62
   #include "Servo.h"
63
 #endif
63
 #endif
64
 
64
 
65
-#if defined(DIGIPOTSS_PIN) && DIGIPOTSS_PIN > -1
65
+#if HAS_DIGIPOTSS
66
   #include <SPI.h>
66
   #include <SPI.h>
67
 #endif
67
 #endif
68
 
68
 
4190
  * M907: Set digital trimpot motor current using axis codes X, Y, Z, E, B, S
4190
  * M907: Set digital trimpot motor current using axis codes X, Y, Z, E, B, S
4191
  */
4191
  */
4192
 inline void gcode_M907() {
4192
 inline void gcode_M907() {
4193
-  #if defined(DIGIPOTSS_PIN) && DIGIPOTSS_PIN > -1
4193
+  #if HAS_DIGIPOTSS
4194
     for (int i=0;i<NUM_AXIS;i++)
4194
     for (int i=0;i<NUM_AXIS;i++)
4195
       if (code_seen(axis_codes[i])) digipot_current(i, code_value());
4195
       if (code_seen(axis_codes[i])) digipot_current(i, code_value());
4196
     if (code_seen('B')) digipot_current(4, code_value());
4196
     if (code_seen('B')) digipot_current(4, code_value());
4213
   #endif
4213
   #endif
4214
 }
4214
 }
4215
 
4215
 
4216
-#if defined(DIGIPOTSS_PIN) && DIGIPOTSS_PIN > -1
4216
+#if HAS_DIGIPOTSS
4217
 
4217
 
4218
   /**
4218
   /**
4219
    * M908: Control digital trimpot directly (M908 P<pin> S<current>)
4219
    * M908: Control digital trimpot directly (M908 P<pin> S<current>)
4225
       );
4225
       );
4226
   }
4226
   }
4227
 
4227
 
4228
-#endif // DIGIPOTSS_PIN
4228
+#endif // HAS_DIGIPOTSS
4229
 
4229
 
4230
 // M350 Set microstepping mode. Warning: Steps per unit remains unchanged. S code sets stepping mode for all drivers.
4230
 // M350 Set microstepping mode. Warning: Steps per unit remains unchanged. S code sets stepping mode for all drivers.
4231
 inline void gcode_M350() {
4231
 inline void gcode_M350() {
4812
         gcode_M907();
4812
         gcode_M907();
4813
         break;
4813
         break;
4814
 
4814
 
4815
-      #if defined(DIGIPOTSS_PIN) && DIGIPOTSS_PIN > -1
4815
+      #if HAS_DIGIPOTSS
4816
         case 908: // M908 Control digital trimpot directly.
4816
         case 908: // M908 Control digital trimpot directly.
4817
           gcode_M908();
4817
           gcode_M908();
4818
           break;
4818
           break;
4819
-      #endif // DIGIPOTSS_PIN
4819
+      #endif // HAS_DIGIPOTSS
4820
 
4820
 
4821
       case 350: // M350 Set microstepping mode. Warning: Steps per unit remains unchanged. S code sets stepping mode for all drivers.
4821
       case 350: // M350 Set microstepping mode. Warning: Steps per unit remains unchanged. S code sets stepping mode for all drivers.
4822
         gcode_M350();
4822
         gcode_M350();

+ 9
- 9
Marlin/Sd2Card.cpp Ver arquivo

35
  */
35
  */
36
 static void spiInit(uint8_t spiRate) {
36
 static void spiInit(uint8_t spiRate) {
37
   // See avr processor documentation
37
   // See avr processor documentation
38
-  SPCR = (1 << SPE) | (1 << MSTR) | (spiRate >> 1);
39
-  SPSR = spiRate & 1 || spiRate == 6 ? 0 : 1 << SPI2X;
38
+  SPCR = BIT(SPE) | BIT(MSTR) | (spiRate >> 1);
39
+  SPSR = spiRate & 1 || spiRate == 6 ? 0 : BIT(SPI2X);
40
 }
40
 }
41
 //------------------------------------------------------------------------------
41
 //------------------------------------------------------------------------------
42
 /** SPI receive a byte */
42
 /** SPI receive a byte */
43
 static uint8_t spiRec() {
43
 static uint8_t spiRec() {
44
   SPDR = 0XFF;
44
   SPDR = 0XFF;
45
-  while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ }
45
+  while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ }
46
   return SPDR;
46
   return SPDR;
47
 }
47
 }
48
 //------------------------------------------------------------------------------
48
 //------------------------------------------------------------------------------
52
   if (nbyte-- == 0) return;
52
   if (nbyte-- == 0) return;
53
   SPDR = 0XFF;
53
   SPDR = 0XFF;
54
   for (uint16_t i = 0; i < nbyte; i++) {
54
   for (uint16_t i = 0; i < nbyte; i++) {
55
-    while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ }
55
+    while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ }
56
     buf[i] = SPDR;
56
     buf[i] = SPDR;
57
     SPDR = 0XFF;
57
     SPDR = 0XFF;
58
   }
58
   }
59
-  while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ }
59
+  while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ }
60
   buf[nbyte] = SPDR;
60
   buf[nbyte] = SPDR;
61
 }
61
 }
62
 //------------------------------------------------------------------------------
62
 //------------------------------------------------------------------------------
63
 /** SPI send a byte */
63
 /** SPI send a byte */
64
 static void spiSend(uint8_t b) {
64
 static void spiSend(uint8_t b) {
65
   SPDR = b;
65
   SPDR = b;
66
-  while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ }
66
+  while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ }
67
 }
67
 }
68
 //------------------------------------------------------------------------------
68
 //------------------------------------------------------------------------------
69
 /** SPI send block - only one call so force inline */
69
 /** SPI send block - only one call so force inline */
71
   void spiSendBlock(uint8_t token, const uint8_t* buf) {
71
   void spiSendBlock(uint8_t token, const uint8_t* buf) {
72
   SPDR = token;
72
   SPDR = token;
73
   for (uint16_t i = 0; i < 512; i += 2) {
73
   for (uint16_t i = 0; i < 512; i += 2) {
74
-    while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ }
74
+    while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ }
75
     SPDR = buf[i];
75
     SPDR = buf[i];
76
-    while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ }
76
+    while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ }
77
     SPDR = buf[i + 1];
77
     SPDR = buf[i + 1];
78
   }
78
   }
79
-  while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ }
79
+  while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ }
80
 }
80
 }
81
 //------------------------------------------------------------------------------
81
 //------------------------------------------------------------------------------
82
 #else  // SOFTWARE_SPI
82
 #else  // SOFTWARE_SPI

+ 4
- 4
Marlin/Sd2PinMap.h Ver arquivo

334
   void setPinMode(uint8_t pin, uint8_t mode) {
334
   void setPinMode(uint8_t pin, uint8_t mode) {
335
   if (__builtin_constant_p(pin) && pin < digitalPinCount) {
335
   if (__builtin_constant_p(pin) && pin < digitalPinCount) {
336
     if (mode) {
336
     if (mode) {
337
-      *digitalPinMap[pin].ddr |= 1 << digitalPinMap[pin].bit;
337
+      *digitalPinMap[pin].ddr |= BIT(digitalPinMap[pin].bit);
338
     } else {
338
     } else {
339
-      *digitalPinMap[pin].ddr &= ~(1 << digitalPinMap[pin].bit);
339
+      *digitalPinMap[pin].ddr &= ~BIT(digitalPinMap[pin].bit);
340
     }
340
     }
341
   } else {
341
   } else {
342
     badPinNumber();
342
     badPinNumber();
354
   void fastDigitalWrite(uint8_t pin, uint8_t value) {
354
   void fastDigitalWrite(uint8_t pin, uint8_t value) {
355
   if (__builtin_constant_p(pin) && pin < digitalPinCount) {
355
   if (__builtin_constant_p(pin) && pin < digitalPinCount) {
356
     if (value) {
356
     if (value) {
357
-      *digitalPinMap[pin].port |= 1 << digitalPinMap[pin].bit;
357
+      *digitalPinMap[pin].port |= BIT(digitalPinMap[pin].bit);
358
     } else {
358
     } else {
359
-      *digitalPinMap[pin].port &= ~(1 << digitalPinMap[pin].bit);
359
+      *digitalPinMap[pin].port &= ~BIT(digitalPinMap[pin].bit);
360
     }
360
     }
361
   } else {
361
   } else {
362
     badPinNumber();
362
     badPinNumber();

+ 2
- 2
Marlin/SdBaseFile.h Ver arquivo

171
   return 2*(fatTime & 0X1F);
171
   return 2*(fatTime & 0X1F);
172
 }
172
 }
173
 /** Default date for file timestamps is 1 Jan 2000 */
173
 /** Default date for file timestamps is 1 Jan 2000 */
174
-uint16_t const FAT_DEFAULT_DATE = ((2000 - 1980) << 9) | (1 << 5) | 1;
174
+uint16_t const FAT_DEFAULT_DATE = ((2000 - 1980) << 9) | BIT(5) | 1;
175
 /** Default time for file timestamp is 1 am */
175
 /** Default time for file timestamp is 1 am */
176
-uint16_t const FAT_DEFAULT_TIME = (1 << 11);
176
+uint16_t const FAT_DEFAULT_TIME = BIT(11);
177
 //------------------------------------------------------------------------------
177
 //------------------------------------------------------------------------------
178
 /**
178
 /**
179
  * \class SdBaseFile
179
  * \class SdBaseFile

+ 1
- 1
Marlin/SdVolume.cpp Ver arquivo

360
   blocksPerCluster_ = fbs->sectorsPerCluster;
360
   blocksPerCluster_ = fbs->sectorsPerCluster;
361
   // determine shift that is same as multiply by blocksPerCluster_
361
   // determine shift that is same as multiply by blocksPerCluster_
362
   clusterSizeShift_ = 0;
362
   clusterSizeShift_ = 0;
363
-  while (blocksPerCluster_ != (1 << clusterSizeShift_)) {
363
+  while (blocksPerCluster_ != BIT(clusterSizeShift_)) {
364
     // error if not power of 2
364
     // error if not power of 2
365
     if (clusterSizeShift_++ > 7) goto fail;
365
     if (clusterSizeShift_++ > 7) goto fail;
366
   }
366
   }

+ 3
- 3
Marlin/dogm_lcd_implementation.h Ver arquivo

24
   #define BLEN_A 0
24
   #define BLEN_A 0
25
   #define BLEN_B 1
25
   #define BLEN_B 1
26
   #define BLEN_C 2
26
   #define BLEN_C 2
27
-  #define EN_A (1<<BLEN_A)
28
-  #define EN_B (1<<BLEN_B)
29
-  #define EN_C (1<<BLEN_C)
27
+  #define EN_A BIT(BLEN_A)
28
+  #define EN_B BIT(BLEN_B)
29
+  #define EN_C BIT(BLEN_C)
30
   #define LCD_CLICKED (buttons&EN_C)
30
   #define LCD_CLICKED (buttons&EN_C)
31
 #endif
31
 #endif
32
 
32
 

+ 1
- 2
Marlin/fastio.h Ver arquivo

13
 */
13
 */
14
 
14
 
15
 #ifndef MASK
15
 #ifndef MASK
16
-/// MASKING- returns \f$2^PIN\f$
17
-#define MASK(PIN)  (1 << PIN)
16
+  #define MASK(PIN)  (1 << PIN)
18
 #endif
17
 #endif
19
 
18
 
20
 /*
19
 /*

+ 2
- 0
Marlin/pins.h Ver arquivo

184
                         analogInputToDigitalPin(TEMP_BED_PIN) \
184
                         analogInputToDigitalPin(TEMP_BED_PIN) \
185
                        }
185
                        }
186
 
186
 
187
+#define HAS_DIGIPOTSS (DIGIPOTSS_PIN >= 0)
188
+
187
 #endif //__PINS_H
189
 #endif //__PINS_H

+ 11
- 11
Marlin/planner.cpp Ver arquivo

59
 #include "language.h"
59
 #include "language.h"
60
 
60
 
61
 //===========================================================================
61
 //===========================================================================
62
-//=============================public variables ============================
62
+//============================= public variables ============================
63
 //===========================================================================
63
 //===========================================================================
64
 
64
 
65
 unsigned long minsegmenttime;
65
 unsigned long minsegmenttime;
623
 #ifndef COREXY
623
 #ifndef COREXY
624
   if (target[X_AXIS] < position[X_AXIS])
624
   if (target[X_AXIS] < position[X_AXIS])
625
   {
625
   {
626
-    block->direction_bits |= (1<<X_AXIS); 
626
+    block->direction_bits |= BIT(X_AXIS); 
627
   }
627
   }
628
   if (target[Y_AXIS] < position[Y_AXIS])
628
   if (target[Y_AXIS] < position[Y_AXIS])
629
   {
629
   {
630
-    block->direction_bits |= (1<<Y_AXIS); 
630
+    block->direction_bits |= BIT(Y_AXIS); 
631
   }
631
   }
632
 #else
632
 #else
633
   if (target[X_AXIS] < position[X_AXIS])
633
   if (target[X_AXIS] < position[X_AXIS])
634
   {
634
   {
635
-    block->direction_bits |= (1<<X_HEAD); //AlexBorro: Save the real Extruder (head) direction in X Axis
635
+    block->direction_bits |= BIT(X_HEAD); //AlexBorro: Save the real Extruder (head) direction in X Axis
636
   }
636
   }
637
   if (target[Y_AXIS] < position[Y_AXIS])
637
   if (target[Y_AXIS] < position[Y_AXIS])
638
   {
638
   {
639
-    block->direction_bits |= (1<<Y_HEAD); //AlexBorro: Save the real Extruder (head) direction in Y Axis
639
+    block->direction_bits |= BIT(Y_HEAD); //AlexBorro: Save the real Extruder (head) direction in Y Axis
640
   }
640
   }
641
   if ((target[X_AXIS]-position[X_AXIS]) + (target[Y_AXIS]-position[Y_AXIS]) < 0)
641
   if ((target[X_AXIS]-position[X_AXIS]) + (target[Y_AXIS]-position[Y_AXIS]) < 0)
642
   {
642
   {
643
-    block->direction_bits |= (1<<X_AXIS); //AlexBorro: Motor A direction (Incorrectly implemented as X_AXIS)
643
+    block->direction_bits |= BIT(X_AXIS); //AlexBorro: Motor A direction (Incorrectly implemented as X_AXIS)
644
   }
644
   }
645
   if ((target[X_AXIS]-position[X_AXIS]) - (target[Y_AXIS]-position[Y_AXIS]) < 0)
645
   if ((target[X_AXIS]-position[X_AXIS]) - (target[Y_AXIS]-position[Y_AXIS]) < 0)
646
   {
646
   {
647
-    block->direction_bits |= (1<<Y_AXIS); //AlexBorro: Motor B direction (Incorrectly implemented as Y_AXIS)
647
+    block->direction_bits |= BIT(Y_AXIS); //AlexBorro: Motor B direction (Incorrectly implemented as Y_AXIS)
648
   }
648
   }
649
 #endif
649
 #endif
650
   if (target[Z_AXIS] < position[Z_AXIS])
650
   if (target[Z_AXIS] < position[Z_AXIS])
651
   {
651
   {
652
-    block->direction_bits |= (1<<Z_AXIS); 
652
+    block->direction_bits |= BIT(Z_AXIS); 
653
   }
653
   }
654
   if (target[E_AXIS] < position[E_AXIS])
654
   if (target[E_AXIS] < position[E_AXIS])
655
   {
655
   {
656
-    block->direction_bits |= (1<<E_AXIS); 
656
+    block->direction_bits |= BIT(E_AXIS); 
657
   }
657
   }
658
 
658
 
659
   block->active_extruder = extruder;
659
   block->active_extruder = extruder;
864
   old_direction_bits = block->direction_bits;
864
   old_direction_bits = block->direction_bits;
865
   segment_time = lround((float)segment_time / speed_factor);
865
   segment_time = lround((float)segment_time / speed_factor);
866
   
866
   
867
-  if((direction_change & (1<<X_AXIS)) == 0)
867
+  if((direction_change & BIT(X_AXIS)) == 0)
868
   {
868
   {
869
     x_segment_time[0] += segment_time;
869
     x_segment_time[0] += segment_time;
870
   }
870
   }
874
     x_segment_time[1] = x_segment_time[0];
874
     x_segment_time[1] = x_segment_time[0];
875
     x_segment_time[0] = segment_time;
875
     x_segment_time[0] = segment_time;
876
   }
876
   }
877
-  if((direction_change & (1<<Y_AXIS)) == 0)
877
+  if((direction_change & BIT(Y_AXIS)) == 0)
878
   {
878
   {
879
     y_segment_time[0] += segment_time;
879
     y_segment_time[0] += segment_time;
880
   }
880
   }

+ 523
- 739
Marlin/stepper.cpp
Diferenças do arquivo suprimidas por serem muito extensas
Ver arquivo


+ 5
- 5
Marlin/stepper.h Ver arquivo

25
 #include "stepper_indirection.h"
25
 #include "stepper_indirection.h"
26
 
26
 
27
 #if EXTRUDERS > 3
27
 #if EXTRUDERS > 3
28
-  #define WRITE_E_STEP(v) { if(current_block->active_extruder == 3) { E3_STEP_WRITE(v); } else { if(current_block->active_extruder == 2) { E2_STEP_WRITE(v); } else { if(current_block->active_extruder == 1) { E1_STEP_WRITE(v); } else { E0_STEP_WRITE(v); }}}}
28
+  #define E_STEP_WRITE(v) { if(current_block->active_extruder == 3) { E3_STEP_WRITE(v); } else { if(current_block->active_extruder == 2) { E2_STEP_WRITE(v); } else { if(current_block->active_extruder == 1) { E1_STEP_WRITE(v); } else { E0_STEP_WRITE(v); }}}}
29
   #define NORM_E_DIR() { if(current_block->active_extruder == 3) { E3_DIR_WRITE( !INVERT_E3_DIR); } else { if(current_block->active_extruder == 2) { E2_DIR_WRITE(!INVERT_E2_DIR); } else { if(current_block->active_extruder == 1) { E1_DIR_WRITE(!INVERT_E1_DIR); } else { E0_DIR_WRITE(!INVERT_E0_DIR); }}}}
29
   #define NORM_E_DIR() { if(current_block->active_extruder == 3) { E3_DIR_WRITE( !INVERT_E3_DIR); } else { if(current_block->active_extruder == 2) { E2_DIR_WRITE(!INVERT_E2_DIR); } else { if(current_block->active_extruder == 1) { E1_DIR_WRITE(!INVERT_E1_DIR); } else { E0_DIR_WRITE(!INVERT_E0_DIR); }}}}
30
   #define REV_E_DIR() { if(current_block->active_extruder == 3) { E3_DIR_WRITE(INVERT_E3_DIR); } else { if(current_block->active_extruder == 2) { E2_DIR_WRITE(INVERT_E2_DIR); } else { if(current_block->active_extruder == 1) { E1_DIR_WRITE(INVERT_E1_DIR); } else { E0_DIR_WRITE(INVERT_E0_DIR); }}}}
30
   #define REV_E_DIR() { if(current_block->active_extruder == 3) { E3_DIR_WRITE(INVERT_E3_DIR); } else { if(current_block->active_extruder == 2) { E2_DIR_WRITE(INVERT_E2_DIR); } else { if(current_block->active_extruder == 1) { E1_DIR_WRITE(INVERT_E1_DIR); } else { E0_DIR_WRITE(INVERT_E0_DIR); }}}}
31
 #elif EXTRUDERS > 2
31
 #elif EXTRUDERS > 2
32
-  #define WRITE_E_STEP(v) { if(current_block->active_extruder == 2) { E2_STEP_WRITE(v); } else { if(current_block->active_extruder == 1) { E1_STEP_WRITE(v); } else { E0_STEP_WRITE(v); }}}
32
+  #define E_STEP_WRITE(v) { if(current_block->active_extruder == 2) { E2_STEP_WRITE(v); } else { if(current_block->active_extruder == 1) { E1_STEP_WRITE(v); } else { E0_STEP_WRITE(v); }}}
33
   #define NORM_E_DIR() { if(current_block->active_extruder == 2) { E2_DIR_WRITE(!INVERT_E2_DIR); } else { if(current_block->active_extruder == 1) { E1_DIR_WRITE(!INVERT_E1_DIR); } else { E0_DIR_WRITE(!INVERT_E0_DIR); }}}
33
   #define NORM_E_DIR() { if(current_block->active_extruder == 2) { E2_DIR_WRITE(!INVERT_E2_DIR); } else { if(current_block->active_extruder == 1) { E1_DIR_WRITE(!INVERT_E1_DIR); } else { E0_DIR_WRITE(!INVERT_E0_DIR); }}}
34
   #define REV_E_DIR() { if(current_block->active_extruder == 2) { E2_DIR_WRITE(INVERT_E2_DIR); } else { if(current_block->active_extruder == 1) { E1_DIR_WRITE(INVERT_E1_DIR); } else { E0_DIR_WRITE(INVERT_E0_DIR); }}}
34
   #define REV_E_DIR() { if(current_block->active_extruder == 2) { E2_DIR_WRITE(INVERT_E2_DIR); } else { if(current_block->active_extruder == 1) { E1_DIR_WRITE(INVERT_E1_DIR); } else { E0_DIR_WRITE(INVERT_E0_DIR); }}}
35
 #elif EXTRUDERS > 1
35
 #elif EXTRUDERS > 1
36
   #ifndef DUAL_X_CARRIAGE
36
   #ifndef DUAL_X_CARRIAGE
37
-    #define WRITE_E_STEP(v) { if(current_block->active_extruder == 1) { E1_STEP_WRITE(v); } else { E0_STEP_WRITE(v); }}
37
+    #define E_STEP_WRITE(v) { if(current_block->active_extruder == 1) { E1_STEP_WRITE(v); } else { E0_STEP_WRITE(v); }}
38
     #define NORM_E_DIR() { if(current_block->active_extruder == 1) { E1_DIR_WRITE(!INVERT_E1_DIR); } else { E0_DIR_WRITE(!INVERT_E0_DIR); }}
38
     #define NORM_E_DIR() { if(current_block->active_extruder == 1) { E1_DIR_WRITE(!INVERT_E1_DIR); } else { E0_DIR_WRITE(!INVERT_E0_DIR); }}
39
     #define REV_E_DIR() { if(current_block->active_extruder == 1) { E1_DIR_WRITE(INVERT_E1_DIR); } else { E0_DIR_WRITE(INVERT_E0_DIR); }}
39
     #define REV_E_DIR() { if(current_block->active_extruder == 1) { E1_DIR_WRITE(INVERT_E1_DIR); } else { E0_DIR_WRITE(INVERT_E0_DIR); }}
40
   #else
40
   #else
41
     extern bool extruder_duplication_enabled;
41
     extern bool extruder_duplication_enabled;
42
-    #define WRITE_E_STEP(v) { if(extruder_duplication_enabled) { E0_STEP_WRITE(v); E1_STEP_WRITE(v); } else if(current_block->active_extruder == 1) { E1_STEP_WRITE(v); } else { E0_STEP_WRITE(v); }}
42
+    #define E_STEP_WRITE(v) { if(extruder_duplication_enabled) { E0_STEP_WRITE(v); E1_STEP_WRITE(v); } else if(current_block->active_extruder == 1) { E1_STEP_WRITE(v); } else { E0_STEP_WRITE(v); }}
43
     #define NORM_E_DIR() { if(extruder_duplication_enabled) { E0_DIR_WRITE(!INVERT_E0_DIR); E1_DIR_WRITE(!INVERT_E1_DIR); } else if(current_block->active_extruder == 1) { E1_DIR_WRITE(!INVERT_E1_DIR); } else { E0_DIR_WRITE(!INVERT_E0_DIR); }}
43
     #define NORM_E_DIR() { if(extruder_duplication_enabled) { E0_DIR_WRITE(!INVERT_E0_DIR); E1_DIR_WRITE(!INVERT_E1_DIR); } else if(current_block->active_extruder == 1) { E1_DIR_WRITE(!INVERT_E1_DIR); } else { E0_DIR_WRITE(!INVERT_E0_DIR); }}
44
     #define REV_E_DIR() { if(extruder_duplication_enabled) { E0_DIR_WRITE(INVERT_E0_DIR); E1_DIR_WRITE(INVERT_E1_DIR); } else if(current_block->active_extruder == 1) { E1_DIR_WRITE(INVERT_E1_DIR); } else { E0_DIR_WRITE(INVERT_E0_DIR); }}
44
     #define REV_E_DIR() { if(extruder_duplication_enabled) { E0_DIR_WRITE(INVERT_E0_DIR); E1_DIR_WRITE(INVERT_E1_DIR); } else if(current_block->active_extruder == 1) { E1_DIR_WRITE(INVERT_E1_DIR); } else { E0_DIR_WRITE(INVERT_E0_DIR); }}
45
   #endif  
45
   #endif  
46
 #else
46
 #else
47
-  #define WRITE_E_STEP(v) E0_STEP_WRITE(v)
47
+  #define E_STEP_WRITE(v) E0_STEP_WRITE(v)
48
   #define NORM_E_DIR() E0_DIR_WRITE(!INVERT_E0_DIR)
48
   #define NORM_E_DIR() E0_DIR_WRITE(!INVERT_E0_DIR)
49
   #define REV_E_DIR() E0_DIR_WRITE(INVERT_E0_DIR)
49
   #define REV_E_DIR() E0_DIR_WRITE(INVERT_E0_DIR)
50
 #endif
50
 #endif

+ 16
- 16
Marlin/temperature.cpp Ver arquivo

878
 {
878
 {
879
   #if MB(RUMBA) && ((TEMP_SENSOR_0==-1)||(TEMP_SENSOR_1==-1)||(TEMP_SENSOR_2==-1)||(TEMP_SENSOR_BED==-1))
879
   #if MB(RUMBA) && ((TEMP_SENSOR_0==-1)||(TEMP_SENSOR_1==-1)||(TEMP_SENSOR_2==-1)||(TEMP_SENSOR_BED==-1))
880
     //disable RUMBA JTAG in case the thermocouple extension is plugged on top of JTAG connector
880
     //disable RUMBA JTAG in case the thermocouple extension is plugged on top of JTAG connector
881
-    MCUCR=(1<<JTD);
882
-    MCUCR=(1<<JTD);
881
+    MCUCR=BIT(JTD);
882
+    MCUCR=BIT(JTD);
883
   #endif
883
   #endif
884
   
884
   
885
   // Finish init of mult extruder arrays 
885
   // Finish init of mult extruder arrays 
937
   #endif //HEATER_0_USES_MAX6675
937
   #endif //HEATER_0_USES_MAX6675
938
 
938
 
939
   #ifdef DIDR2
939
   #ifdef DIDR2
940
-    #define ANALOG_SELECT(pin) do{ if (pin < 8) DIDR0 |= 1 << pin; else DIDR2 |= 1 << (pin - 8); }while(0)
940
+    #define ANALOG_SELECT(pin) do{ if (pin < 8) DIDR0 |= BIT(pin); else DIDR2 |= BIT(pin - 8); }while(0)
941
   #else
941
   #else
942
-    #define ANALOG_SELECT(pin) do{ DIDR0 |= 1 << pin; }while(0)
942
+    #define ANALOG_SELECT(pin) do{ DIDR0 |= BIT(pin); }while(0)
943
   #endif
943
   #endif
944
 
944
 
945
   // Set analog inputs
945
   // Set analog inputs
946
-  ADCSRA = 1<<ADEN | 1<<ADSC | 1<<ADIF | 0x07;
946
+  ADCSRA = BIT(ADEN) | BIT(ADSC) | BIT(ADIF) | 0x07;
947
   DIDR0 = 0;
947
   DIDR0 = 0;
948
   #ifdef DIDR2
948
   #ifdef DIDR2
949
     DIDR2 = 0;
949
     DIDR2 = 0;
970
   // Use timer0 for temperature measurement
970
   // Use timer0 for temperature measurement
971
   // Interleave temperature interrupt with millies interrupt
971
   // Interleave temperature interrupt with millies interrupt
972
   OCR0B = 128;
972
   OCR0B = 128;
973
-  TIMSK0 |= (1<<OCIE0B);  
973
+  TIMSK0 |= BIT(OCIE0B);  
974
   
974
   
975
   // Wait for temperature measurement to settle
975
   // Wait for temperature measurement to settle
976
   delay(250);
976
   delay(250);
1174
     max6675_temp = 0;
1174
     max6675_temp = 0;
1175
 
1175
 
1176
     #ifdef PRR
1176
     #ifdef PRR
1177
-      PRR &= ~(1<<PRSPI);
1177
+      PRR &= ~BIT(PRSPI);
1178
     #elif defined(PRR0)
1178
     #elif defined(PRR0)
1179
-      PRR0 &= ~(1<<PRSPI);
1179
+      PRR0 &= ~BIT(PRSPI);
1180
     #endif
1180
     #endif
1181
 
1181
 
1182
-    SPCR = (1<<MSTR) | (1<<SPE) | (1<<SPR0);
1182
+    SPCR = BIT(MSTR) | BIT(SPE) | BIT(SPR0);
1183
 
1183
 
1184
     // enable TT_MAX6675
1184
     // enable TT_MAX6675
1185
     WRITE(MAX6675_SS, 0);
1185
     WRITE(MAX6675_SS, 0);
1190
 
1190
 
1191
     // read MSB
1191
     // read MSB
1192
     SPDR = 0;
1192
     SPDR = 0;
1193
-    for (;(SPSR & (1<<SPIF)) == 0;);
1193
+    for (;(SPSR & BIT(SPIF)) == 0;);
1194
     max6675_temp = SPDR;
1194
     max6675_temp = SPDR;
1195
     max6675_temp <<= 8;
1195
     max6675_temp <<= 8;
1196
 
1196
 
1197
     // read LSB
1197
     // read LSB
1198
     SPDR = 0;
1198
     SPDR = 0;
1199
-    for (;(SPSR & (1<<SPIF)) == 0;);
1199
+    for (;(SPSR & BIT(SPIF)) == 0;);
1200
     max6675_temp |= SPDR;
1200
     max6675_temp |= SPDR;
1201
 
1201
 
1202
     // disable TT_MAX6675
1202
     // disable TT_MAX6675
1246
   static unsigned long raw_temp_3_value = 0;
1246
   static unsigned long raw_temp_3_value = 0;
1247
   static unsigned long raw_temp_bed_value = 0;
1247
   static unsigned long raw_temp_bed_value = 0;
1248
   static TempState temp_state = StartupDelay;
1248
   static TempState temp_state = StartupDelay;
1249
-  static unsigned char pwm_count = (1 << SOFT_PWM_SCALE);
1249
+  static unsigned char pwm_count = BIT(SOFT_PWM_SCALE);
1250
 
1250
 
1251
   // Static members for each heater
1251
   // Static members for each heater
1252
   #ifdef SLOW_PWM_HEATERS
1252
   #ifdef SLOW_PWM_HEATERS
1331
       if (soft_pwm_fan < pwm_count) WRITE_FAN(0);
1331
       if (soft_pwm_fan < pwm_count) WRITE_FAN(0);
1332
     #endif
1332
     #endif
1333
     
1333
     
1334
-    pwm_count += (1 << SOFT_PWM_SCALE);
1334
+    pwm_count += BIT(SOFT_PWM_SCALE);
1335
     pwm_count &= 0x7f;
1335
     pwm_count &= 0x7f;
1336
   
1336
   
1337
   #else // SLOW_PWM_HEATERS
1337
   #else // SLOW_PWM_HEATERS
1412
       if (soft_pwm_fan < pwm_count) WRITE_FAN(0);
1412
       if (soft_pwm_fan < pwm_count) WRITE_FAN(0);
1413
     #endif //FAN_SOFT_PWM
1413
     #endif //FAN_SOFT_PWM
1414
 
1414
 
1415
-    pwm_count += (1 << SOFT_PWM_SCALE);
1415
+    pwm_count += BIT(SOFT_PWM_SCALE);
1416
     pwm_count &= 0x7f;
1416
     pwm_count &= 0x7f;
1417
 
1417
 
1418
     // increment slow_pwm_count only every 64 pwm_count circa 65.5ms
1418
     // increment slow_pwm_count only every 64 pwm_count circa 65.5ms
1438
   
1438
   
1439
   #endif // SLOW_PWM_HEATERS
1439
   #endif // SLOW_PWM_HEATERS
1440
 
1440
 
1441
-  #define SET_ADMUX_ADCSRA(pin) ADMUX = (1 << REFS0) | (pin & 0x07); ADCSRA |= 1<<ADSC
1441
+  #define SET_ADMUX_ADCSRA(pin) ADMUX = BIT(REFS0) | (pin & 0x07); ADCSRA |= BIT(ADSC)
1442
   #ifdef MUX5
1442
   #ifdef MUX5
1443
-    #define START_ADC(pin) if (pin > 7) ADCSRB = 1 << MUX5; else ADCSRB = 0; SET_ADMUX_ADCSRA(pin)
1443
+    #define START_ADC(pin) if (pin > 7) ADCSRB = BIT(MUX5); else ADCSRB = 0; SET_ADMUX_ADCSRA(pin)
1444
   #else
1444
   #else
1445
     #define START_ADC(pin) ADCSRB = 0; SET_ADMUX_ADCSRA(pin)
1445
     #define START_ADC(pin) ADCSRB = 0; SET_ADMUX_ADCSRA(pin)
1446
   #endif
1446
   #endif

+ 2
- 2
Marlin/ultralcd.cpp Ver arquivo

1426
       WRITE(SHIFT_LD, HIGH);
1426
       WRITE(SHIFT_LD, HIGH);
1427
       for(int8_t i = 0; i < 8; i++) {
1427
       for(int8_t i = 0; i < 8; i++) {
1428
         newbutton_reprapworld_keypad >>= 1;
1428
         newbutton_reprapworld_keypad >>= 1;
1429
-        if (READ(SHIFT_OUT)) newbutton_reprapworld_keypad |= (1 << 7);
1429
+        if (READ(SHIFT_OUT)) newbutton_reprapworld_keypad |= BIT(7);
1430
         WRITE(SHIFT_CLK, HIGH);
1430
         WRITE(SHIFT_CLK, HIGH);
1431
         WRITE(SHIFT_CLK, LOW);
1431
         WRITE(SHIFT_CLK, LOW);
1432
       }
1432
       }
1439
     unsigned char tmp_buttons = 0;
1439
     unsigned char tmp_buttons = 0;
1440
     for(int8_t i=0; i<8; i++) {
1440
     for(int8_t i=0; i<8; i++) {
1441
       newbutton >>= 1;
1441
       newbutton >>= 1;
1442
-      if (READ(SHIFT_OUT)) newbutton |= (1 << 7);
1442
+      if (READ(SHIFT_OUT)) newbutton |= BIT(7);
1443
       WRITE(SHIFT_CLK, HIGH);
1443
       WRITE(SHIFT_CLK, HIGH);
1444
       WRITE(SHIFT_CLK, LOW);
1444
       WRITE(SHIFT_CLK, LOW);
1445
     }
1445
     }

+ 19
- 19
Marlin/ultralcd.h Ver arquivo

57
   void lcd_ignore_click(bool b=true);
57
   void lcd_ignore_click(bool b=true);
58
 
58
 
59
   #ifdef NEWPANEL
59
   #ifdef NEWPANEL
60
-    #define EN_C (1<<BLEN_C)
61
-    #define EN_B (1<<BLEN_B)
62
-    #define EN_A (1<<BLEN_A)
60
+    #define EN_C BIT(BLEN_C)
61
+    #define EN_B BIT(BLEN_B)
62
+    #define EN_A BIT(BLEN_A)
63
 
63
 
64
     #define LCD_CLICKED (buttons&EN_C)
64
     #define LCD_CLICKED (buttons&EN_C)
65
     #ifdef REPRAPWORLD_KEYPAD
65
     #ifdef REPRAPWORLD_KEYPAD
66
-  	  #define EN_REPRAPWORLD_KEYPAD_F3 (1<<BLEN_REPRAPWORLD_KEYPAD_F3)
67
-  	  #define EN_REPRAPWORLD_KEYPAD_F2 (1<<BLEN_REPRAPWORLD_KEYPAD_F2)
68
-  	  #define EN_REPRAPWORLD_KEYPAD_F1 (1<<BLEN_REPRAPWORLD_KEYPAD_F1)
69
-  	  #define EN_REPRAPWORLD_KEYPAD_UP (1<<BLEN_REPRAPWORLD_KEYPAD_UP)
70
-  	  #define EN_REPRAPWORLD_KEYPAD_RIGHT (1<<BLEN_REPRAPWORLD_KEYPAD_RIGHT)
71
-  	  #define EN_REPRAPWORLD_KEYPAD_MIDDLE (1<<BLEN_REPRAPWORLD_KEYPAD_MIDDLE)
72
-  	  #define EN_REPRAPWORLD_KEYPAD_DOWN (1<<BLEN_REPRAPWORLD_KEYPAD_DOWN)
73
-  	  #define EN_REPRAPWORLD_KEYPAD_LEFT (1<<BLEN_REPRAPWORLD_KEYPAD_LEFT)
66
+  	  #define EN_REPRAPWORLD_KEYPAD_F3 BIT(BLEN_REPRAPWORLD_KEYPAD_F3)
67
+  	  #define EN_REPRAPWORLD_KEYPAD_F2 BIT(BLEN_REPRAPWORLD_KEYPAD_F2)
68
+  	  #define EN_REPRAPWORLD_KEYPAD_F1 BIT(BLEN_REPRAPWORLD_KEYPAD_F1)
69
+  	  #define EN_REPRAPWORLD_KEYPAD_UP BIT(BLEN_REPRAPWORLD_KEYPAD_UP)
70
+  	  #define EN_REPRAPWORLD_KEYPAD_RIGHT BIT(BLEN_REPRAPWORLD_KEYPAD_RIGHT)
71
+  	  #define EN_REPRAPWORLD_KEYPAD_MIDDLE BIT(BLEN_REPRAPWORLD_KEYPAD_MIDDLE)
72
+  	  #define EN_REPRAPWORLD_KEYPAD_DOWN BIT(BLEN_REPRAPWORLD_KEYPAD_DOWN)
73
+  	  #define EN_REPRAPWORLD_KEYPAD_LEFT BIT(BLEN_REPRAPWORLD_KEYPAD_LEFT)
74
 
74
 
75
   	  #define LCD_CLICKED ((buttons&EN_C) || (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_F1))
75
   	  #define LCD_CLICKED ((buttons&EN_C) || (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_F1))
76
   	  #define REPRAPWORLD_KEYPAD_MOVE_Z_UP (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_F2)
76
   	  #define REPRAPWORLD_KEYPAD_MOVE_Z_UP (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_F2)
83
     #endif //REPRAPWORLD_KEYPAD
83
     #endif //REPRAPWORLD_KEYPAD
84
   #else
84
   #else
85
     //atomic, do not change
85
     //atomic, do not change
86
-    #define B_LE (1<<BL_LE)
87
-    #define B_UP (1<<BL_UP)
88
-    #define B_MI (1<<BL_MI)
89
-    #define B_DW (1<<BL_DW)
90
-    #define B_RI (1<<BL_RI)
91
-    #define B_ST (1<<BL_ST)
92
-    #define EN_B (1<<BLEN_B)
93
-    #define EN_A (1<<BLEN_A)
86
+    #define B_LE BIT(BL_LE)
87
+    #define B_UP BIT(BL_UP)
88
+    #define B_MI BIT(BL_MI)
89
+    #define B_DW BIT(BL_DW)
90
+    #define B_RI BIT(BL_RI)
91
+    #define B_ST BIT(BL_ST)
92
+    #define EN_B BIT(BLEN_B)
93
+    #define EN_A BIT(BLEN_A)
94
     
94
     
95
     #define LCD_CLICKED ((buttons&B_MI)||(buttons&B_ST))
95
     #define LCD_CLICKED ((buttons&B_MI)||(buttons&B_ST))
96
   #endif//NEWPANEL
96
   #endif//NEWPANEL

+ 17
- 17
Marlin/ultralcd_implementation_hitachi_HD44780.h Ver arquivo

24
 #define BLEN_B 1
24
 #define BLEN_B 1
25
 #define BLEN_A 0
25
 #define BLEN_A 0
26
 
26
 
27
-#define EN_B (1<<BLEN_B) // The two encoder pins are connected through BTN_EN1 and BTN_EN2
28
-#define EN_A (1<<BLEN_A)
27
+#define EN_B BIT(BLEN_B) // The two encoder pins are connected through BTN_EN1 and BTN_EN2
28
+#define EN_A BIT(BLEN_A)
29
 
29
 
30
 #if defined(BTN_ENC) && BTN_ENC > -1
30
 #if defined(BTN_ENC) && BTN_ENC > -1
31
   // encoder click is directly connected
31
   // encoder click is directly connected
32
   #define BLEN_C 2 
32
   #define BLEN_C 2 
33
-  #define EN_C (1<<BLEN_C) 
33
+  #define EN_C BIT(BLEN_C) 
34
 #endif 
34
 #endif 
35
   
35
   
36
 //
36
 //
85
     
85
     
86
     #define REPRAPWORLD_BTN_OFFSET 3 // bit offset into buttons for shift register values
86
     #define REPRAPWORLD_BTN_OFFSET 3 // bit offset into buttons for shift register values
87
 
87
 
88
-    #define EN_REPRAPWORLD_KEYPAD_F3 (1<<(BLEN_REPRAPWORLD_KEYPAD_F3+REPRAPWORLD_BTN_OFFSET))
89
-    #define EN_REPRAPWORLD_KEYPAD_F2 (1<<(BLEN_REPRAPWORLD_KEYPAD_F2+REPRAPWORLD_BTN_OFFSET))
90
-    #define EN_REPRAPWORLD_KEYPAD_F1 (1<<(BLEN_REPRAPWORLD_KEYPAD_F1+REPRAPWORLD_BTN_OFFSET))
91
-    #define EN_REPRAPWORLD_KEYPAD_UP (1<<(BLEN_REPRAPWORLD_KEYPAD_UP+REPRAPWORLD_BTN_OFFSET))
92
-    #define EN_REPRAPWORLD_KEYPAD_RIGHT (1<<(BLEN_REPRAPWORLD_KEYPAD_RIGHT+REPRAPWORLD_BTN_OFFSET))
93
-    #define EN_REPRAPWORLD_KEYPAD_MIDDLE (1<<(BLEN_REPRAPWORLD_KEYPAD_MIDDLE+REPRAPWORLD_BTN_OFFSET))
94
-    #define EN_REPRAPWORLD_KEYPAD_DOWN (1<<(BLEN_REPRAPWORLD_KEYPAD_DOWN+REPRAPWORLD_BTN_OFFSET))
95
-    #define EN_REPRAPWORLD_KEYPAD_LEFT (1<<(BLEN_REPRAPWORLD_KEYPAD_LEFT+REPRAPWORLD_BTN_OFFSET))
88
+    #define EN_REPRAPWORLD_KEYPAD_F3 BIT((BLEN_REPRAPWORLD_KEYPAD_F3+REPRAPWORLD_BTN_OFFSET))
89
+    #define EN_REPRAPWORLD_KEYPAD_F2 BIT((BLEN_REPRAPWORLD_KEYPAD_F2+REPRAPWORLD_BTN_OFFSET))
90
+    #define EN_REPRAPWORLD_KEYPAD_F1 BIT((BLEN_REPRAPWORLD_KEYPAD_F1+REPRAPWORLD_BTN_OFFSET))
91
+    #define EN_REPRAPWORLD_KEYPAD_UP BIT((BLEN_REPRAPWORLD_KEYPAD_UP+REPRAPWORLD_BTN_OFFSET))
92
+    #define EN_REPRAPWORLD_KEYPAD_RIGHT BIT((BLEN_REPRAPWORLD_KEYPAD_RIGHT+REPRAPWORLD_BTN_OFFSET))
93
+    #define EN_REPRAPWORLD_KEYPAD_MIDDLE BIT((BLEN_REPRAPWORLD_KEYPAD_MIDDLE+REPRAPWORLD_BTN_OFFSET))
94
+    #define EN_REPRAPWORLD_KEYPAD_DOWN BIT((BLEN_REPRAPWORLD_KEYPAD_DOWN+REPRAPWORLD_BTN_OFFSET))
95
+    #define EN_REPRAPWORLD_KEYPAD_LEFT BIT((BLEN_REPRAPWORLD_KEYPAD_LEFT+REPRAPWORLD_BTN_OFFSET))
96
 
96
 
97
     #define LCD_CLICKED ((buttons&EN_C) || (buttons&EN_REPRAPWORLD_KEYPAD_F1))
97
     #define LCD_CLICKED ((buttons&EN_C) || (buttons&EN_REPRAPWORLD_KEYPAD_F1))
98
     #define REPRAPWORLD_KEYPAD_MOVE_Y_DOWN (buttons&EN_REPRAPWORLD_KEYPAD_DOWN)
98
     #define REPRAPWORLD_KEYPAD_MOVE_Y_DOWN (buttons&EN_REPRAPWORLD_KEYPAD_DOWN)
113
   #define BL_ST 2
113
   #define BL_ST 2
114
 
114
 
115
   //automatic, do not change
115
   //automatic, do not change
116
-  #define B_LE (1<<BL_LE)
117
-  #define B_UP (1<<BL_UP)
118
-  #define B_MI (1<<BL_MI)
119
-  #define B_DW (1<<BL_DW)
120
-  #define B_RI (1<<BL_RI)
121
-  #define B_ST (1<<BL_ST)
116
+  #define B_LE BIT(BL_LE)
117
+  #define B_UP BIT(BL_UP)
118
+  #define B_MI BIT(BL_MI)
119
+  #define B_DW BIT(BL_DW)
120
+  #define B_RI BIT(BL_RI)
121
+  #define B_ST BIT(BL_ST)
122
   
122
   
123
   #define LCD_CLICKED (buttons&(B_MI|B_ST))
123
   #define LCD_CLICKED (buttons&(B_MI|B_ST))
124
 #endif
124
 #endif

Carregando…
Cancelar
Salvar