Browse Source

Merge pull request #2069 from thinkyhead/sd_alpha_sort

Formatting tweaks
Scott Lahteine 10 years ago
parent
commit
56126786a6

+ 1
- 2
Marlin/Configuration.h View File

605
 
605
 
606
 #ifdef EEPROM_SETTINGS
606
 #ifdef EEPROM_SETTINGS
607
   // To disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out:
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
 #endif
609
 #endif
610
 
610
 
611
-
612
 // @section temperature
611
 // @section temperature
613
 
612
 
614
 // Preheat Constants
613
 // Preheat Constants

+ 1
- 1
Marlin/Marlin_main.cpp View File

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

+ 1
- 0
Marlin/cardreader.cpp View File

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

+ 6
- 5
Marlin/temperature.cpp View File

245
         }
245
         }
246
       #endif
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
           heating = false;
250
           heating = false;
251
           if (extruder < 0)
251
           if (extruder < 0)
252
             soft_pwm_bed = (bias - d) >> 1;
252
             soft_pwm_bed = (bias - d) >> 1;
257
           max = temp;
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
           heating = true;
263
           heating = true;
263
           t2 = ms;
264
           t2 = ms;
264
           t_low = t2 - t1;
265
           t_low = t2 - t1;
787
   #ifdef HEATER_0_USES_MAX6675
788
   #ifdef HEATER_0_USES_MAX6675
788
     current_temperature_raw[0] = read_max6675();
789
     current_temperature_raw[0] = read_max6675();
789
   #endif
790
   #endif
790
-  for(uint8_t e = 0; e < EXTRUDERS; e++) {
791
+  for (uint8_t e = 0; e < EXTRUDERS; e++) {
791
     current_temperature[e] = analog2temp(current_temperature_raw[e], e);
792
     current_temperature[e] = analog2temp(current_temperature_raw[e], e);
792
   }
793
   }
793
   current_temperature_bed = analog2tempBed(current_temperature_bed_raw);
794
   current_temperature_bed = analog2tempBed(current_temperature_bed_raw);

+ 49
- 58
Marlin/ultralcd_implementation_hitachi_HD44780.h View File

15
 ////////////////////////////////////
15
 ////////////////////////////////////
16
 // Setup button and encode mappings for each panel (into 'buttons' variable
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
 // via a shift/i2c register.
20
 // via a shift/i2c register.
21
 
21
 
22
 #ifdef ULTIPANEL
22
 #ifdef ULTIPANEL
38
 //
38
 //
39
 #if defined(LCD_I2C_VIKI)
39
 #if defined(LCD_I2C_VIKI)
40
   #define B_I2C_BTN_OFFSET 3 // (the first three bit positions reserved for EN_A, EN_B, EN_C)
40
   #define B_I2C_BTN_OFFSET 3 // (the first three bit positions reserved for EN_A, EN_B, EN_C)
41
-  
41
+
42
   // button and encoder bit positions within 'buttons'
42
   // button and encoder bit positions within 'buttons'
43
   #define B_LE (BUTTON_LEFT<<B_I2C_BTN_OFFSET)    // The remaining normalized buttons are all read via I2C
43
   #define B_LE (BUTTON_LEFT<<B_I2C_BTN_OFFSET)    // The remaining normalized buttons are all read via I2C
44
   #define B_UP (BUTTON_UP<<B_I2C_BTN_OFFSET)
44
   #define B_UP (BUTTON_UP<<B_I2C_BTN_OFFSET)
46
   #define B_DW (BUTTON_DOWN<<B_I2C_BTN_OFFSET)
46
   #define B_DW (BUTTON_DOWN<<B_I2C_BTN_OFFSET)
47
   #define B_RI (BUTTON_RIGHT<<B_I2C_BTN_OFFSET)
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
     // the pause/stop/restart button is connected to BTN_ENC when used
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
     #define LCD_CLICKED (buttons&(B_MI|B_RI|B_ST)) // pause/stop button also acts as click until we implement proper pause/stop.
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
   #else
53
   #else
54
     #define LCD_CLICKED (buttons&(B_MI|B_RI))
54
     #define LCD_CLICKED (buttons&(B_MI|B_RI))
55
-  #endif  
55
+  #endif
56
 
56
 
57
   // I2C buttons take too long to read inside an interrupt context and so we read them during lcd_update
57
   // I2C buttons take too long to read inside an interrupt context and so we read them during lcd_update
58
   #define LCD_HAS_SLOW_BUTTONS
58
   #define LCD_HAS_SLOW_BUTTONS
59
 
59
 
60
 #elif defined(LCD_I2C_PANELOLU2)
60
 #elif defined(LCD_I2C_PANELOLU2)
61
   // encoder click can be read through I2C if not directly connected
61
   // encoder click can be read through I2C if not directly connected
62
-  #if BTN_ENC <= 0 
62
+  #if BTN_ENC <= 0
63
     #define B_I2C_BTN_OFFSET 3 // (the first three bit positions reserved for EN_A, EN_B, EN_C)
63
     #define B_I2C_BTN_OFFSET 3 // (the first three bit positions reserved for EN_A, EN_B, EN_C)
64
-  
64
+
65
     #define B_MI (PANELOLU2_ENCODER_C<<B_I2C_BTN_OFFSET) // requires LiquidTWI2 library v1.2.3 or later
65
     #define B_MI (PANELOLU2_ENCODER_C<<B_I2C_BTN_OFFSET) // requires LiquidTWI2 library v1.2.3 or later
66
 
66
 
67
     #define LCD_CLICKED (buttons&B_MI)
67
     #define LCD_CLICKED (buttons&B_MI)
69
     // I2C buttons take too long to read inside an interrupt context and so we read them during lcd_update
69
     // I2C buttons take too long to read inside an interrupt context and so we read them during lcd_update
70
     #define LCD_HAS_SLOW_BUTTONS
70
     #define LCD_HAS_SLOW_BUTTONS
71
   #else
71
   #else
72
-    #define LCD_CLICKED (buttons&EN_C)  
72
+    #define LCD_CLICKED (buttons&EN_C)
73
   #endif
73
   #endif
74
 
74
 
75
 #elif defined(REPRAPWORLD_KEYPAD)
75
 #elif defined(REPRAPWORLD_KEYPAD)
101
 
101
 
102
 #elif defined(NEWPANEL)
102
 #elif defined(NEWPANEL)
103
   #define LCD_CLICKED (buttons&EN_C)
103
   #define LCD_CLICKED (buttons&EN_C)
104
-  
104
+
105
 #else // old style ULTIPANEL
105
 #else // old style ULTIPANEL
106
   //bits in the shift register that carry the buttons for:
106
   //bits in the shift register that carry the buttons for:
107
   // left up center down right red(stop)
107
   // left up center down right red(stop)
143
   #include <LiquidCrystal_I2C.h>
143
   #include <LiquidCrystal_I2C.h>
144
   #define LCD_CLASS LiquidCrystal_I2C
144
   #define LCD_CLASS LiquidCrystal_I2C
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);
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
 #elif defined(LCD_I2C_TYPE_MCP23017)
147
 #elif defined(LCD_I2C_TYPE_MCP23017)
148
   //for the LED indicators (which maybe mapped to different things in lcd_implementation_update_indicators())
148
   //for the LED indicators (which maybe mapped to different things in lcd_implementation_update_indicators())
149
   #define LED_A 0x04 //100
149
   #define LED_A 0x04 //100
156
   #include <LiquidTWI2.h>
156
   #include <LiquidTWI2.h>
157
   #define LCD_CLASS LiquidTWI2
157
   #define LCD_CLASS LiquidTWI2
158
   #if defined(DETECT_DEVICE)
158
   #if defined(DETECT_DEVICE)
159
-     LCD_CLASS lcd(LCD_I2C_ADDRESS, 1);
159
+    LCD_CLASS lcd(LCD_I2C_ADDRESS, 1);
160
   #else
160
   #else
161
-     LCD_CLASS lcd(LCD_I2C_ADDRESS);
161
+    LCD_CLASS lcd(LCD_I2C_ADDRESS);
162
   #endif
162
   #endif
163
-  
163
+
164
 #elif defined(LCD_I2C_TYPE_MCP23008)
164
 #elif defined(LCD_I2C_TYPE_MCP23008)
165
   #include <Wire.h>
165
   #include <Wire.h>
166
   #include <LiquidTWI2.h>
166
   #include <LiquidTWI2.h>
167
   #define LCD_CLASS LiquidTWI2
167
   #define LCD_CLASS LiquidTWI2
168
   #if defined(DETECT_DEVICE)
168
   #if defined(DETECT_DEVICE)
169
-     LCD_CLASS lcd(LCD_I2C_ADDRESS, 1);
169
+    LCD_CLASS lcd(LCD_I2C_ADDRESS, 1);
170
   #else
170
   #else
171
-     LCD_CLASS lcd(LCD_I2C_ADDRESS);
171
+    LCD_CLASS lcd(LCD_I2C_ADDRESS);
172
   #endif
172
   #endif
173
 
173
 
174
 #elif defined(LCD_I2C_TYPE_PCA8574)
174
 #elif defined(LCD_I2C_TYPE_PCA8574)
175
     #include <LiquidCrystal_I2C.h>
175
     #include <LiquidCrystal_I2C.h>
176
     #define LCD_CLASS LiquidCrystal_I2C
176
     #define LCD_CLASS LiquidCrystal_I2C
177
     LCD_CLASS lcd(LCD_I2C_ADDRESS, LCD_WIDTH, LCD_HEIGHT);
177
     LCD_CLASS lcd(LCD_I2C_ADDRESS, LCD_WIDTH, LCD_HEIGHT);
178
-    
178
+
179
 // 2 wire Non-latching LCD SR from:
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
 #elif defined(SR_LCD_2W_NL)
181
 #elif defined(SR_LCD_2W_NL)
182
   extern "C" void __cxa_pure_virtual() { while (1); }
182
   extern "C" void __cxa_pure_virtual() { while (1); }
183
   #include <LCD.h>
183
   #include <LCD.h>
353
   #endif
353
   #endif
354
 ) {
354
 ) {
355
 
355
 
356
-#if defined(LCD_I2C_TYPE_PCF8575)
356
+  #if defined(LCD_I2C_TYPE_PCF8575)
357
     lcd.begin(LCD_WIDTH, LCD_HEIGHT);
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
     lcd.setMCPType(LTI_TYPE_MCP23017);
364
     lcd.setMCPType(LTI_TYPE_MCP23017);
365
     lcd.begin(LCD_WIDTH, LCD_HEIGHT);
365
     lcd.begin(LCD_WIDTH, LCD_HEIGHT);
366
     lcd.setBacklight(0); //set all the LEDs off to begin with
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
     lcd.setMCPType(LTI_TYPE_MCP23008);
369
     lcd.setMCPType(LTI_TYPE_MCP23008);
370
     lcd.begin(LCD_WIDTH, LCD_HEIGHT);
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
     lcd.begin(LCD_WIDTH, LCD_HEIGHT);
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
 /* Arduino < 1.0.0 is missing a function to print PROGMEM strings, so we need to implement our own */
391
 /* Arduino < 1.0.0 is missing a function to print PROGMEM strings, so we need to implement our own */
394
 char lcd_printPGM(const char* str) {
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
   return n;
395
   return n;
401
 }
396
 }
402
 
397
 
403
 char lcd_print(char* str) {
398
 char lcd_print(char* str) {
404
   char c, n = 0;;
399
   char c, n = 0;;
405
   unsigned char i = 0;
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
   return n;
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
 Possible status screens:
408
 Possible status screens:
437
 
428
 
438
 20x4   |01234567890123456789|
429
 20x4   |01234567890123456789|
439
        |T000/000D B000/000D |
430
        |T000/000D B000/000D |
440
-       |T000/000D     Z000.0|
431
+       |T000/000D   Z000.00 |
441
        |F100%  SD100% T--:--|
432
        |F100%  SD100% T--:--|
442
        |Status line.........|
433
        |Status line.........|
443
 */
434
 */
728
 
719
 
729
   static void lcd_implementation_update_indicators() {
720
   static void lcd_implementation_update_indicators() {
730
     #if defined(LCD_I2C_PANELOLU2) || defined(LCD_I2C_VIKI)
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
       static uint8_t ledsprev = 0;
723
       static uint8_t ledsprev = 0;
733
       uint8_t leds = 0;
724
       uint8_t leds = 0;
734
       if (target_temperature_bed > 0) leds |= LED_A;
725
       if (target_temperature_bed > 0) leds |= LED_A;
735
       if (target_temperature[0] > 0) leds |= LED_B;
726
       if (target_temperature[0] > 0) leds |= LED_B;
736
       if (fanSpeed) leds |= LED_C;
727
       if (fanSpeed) leds |= LED_C;
737
-      #if EXTRUDERS > 1  
728
+      #if EXTRUDERS > 1
738
         if (target_temperature[1] > 0) leds |= LED_C;
729
         if (target_temperature[1] > 0) leds |= LED_C;
739
       #endif
730
       #endif
740
       if (leds != ledsprev) {
731
       if (leds != ledsprev) {
766
 
757
 
767
 #endif // LCD_HAS_SLOW_BUTTONS
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