Browse Source

Merge pull request #2069 from thinkyhead/sd_alpha_sort

Formatting tweaks
Scott Lahteine 9 years ago
parent
commit
56126786a6

+ 1
- 2
Marlin/Configuration.h View File

@@ -605,10 +605,9 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
605 605
 
606 606
 #ifdef EEPROM_SETTINGS
607 607
   // To disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out:
608
-  #define EEPROM_CHITCHAT // please keep turned on if you can.
608
+  #define EEPROM_CHITCHAT // Please keep turned on if you can.
609 609
 #endif
610 610
 
611
-
612 611
 // @section temperature
613 612
 
614 613
 // Preheat Constants

+ 1
- 1
Marlin/Marlin_main.cpp View File

@@ -5982,7 +5982,7 @@ void calculate_SCARA_forward_Transform(float f_scara[3])
5982 5982
   
5983 5983
     delta[X_AXIS] = x_cos + y_cos + SCARA_offset_x;  //theta
5984 5984
     delta[Y_AXIS] = x_sin + y_sin + SCARA_offset_y;  //theta+phi
5985
-  
5985
+
5986 5986
     //SERIAL_ECHOPGM(" delta[X_AXIS]="); SERIAL_ECHO(delta[X_AXIS]);
5987 5987
     //SERIAL_ECHOPGM(" delta[Y_AXIS]="); SERIAL_ECHOLN(delta[Y_AXIS]);
5988 5988
 }  

+ 1
- 0
Marlin/cardreader.cpp View File

@@ -20,6 +20,7 @@ CardReader::CardReader() {
20 20
 
21 21
   autostart_stilltocheck = true; //the SD start is delayed, because otherwise the serial cannot answer fast enough to make contact with the host software.
22 22
   autostart_index = 0;
23
+
23 24
   //power to SD reader
24 25
   #if SDPOWER > -1
25 26
     OUT_WRITE(SDPOWER, HIGH);

+ 6
- 5
Marlin/temperature.cpp View File

@@ -245,8 +245,8 @@ void PID_autotune(float temp, int extruder, int ncycles)
245 245
         }
246 246
       #endif
247 247
 
248
-      if (heating == true && input > temp) {
249
-        if (ms - t2 > 5000) {
248
+      if (heating && input > temp) {
249
+        if (ms > t2 + 5000) {
250 250
           heating = false;
251 251
           if (extruder < 0)
252 252
             soft_pwm_bed = (bias - d) >> 1;
@@ -257,8 +257,9 @@ void PID_autotune(float temp, int extruder, int ncycles)
257 257
           max = temp;
258 258
         }
259 259
       }
260
-      if (heating == false && input < temp) {
261
-        if (ms - t1 > 5000) {
260
+
261
+      if (!heating && input < temp) {
262
+        if (ms > t1 + 5000) {
262 263
           heating = true;
263 264
           t2 = ms;
264 265
           t_low = t2 - t1;
@@ -787,7 +788,7 @@ static void updateTemperaturesFromRawValues() {
787 788
   #ifdef HEATER_0_USES_MAX6675
788 789
     current_temperature_raw[0] = read_max6675();
789 790
   #endif
790
-  for(uint8_t e = 0; e < EXTRUDERS; e++) {
791
+  for (uint8_t e = 0; e < EXTRUDERS; e++) {
791 792
     current_temperature[e] = analog2temp(current_temperature_raw[e], e);
792 793
   }
793 794
   current_temperature_bed = analog2tempBed(current_temperature_bed_raw);

+ 49
- 58
Marlin/ultralcd_implementation_hitachi_HD44780.h View File

@@ -15,8 +15,8 @@
15 15
 ////////////////////////////////////
16 16
 // Setup button and encode mappings for each panel (into 'buttons' variable
17 17
 //
18
-// This is just to map common functions (across different panels) onto the same 
19
-// macro name. The mapping is independent of whether the button is directly connected or 
18
+// This is just to map common functions (across different panels) onto the same
19
+// macro name. The mapping is independent of whether the button is directly connected or
20 20
 // via a shift/i2c register.
21 21
 
22 22
 #ifdef ULTIPANEL
@@ -38,7 +38,7 @@
38 38
 //
39 39
 #if defined(LCD_I2C_VIKI)
40 40
   #define B_I2C_BTN_OFFSET 3 // (the first three bit positions reserved for EN_A, EN_B, EN_C)
41
-  
41
+
42 42
   // button and encoder bit positions within 'buttons'
43 43
   #define B_LE (BUTTON_LEFT<<B_I2C_BTN_OFFSET)    // The remaining normalized buttons are all read via I2C
44 44
   #define B_UP (BUTTON_UP<<B_I2C_BTN_OFFSET)
@@ -46,22 +46,22 @@
46 46
   #define B_DW (BUTTON_DOWN<<B_I2C_BTN_OFFSET)
47 47
   #define B_RI (BUTTON_RIGHT<<B_I2C_BTN_OFFSET)
48 48
 
49
-  #if defined(BTN_ENC) && BTN_ENC > -1 
49
+  #if defined(BTN_ENC) && BTN_ENC > -1
50 50
     // the pause/stop/restart button is connected to BTN_ENC when used
51
-    #define B_ST (EN_C)                            // Map the pause/stop/resume button into its normalized functional name 
51
+    #define B_ST (EN_C)                            // Map the pause/stop/resume button into its normalized functional name
52 52
     #define LCD_CLICKED (buttons&(B_MI|B_RI|B_ST)) // pause/stop button also acts as click until we implement proper pause/stop.
53 53
   #else
54 54
     #define LCD_CLICKED (buttons&(B_MI|B_RI))
55
-  #endif  
55
+  #endif
56 56
 
57 57
   // I2C buttons take too long to read inside an interrupt context and so we read them during lcd_update
58 58
   #define LCD_HAS_SLOW_BUTTONS
59 59
 
60 60
 #elif defined(LCD_I2C_PANELOLU2)
61 61
   // encoder click can be read through I2C if not directly connected
62
-  #if BTN_ENC <= 0 
62
+  #if BTN_ENC <= 0
63 63
     #define B_I2C_BTN_OFFSET 3 // (the first three bit positions reserved for EN_A, EN_B, EN_C)
64
-  
64
+
65 65
     #define B_MI (PANELOLU2_ENCODER_C<<B_I2C_BTN_OFFSET) // requires LiquidTWI2 library v1.2.3 or later
66 66
 
67 67
     #define LCD_CLICKED (buttons&B_MI)
@@ -69,7 +69,7 @@
69 69
     // I2C buttons take too long to read inside an interrupt context and so we read them during lcd_update
70 70
     #define LCD_HAS_SLOW_BUTTONS
71 71
   #else
72
-    #define LCD_CLICKED (buttons&EN_C)  
72
+    #define LCD_CLICKED (buttons&EN_C)
73 73
   #endif
74 74
 
75 75
 #elif defined(REPRAPWORLD_KEYPAD)
@@ -101,7 +101,7 @@
101 101
 
102 102
 #elif defined(NEWPANEL)
103 103
   #define LCD_CLICKED (buttons&EN_C)
104
-  
104
+
105 105
 #else // old style ULTIPANEL
106 106
   //bits in the shift register that carry the buttons for:
107 107
   // left up center down right red(stop)
@@ -143,7 +143,7 @@
143 143
   #include <LiquidCrystal_I2C.h>
144 144
   #define LCD_CLASS LiquidCrystal_I2C
145 145
   LCD_CLASS lcd(LCD_I2C_ADDRESS,LCD_I2C_PIN_EN,LCD_I2C_PIN_RW,LCD_I2C_PIN_RS,LCD_I2C_PIN_D4,LCD_I2C_PIN_D5,LCD_I2C_PIN_D6,LCD_I2C_PIN_D7);
146
-  
146
+
147 147
 #elif defined(LCD_I2C_TYPE_MCP23017)
148 148
   //for the LED indicators (which maybe mapped to different things in lcd_implementation_update_indicators())
149 149
   #define LED_A 0x04 //100
@@ -156,28 +156,28 @@
156 156
   #include <LiquidTWI2.h>
157 157
   #define LCD_CLASS LiquidTWI2
158 158
   #if defined(DETECT_DEVICE)
159
-     LCD_CLASS lcd(LCD_I2C_ADDRESS, 1);
159
+    LCD_CLASS lcd(LCD_I2C_ADDRESS, 1);
160 160
   #else
161
-     LCD_CLASS lcd(LCD_I2C_ADDRESS);
161
+    LCD_CLASS lcd(LCD_I2C_ADDRESS);
162 162
   #endif
163
-  
163
+
164 164
 #elif defined(LCD_I2C_TYPE_MCP23008)
165 165
   #include <Wire.h>
166 166
   #include <LiquidTWI2.h>
167 167
   #define LCD_CLASS LiquidTWI2
168 168
   #if defined(DETECT_DEVICE)
169
-     LCD_CLASS lcd(LCD_I2C_ADDRESS, 1);
169
+    LCD_CLASS lcd(LCD_I2C_ADDRESS, 1);
170 170
   #else
171
-     LCD_CLASS lcd(LCD_I2C_ADDRESS);
171
+    LCD_CLASS lcd(LCD_I2C_ADDRESS);
172 172
   #endif
173 173
 
174 174
 #elif defined(LCD_I2C_TYPE_PCA8574)
175 175
     #include <LiquidCrystal_I2C.h>
176 176
     #define LCD_CLASS LiquidCrystal_I2C
177 177
     LCD_CLASS lcd(LCD_I2C_ADDRESS, LCD_WIDTH, LCD_HEIGHT);
178
-    
178
+
179 179
 // 2 wire Non-latching LCD SR from:
180
-// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection 
180
+// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection
181 181
 #elif defined(SR_LCD_2W_NL)
182 182
   extern "C" void __cxa_pure_virtual() { while (1); }
183 183
   #include <LCD.h>
@@ -353,65 +353,56 @@ static void lcd_implementation_init(
353 353
   #endif
354 354
 ) {
355 355
 
356
-#if defined(LCD_I2C_TYPE_PCF8575)
356
+  #if defined(LCD_I2C_TYPE_PCF8575)
357 357
     lcd.begin(LCD_WIDTH, LCD_HEIGHT);
358
-  #ifdef LCD_I2C_PIN_BL
359
-    lcd.setBacklightPin(LCD_I2C_PIN_BL,POSITIVE);
360
-    lcd.setBacklight(HIGH);
361
-  #endif
362
-  
363
-#elif defined(LCD_I2C_TYPE_MCP23017)
358
+    #ifdef LCD_I2C_PIN_BL
359
+      lcd.setBacklightPin(LCD_I2C_PIN_BL, POSITIVE);
360
+      lcd.setBacklight(HIGH);
361
+    #endif
362
+
363
+  #elif defined(LCD_I2C_TYPE_MCP23017)
364 364
     lcd.setMCPType(LTI_TYPE_MCP23017);
365 365
     lcd.begin(LCD_WIDTH, LCD_HEIGHT);
366 366
     lcd.setBacklight(0); //set all the LEDs off to begin with
367
-    
368
-#elif defined(LCD_I2C_TYPE_MCP23008)
367
+
368
+  #elif defined(LCD_I2C_TYPE_MCP23008)
369 369
     lcd.setMCPType(LTI_TYPE_MCP23008);
370 370
     lcd.begin(LCD_WIDTH, LCD_HEIGHT);
371 371
 
372
-#elif defined(LCD_I2C_TYPE_PCA8574)
373
-      lcd.init();
374
-      lcd.backlight();
375
-    
376
-#else
372
+  #elif defined(LCD_I2C_TYPE_PCA8574)
373
+    lcd.init();
374
+    lcd.backlight();
375
+
376
+  #else
377 377
     lcd.begin(LCD_WIDTH, LCD_HEIGHT);
378
-#endif
378
+  #endif
379 379
 
380
-    lcd_set_custom_characters(
381
-        #ifdef LCD_PROGRESS_BAR
382
-            progress_bar_set
383
-        #endif
384
-    );
380
+  lcd_set_custom_characters(
381
+    #ifdef LCD_PROGRESS_BAR
382
+      progress_bar_set
383
+    #endif
384
+  );
385 385
 
386
-    lcd.clear();
387
-}
388
-static void lcd_implementation_clear()
389
-{
390
-    lcd.clear();
386
+  lcd.clear();
391 387
 }
392 388
 
389
+static void lcd_implementation_clear() { lcd.clear(); }
390
+
393 391
 /* Arduino < 1.0.0 is missing a function to print PROGMEM strings, so we need to implement our own */
394 392
 char lcd_printPGM(const char* str) {
395
-  char c;
396
-  char n = 0;
397
-  while((c = pgm_read_byte(str++))) {
398
-      n += charset_mapper(c);
399
-  }
393
+  char c, n = 0;
394
+  while ((c = pgm_read_byte(str++))) n += charset_mapper(c);
400 395
   return n;
401 396
 }
402 397
 
403 398
 char lcd_print(char* str) {
404 399
   char c, n = 0;;
405 400
   unsigned char i = 0;
406
-  while((c = str[i++])) {
407
-      n += charset_mapper(c);
408
-  }
401
+  while ((c = str[i++])) n += charset_mapper(c);
409 402
   return n;
410 403
 }
411 404
 
412
-unsigned lcd_print(char c) {
413
-    return charset_mapper(c);
414
-}
405
+unsigned lcd_print(char c) { return charset_mapper(c); }
415 406
 
416 407
 /*
417 408
 Possible status screens:
@@ -437,7 +428,7 @@ Possible status screens:
437 428
 
438 429
 20x4   |01234567890123456789|
439 430
        |T000/000D B000/000D |
440
-       |T000/000D     Z000.0|
431
+       |T000/000D   Z000.00 |
441 432
        |F100%  SD100% T--:--|
442 433
        |Status line.........|
443 434
 */
@@ -728,13 +719,13 @@ static void lcd_implementation_drawmenu_sddirectory(bool sel, uint8_t row, const
728 719
 
729 720
   static void lcd_implementation_update_indicators() {
730 721
     #if defined(LCD_I2C_PANELOLU2) || defined(LCD_I2C_VIKI)
731
-      //set the LEDS - referred to as backlights by the LiquidTWI2 library 
722
+      // Set the LEDS - referred to as backlights by the LiquidTWI2 library
732 723
       static uint8_t ledsprev = 0;
733 724
       uint8_t leds = 0;
734 725
       if (target_temperature_bed > 0) leds |= LED_A;
735 726
       if (target_temperature[0] > 0) leds |= LED_B;
736 727
       if (fanSpeed) leds |= LED_C;
737
-      #if EXTRUDERS > 1  
728
+      #if EXTRUDERS > 1
738 729
         if (target_temperature[1] > 0) leds |= LED_C;
739 730
       #endif
740 731
       if (leds != ledsprev) {
@@ -766,4 +757,4 @@ static void lcd_implementation_drawmenu_sddirectory(bool sel, uint8_t row, const
766 757
 
767 758
 #endif // LCD_HAS_SLOW_BUTTONS
768 759
 
769
-#endif //__ULTRALCD_IMPLEMENTATION_HITACHI_HD44780_H
760
+#endif // ULTRALCD_IMPLEMENTATION_HITACHI_HD44780_H

Loading…
Cancel
Save