Browse Source

Drop 'register' storage specifier

Scott Lahteine 6 years ago
parent
commit
e0956bb572

+ 5
- 5
Marlin/src/HAL/HAL_AVR/math_AVR.h View File

@@ -36,9 +36,9 @@
36 36
 // D C B A is longIn2
37 37
 //
38 38
 static FORCE_INLINE uint16_t MultiU24X32toH16(uint32_t longIn1, uint32_t longIn2) {
39
-  register uint8_t tmp1;
40
-  register uint8_t tmp2;
41
-  register uint16_t intRes;
39
+  uint8_t tmp1;
40
+  uint8_t tmp2;
41
+  uint16_t intRes;
42 42
   __asm__ __volatile__(
43 43
     A("clr %[tmp1]")
44 44
     A("mul %A[longIn1], %B[longIn2]")
@@ -90,8 +90,8 @@ static FORCE_INLINE uint16_t MultiU24X32toH16(uint32_t longIn1, uint32_t longIn2
90 90
 // r26 to store 0
91 91
 // r27 to store the byte 1 of the 24 bit result
92 92
 static FORCE_INLINE uint16_t MultiU16X8toH16(uint8_t charIn1, uint16_t intIn2) {
93
-  register uint8_t tmp;
94
-  register uint16_t intRes;
93
+  uint8_t tmp;
94
+  uint16_t intRes;
95 95
   __asm__ __volatile__ (
96 96
     A("clr %[tmp]")
97 97
     A("mul %[charIn1], %B[intIn2]")

+ 21
- 21
Marlin/src/HAL/HAL_DUE/HAL_spi_Due.cpp View File

@@ -78,11 +78,11 @@
78 78
 
79 79
   // run at ~8 .. ~10Mhz - Tx version (Rx data discarded)
80 80
   static uint8_t spiTransferTx0(uint8_t bout) { // using Mode 0
81
-    register uint32_t MOSI_PORT_PLUS30 = ((uint32_t) PORT(MOSI_PIN)) + 0x30;  /* SODR of port */
82
-    register uint32_t MOSI_MASK = PIN_MASK(MOSI_PIN);
83
-    register uint32_t SCK_PORT_PLUS30 = ((uint32_t) PORT(SCK_PIN)) + 0x30;    /* SODR of port */
84
-    register uint32_t SCK_MASK = PIN_MASK(SCK_PIN);
85
-    register uint32_t idx = 0;
81
+    uint32_t MOSI_PORT_PLUS30 = ((uint32_t) PORT(MOSI_PIN)) + 0x30;  /* SODR of port */
82
+    uint32_t MOSI_MASK = PIN_MASK(MOSI_PIN);
83
+    uint32_t SCK_PORT_PLUS30 = ((uint32_t) PORT(SCK_PIN)) + 0x30;    /* SODR of port */
84
+    uint32_t SCK_MASK = PIN_MASK(SCK_PIN);
85
+    uint32_t idx = 0;
86 86
 
87 87
     /* Negate bout, as the assembler requires a negated value */
88 88
     bout = ~bout;
@@ -161,11 +161,11 @@
161 161
 
162 162
   // run at ~8 .. ~10Mhz - Rx version (Tx line not altered)
163 163
   static uint8_t spiTransferRx0(uint8_t bout) { // using Mode 0
164
-    register uint32_t bin = 0;
165
-    register uint32_t work = 0;
166
-    register uint32_t BITBAND_MISO_PORT = BITBAND_ADDRESS( ((uint32_t)PORT(MISO_PIN))+0x3C, PIN_SHIFT(MISO_PIN));  /* PDSR of port in bitband area */
167
-    register uint32_t SCK_PORT_PLUS30 = ((uint32_t) PORT(SCK_PIN)) + 0x30;    /* SODR of port */
168
-    register uint32_t SCK_MASK = PIN_MASK(SCK_PIN);
164
+    uint32_t bin = 0;
165
+    uint32_t work = 0;
166
+    uint32_t BITBAND_MISO_PORT = BITBAND_ADDRESS( ((uint32_t)PORT(MISO_PIN))+0x3C, PIN_SHIFT(MISO_PIN));  /* PDSR of port in bitband area */
167
+    uint32_t SCK_PORT_PLUS30 = ((uint32_t) PORT(SCK_PIN)) + 0x30;    /* SODR of port */
168
+    uint32_t SCK_MASK = PIN_MASK(SCK_PIN);
169 169
     UNUSED(bout);
170 170
 
171 171
     /* The software SPI routine */
@@ -281,12 +281,12 @@
281 281
 
282 282
   // Block transfers run at ~8 .. ~10Mhz - Tx version (Rx data discarded)
283 283
   static void spiTxBlock0(const uint8_t* ptr, uint32_t todo) {
284
-    register uint32_t MOSI_PORT_PLUS30 = ((uint32_t) PORT(MOSI_PIN)) + 0x30;  /* SODR of port */
285
-    register uint32_t MOSI_MASK = PIN_MASK(MOSI_PIN);
286
-    register uint32_t SCK_PORT_PLUS30 = ((uint32_t) PORT(SCK_PIN)) + 0x30;    /* SODR of port */
287
-    register uint32_t SCK_MASK = PIN_MASK(SCK_PIN);
288
-    register uint32_t work = 0;
289
-    register uint32_t txval = 0;
284
+    uint32_t MOSI_PORT_PLUS30 = ((uint32_t) PORT(MOSI_PIN)) + 0x30;  /* SODR of port */
285
+    uint32_t MOSI_MASK = PIN_MASK(MOSI_PIN);
286
+    uint32_t SCK_PORT_PLUS30 = ((uint32_t) PORT(SCK_PIN)) + 0x30;    /* SODR of port */
287
+    uint32_t SCK_MASK = PIN_MASK(SCK_PIN);
288
+    uint32_t work = 0;
289
+    uint32_t txval = 0;
290 290
 
291 291
     /* The software SPI routine */
292 292
     __asm__ __volatile__(
@@ -360,11 +360,11 @@
360 360
   }
361 361
 
362 362
   static void spiRxBlock0(uint8_t* ptr, uint32_t todo) {
363
-    register uint32_t bin = 0;
364
-    register uint32_t work = 0;
365
-    register uint32_t BITBAND_MISO_PORT = BITBAND_ADDRESS( ((uint32_t)PORT(MISO_PIN))+0x3C, PIN_SHIFT(MISO_PIN));  /* PDSR of port in bitband area */
366
-    register uint32_t SCK_PORT_PLUS30 = ((uint32_t) PORT(SCK_PIN)) + 0x30;    /* SODR of port */
367
-    register uint32_t SCK_MASK = PIN_MASK(SCK_PIN);
363
+    uint32_t bin = 0;
364
+    uint32_t work = 0;
365
+    uint32_t BITBAND_MISO_PORT = BITBAND_ADDRESS( ((uint32_t)PORT(MISO_PIN))+0x3C, PIN_SHIFT(MISO_PIN));  /* PDSR of port in bitband area */
366
+    uint32_t SCK_PORT_PLUS30 = ((uint32_t) PORT(SCK_PIN)) + 0x30;    /* SODR of port */
367
+    uint32_t SCK_MASK = PIN_MASK(SCK_PIN);
368 368
 
369 369
     /* The software SPI routine */
370 370
     __asm__ __volatile__(

+ 2
- 2
Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_ssd_hw_i2c.cpp View File

@@ -156,7 +156,7 @@ uint8_t u8g_com_HAL_LPC1768_ssd_hw_i2c_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_v
156 156
          return 0;
157 157
         }
158 158
 
159
-        register uint8_t *ptr = (uint8_t *)arg_ptr;
159
+        uint8_t *ptr = (uint8_t *)arg_ptr;
160 160
         while (arg_val > 0) {
161 161
           if (u8g_i2c_send_byte(*ptr++) == 0) {
162 162
             u8g_i2c_stop();
@@ -175,7 +175,7 @@ uint8_t u8g_com_HAL_LPC1768_ssd_hw_i2c_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_v
175 175
           return 0;
176 176
         }
177 177
 
178
-        register uint8_t *ptr = (uint8_t *)arg_ptr;
178
+        uint8_t *ptr = (uint8_t *)arg_ptr;
179 179
         while (arg_val > 0) {
180 180
           if (u8g_i2c_send_byte(u8g_pgm_read(ptr)) == 0)
181 181
             return 0;

+ 2
- 2
Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_ssd_sw_i2c.cpp under construction View File

@@ -214,7 +214,7 @@ uint8_t u8g_com_HAL_LPC1768_ssd_sw_i2c_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_v
214 214
       if (u8g_com_ssd_I2C_start_sequence_sw(u8g) == 0)
215 215
         return u8g_i2c_stop_sw(), 0;
216 216
 
217
-        register uint8_t *ptr = (uint8_t *)arg_ptr;
217
+        uint8_t *ptr = (uint8_t *)arg_ptr;
218 218
         while (arg_val > 0) {
219 219
           if (u8g_i2c_send_byte_sw(*ptr++) == 0)
220 220
             return u8g_i2c_stop_sw(), 0;
@@ -229,7 +229,7 @@ uint8_t u8g_com_HAL_LPC1768_ssd_sw_i2c_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_v
229 229
       if (u8g_com_ssd_I2C_start_sequence_sw(u8g) == 0)
230 230
         return u8g_i2c_stop_sw(), 0;
231 231
 
232
-        register uint8_t *ptr = (uint8_t *)arg_ptr;
232
+        uint8_t *ptr = (uint8_t *)arg_ptr;
233 233
         while (arg_val > 0) {
234 234
           if (u8g_i2c_send_byte_sw(u8g_pgm_read(ptr)) == 0) return 0;
235 235
           ptr++;

+ 5
- 5
Marlin/src/module/planner.cpp View File

@@ -355,11 +355,11 @@ void Planner::init() {
355 355
       // For small divisors, it is best to directly retrieve the results
356 356
       if (d <= 110) return pgm_read_dword(&small_inv_tab[d]);
357 357
 
358
-      register uint8_t r8 = d & 0xFF,
359
-                       r9 = (d >> 8) & 0xFF,
360
-                       r10 = (d >> 16) & 0xFF,
361
-                       r2,r3,r4,r5,r6,r7,r11,r12,r13,r14,r15,r16,r17,r18;
362
-      register const uint8_t* ptab = inv_tab;
358
+      uint8_t r8 = d & 0xFF,
359
+              r9 = (d >> 8) & 0xFF,
360
+              r10 = (d >> 16) & 0xFF,
361
+              r2,r3,r4,r5,r6,r7,r11,r12,r13,r14,r15,r16,r17,r18;
362
+      const uint8_t* ptab = inv_tab;
363 363
 
364 364
       __asm__ __volatile__(
365 365
         // %8:%7:%6 = interval

+ 28
- 28
Marlin/src/module/stepper.cpp View File

@@ -498,14 +498,14 @@ void Stepper::set_directions() {
498 498
    *        rhi = int32_t((mul >> 32) & 0xFFFFFFFF);
499 499
    *      }
500 500
    *      int32_t _eval_bezier_curve_arm(uint32_t curr_step) {
501
-   *        register uint32_t flo = 0;
502
-   *        register uint32_t fhi = bezier_AV * curr_step;
503
-   *        register uint32_t t = fhi;
504
-   *        register int32_t alo = bezier_F;
505
-   *        register int32_t ahi = 0;
506
-   *        register int32_t A = bezier_A;
507
-   *        register int32_t B = bezier_B;
508
-   *        register int32_t C = bezier_C;
501
+   *        uint32_t flo = 0;
502
+   *        uint32_t fhi = bezier_AV * curr_step;
503
+   *        uint32_t t = fhi;
504
+   *        int32_t alo = bezier_F;
505
+   *        int32_t ahi = 0;
506
+   *        int32_t A = bezier_A;
507
+   *        int32_t B = bezier_B;
508
+   *        int32_t C = bezier_C;
509 509
    *
510 510
    *        lsrs(ahi, alo, 1);          // a  = F << 31
511 511
    *        lsls(alo, alo, 31);         //
@@ -630,13 +630,13 @@ void Stepper::set_directions() {
630 630
       bezier_AV = av;
631 631
 
632 632
       // Calculate the rest of the coefficients
633
-      register uint8_t r2 = v0 & 0xFF;
634
-      register uint8_t r3 = (v0 >> 8) & 0xFF;
635
-      register uint8_t r12 = (v0 >> 16) & 0xFF;
636
-      register uint8_t r5 = v1 & 0xFF;
637
-      register uint8_t r6 = (v1 >> 8) & 0xFF;
638
-      register uint8_t r7 = (v1 >> 16) & 0xFF;
639
-      register uint8_t r4,r8,r9,r10,r11;
633
+      uint8_t r2 = v0 & 0xFF;
634
+      uint8_t r3 = (v0 >> 8) & 0xFF;
635
+      uint8_t r12 = (v0 >> 16) & 0xFF;
636
+      uint8_t r5 = v1 & 0xFF;
637
+      uint8_t r6 = (v1 >> 8) & 0xFF;
638
+      uint8_t r7 = (v1 >> 16) & 0xFF;
639
+      uint8_t r4,r8,r9,r10,r11;
640 640
 
641 641
       __asm__ __volatile__(
642 642
         /* Calculate the Bézier coefficients */
@@ -732,11 +732,11 @@ void Stepper::set_directions() {
732 732
       if (!curr_step)
733 733
         return bezier_F;
734 734
 
735
-      register uint8_t r0 = 0; /* Zero register */
736
-      register uint8_t r2 = (curr_step) & 0xFF;
737
-      register uint8_t r3 = (curr_step >> 8) & 0xFF;
738
-      register uint8_t r4 = (curr_step >> 16) & 0xFF;
739
-      register uint8_t r1,r5,r6,r7,r8,r9,r10,r11; /* Temporary registers */
735
+      uint8_t r0 = 0; /* Zero register */
736
+      uint8_t r2 = (curr_step) & 0xFF;
737
+      uint8_t r3 = (curr_step >> 8) & 0xFF;
738
+      uint8_t r4 = (curr_step >> 16) & 0xFF;
739
+      uint8_t r1,r5,r6,r7,r8,r9,r10,r11; /* Temporary registers */
740 740
 
741 741
       __asm__ __volatile(
742 742
         /* umul24x24to16hi(t, bezier_AV, curr_step);  t: Range 0 - 1^16 = 16 bits*/
@@ -1127,14 +1127,14 @@ void Stepper::set_directions() {
1127 1127
       #if defined(__ARM__) || defined(__thumb__)
1128 1128
 
1129 1129
         // For ARM Cortex M3/M4 CPUs, we have the optimized assembler version, that takes 43 cycles to execute
1130
-        register uint32_t flo = 0;
1131
-        register uint32_t fhi = bezier_AV * curr_step;
1132
-        register uint32_t t = fhi;
1133
-        register int32_t alo = bezier_F;
1134
-        register int32_t ahi = 0;
1135
-        register int32_t A = bezier_A;
1136
-        register int32_t B = bezier_B;
1137
-        register int32_t C = bezier_C;
1130
+        uint32_t flo = 0;
1131
+        uint32_t fhi = bezier_AV * curr_step;
1132
+        uint32_t t = fhi;
1133
+        int32_t alo = bezier_F;
1134
+        int32_t ahi = 0;
1135
+        int32_t A = bezier_A;
1136
+        int32_t B = bezier_B;
1137
+        int32_t C = bezier_C;
1138 1138
 
1139 1139
          __asm__ __volatile__(
1140 1140
           ".syntax unified" "\n\t"              // is to prevent CM0,CM1 non-unified syntax

Loading…
Cancel
Save