Browse Source

Merge pull request #6877 from thinkyhead/bf_scrolling_status

Scrolling status message (option)
Scott Lahteine 8 years ago
parent
commit
58556991da
37 changed files with 224 additions and 92 deletions
  1. 3
    0
      Marlin/Configuration_adv.h
  2. 7
    8
      Marlin/Marlin_main.cpp
  3. 1
    1
      Marlin/SdBaseFile.cpp
  4. 2
    2
      Marlin/SdBaseFile.h
  5. 3
    0
      Marlin/example_configurations/Cartesio/Configuration_adv.h
  6. 3
    0
      Marlin/example_configurations/Felix/Configuration_adv.h
  7. 3
    0
      Marlin/example_configurations/FolgerTech-i3-2020/Configuration_adv.h
  8. 3
    0
      Marlin/example_configurations/Hephestos/Configuration_adv.h
  9. 3
    0
      Marlin/example_configurations/Hephestos_2/Configuration_adv.h
  10. 3
    0
      Marlin/example_configurations/K8200/Configuration_adv.h
  11. 3
    0
      Marlin/example_configurations/K8400/Configuration_adv.h
  12. 3
    0
      Marlin/example_configurations/RigidBot/Configuration_adv.h
  13. 3
    0
      Marlin/example_configurations/SCARA/Configuration_adv.h
  14. 3
    0
      Marlin/example_configurations/TAZ4/Configuration_adv.h
  15. 3
    0
      Marlin/example_configurations/TinyBoy2/Configuration_adv.h
  16. 3
    0
      Marlin/example_configurations/WITBOX/Configuration_adv.h
  17. 3
    0
      Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h
  18. 3
    0
      Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h
  19. 3
    0
      Marlin/example_configurations/delta/generic/Configuration_adv.h
  20. 3
    0
      Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h
  21. 3
    0
      Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h
  22. 3
    0
      Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h
  23. 3
    0
      Marlin/example_configurations/gCreate_gMax1.5+/Configuration_adv.h
  24. 3
    0
      Marlin/example_configurations/makibox/Configuration_adv.h
  25. 3
    0
      Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h
  26. 3
    0
      Marlin/example_configurations/wt150/Configuration_adv.h
  27. 1
    1
      Marlin/gcode.h
  28. 1
    1
      Marlin/planner.cpp
  29. 5
    2
      Marlin/temperature.cpp
  30. 20
    5
      Marlin/temperature.h
  31. 2
    2
      Marlin/ubl_motion.cpp
  32. 27
    13
      Marlin/ultralcd.cpp
  33. 33
    14
      Marlin/ultralcd_impl_DOGM.h
  34. 25
    12
      Marlin/ultralcd_impl_HD44780.h
  35. 14
    14
      Marlin/utility.cpp
  36. 16
    16
      Marlin/utility.h
  37. 1
    1
      Marlin/vector_3.h

+ 3
- 0
Marlin/Configuration_adv.h View File

442
 // Include a page of printer information in the LCD Main Menu
442
 // Include a page of printer information in the LCD Main Menu
443
 //#define LCD_INFO_MENU
443
 //#define LCD_INFO_MENU
444
 
444
 
445
+// Scroll a longer status message into view
446
+//#define STATUS_MESSAGE_SCROLLING
447
+
445
 // On the Info Screen, display XY with one decimal place when possible
448
 // On the Info Screen, display XY with one decimal place when possible
446
 //#define LCD_DECIMAL_SMALL_XY
449
 //#define LCD_DECIMAL_SMALL_XY
447
 
450
 

+ 7
- 8
Marlin/Marlin_main.cpp View File

5746
     static bool sd_print_paused = false;
5746
     static bool sd_print_paused = false;
5747
   #endif
5747
   #endif
5748
 
5748
 
5749
-  static void filament_change_beep(const int max_beep_count, const bool init=false) {
5749
+  static void filament_change_beep(const int8_t max_beep_count, const bool init=false) {
5750
     static millis_t next_buzz = 0;
5750
     static millis_t next_buzz = 0;
5751
-    static uint16_t runout_beep = 0;
5751
+    static int8_t runout_beep = 0;
5752
 
5752
 
5753
     if (init) next_buzz = runout_beep = 0;
5753
     if (init) next_buzz = runout_beep = 0;
5754
 
5754
 
5762
     }
5762
     }
5763
   }
5763
   }
5764
 
5764
 
5765
-  static bool pause_print(const float& retract, const float& z_lift, const float& x_pos, const float& y_pos,
5766
-                          const float& unload_length = 0 , int max_beep_count = 0, bool show_lcd = false) {
5765
+  static bool pause_print(const float &retract, const float &z_lift, const float &x_pos, const float &y_pos,
5766
+                          const float &unload_length = 0 , int8_t max_beep_count = 0, bool show_lcd = false
5767
+  ) {
5767
     if (move_away_flag) return false; // already paused
5768
     if (move_away_flag) return false; // already paused
5768
 
5769
 
5769
     if (!DEBUGGING(DRYRUN) && thermalManager.tooColdToExtrude(active_extruder) && unload_length > 0) {
5770
     if (!DEBUGGING(DRYRUN) && thermalManager.tooColdToExtrude(active_extruder) && unload_length > 0) {
5772
       return false;
5773
       return false;
5773
     }
5774
     }
5774
 
5775
 
5775
-    const bool job_running = print_job_timer.isRunning();
5776
-
5777
     // Indicate that the printer is paused
5776
     // Indicate that the printer is paused
5778
     move_away_flag = true;
5777
     move_away_flag = true;
5779
 
5778
 
5857
     return true;
5856
     return true;
5858
   }
5857
   }
5859
 
5858
 
5860
-  static void wait_for_filament_reload(int max_beep_count = 0) {
5859
+  static void wait_for_filament_reload(int8_t max_beep_count = 0) {
5861
     bool nozzle_timed_out = false;
5860
     bool nozzle_timed_out = false;
5862
 
5861
 
5863
     // Wait for filament insert by user and press button
5862
     // Wait for filament insert by user and press button
5882
     KEEPALIVE_STATE(IN_HANDLER);
5881
     KEEPALIVE_STATE(IN_HANDLER);
5883
   }
5882
   }
5884
 
5883
 
5885
-  static void resume_print(const float& load_length = 0, const float& initial_extrude_length = 0, int max_beep_count = 0) {
5884
+  static void resume_print(const float &load_length = 0, const float &initial_extrude_length = 0, int8_t max_beep_count = 0) {
5886
     bool nozzle_timed_out = false;
5885
     bool nozzle_timed_out = false;
5887
 
5886
 
5888
     if (!move_away_flag) return;
5887
     if (!move_away_flag) return;

+ 1
- 1
Marlin/SdBaseFile.cpp View File

1819
 //------------------------------------------------------------------------------
1819
 //------------------------------------------------------------------------------
1820
 // suppress cpplint warnings with NOLINT comment
1820
 // suppress cpplint warnings with NOLINT comment
1821
 #if ALLOW_DEPRECATED_FUNCTIONS && !defined(DOXYGEN)
1821
 #if ALLOW_DEPRECATED_FUNCTIONS && !defined(DOXYGEN)
1822
-  void (*SdBaseFile::oldDateTime_)(uint16_t& date, uint16_t& time) = 0;  // NOLINT
1822
+  void (*SdBaseFile::oldDateTime_)(uint16_t &date, uint16_t &time) = 0;  // NOLINT
1823
 #endif  // ALLOW_DEPRECATED_FUNCTIONS
1823
 #endif  // ALLOW_DEPRECATED_FUNCTIONS
1824
 
1824
 
1825
 
1825
 

+ 2
- 2
Marlin/SdBaseFile.h View File

402
    * \param[in] dateTime The user's call back function.
402
    * \param[in] dateTime The user's call back function.
403
    */
403
    */
404
   static void dateTimeCallback(
404
   static void dateTimeCallback(
405
-    void (*dateTime)(uint16_t& date, uint16_t& time)) {  // NOLINT
405
+    void (*dateTime)(uint16_t &date, uint16_t &time)) {  // NOLINT
406
     oldDateTime_ = dateTime;
406
     oldDateTime_ = dateTime;
407
     dateTime_ = dateTime ? oldToNew : 0;
407
     dateTime_ = dateTime ? oldToNew : 0;
408
   }
408
   }
477
   //------------------------------------------------------------------------------
477
   //------------------------------------------------------------------------------
478
   // rest are private
478
   // rest are private
479
  private:
479
  private:
480
-  static void (*oldDateTime_)(uint16_t& date, uint16_t& time);  // NOLINT
480
+  static void (*oldDateTime_)(uint16_t &date, uint16_t &time);  // NOLINT
481
   static void oldToNew(uint16_t* date, uint16_t* time) {
481
   static void oldToNew(uint16_t* date, uint16_t* time) {
482
     uint16_t d;
482
     uint16_t d;
483
     uint16_t t;
483
     uint16_t t;

+ 3
- 0
Marlin/example_configurations/Cartesio/Configuration_adv.h View File

442
 // Include a page of printer information in the LCD Main Menu
442
 // Include a page of printer information in the LCD Main Menu
443
 //#define LCD_INFO_MENU
443
 //#define LCD_INFO_MENU
444
 
444
 
445
+// Scroll a longer status message into view
446
+//#define STATUS_MESSAGE_SCROLLING
447
+
445
 // On the Info Screen, display XY with one decimal place when possible
448
 // On the Info Screen, display XY with one decimal place when possible
446
 //#define LCD_DECIMAL_SMALL_XY
449
 //#define LCD_DECIMAL_SMALL_XY
447
 
450
 

+ 3
- 0
Marlin/example_configurations/Felix/Configuration_adv.h View File

442
 // Include a page of printer information in the LCD Main Menu
442
 // Include a page of printer information in the LCD Main Menu
443
 //#define LCD_INFO_MENU
443
 //#define LCD_INFO_MENU
444
 
444
 
445
+// Scroll a longer status message into view
446
+//#define STATUS_MESSAGE_SCROLLING
447
+
445
 // On the Info Screen, display XY with one decimal place when possible
448
 // On the Info Screen, display XY with one decimal place when possible
446
 //#define LCD_DECIMAL_SMALL_XY
449
 //#define LCD_DECIMAL_SMALL_XY
447
 
450
 

+ 3
- 0
Marlin/example_configurations/FolgerTech-i3-2020/Configuration_adv.h View File

442
 // Include a page of printer information in the LCD Main Menu
442
 // Include a page of printer information in the LCD Main Menu
443
 //#define LCD_INFO_MENU
443
 //#define LCD_INFO_MENU
444
 
444
 
445
+// Scroll a longer status message into view
446
+//#define STATUS_MESSAGE_SCROLLING
447
+
445
 // On the Info Screen, display XY with one decimal place when possible
448
 // On the Info Screen, display XY with one decimal place when possible
446
 //#define LCD_DECIMAL_SMALL_XY
449
 //#define LCD_DECIMAL_SMALL_XY
447
 
450
 

+ 3
- 0
Marlin/example_configurations/Hephestos/Configuration_adv.h View File

442
 // Include a page of printer information in the LCD Main Menu
442
 // Include a page of printer information in the LCD Main Menu
443
 //#define LCD_INFO_MENU
443
 //#define LCD_INFO_MENU
444
 
444
 
445
+// Scroll a longer status message into view
446
+//#define STATUS_MESSAGE_SCROLLING
447
+
445
 // On the Info Screen, display XY with one decimal place when possible
448
 // On the Info Screen, display XY with one decimal place when possible
446
 //#define LCD_DECIMAL_SMALL_XY
449
 //#define LCD_DECIMAL_SMALL_XY
447
 
450
 

+ 3
- 0
Marlin/example_configurations/Hephestos_2/Configuration_adv.h View File

443
 // Include a page of printer information in the LCD Main Menu
443
 // Include a page of printer information in the LCD Main Menu
444
 #define LCD_INFO_MENU
444
 #define LCD_INFO_MENU
445
 
445
 
446
+// Scroll a longer status message into view
447
+//#define STATUS_MESSAGE_SCROLLING
448
+
446
 // On the Info Screen, display XY with one decimal place when possible
449
 // On the Info Screen, display XY with one decimal place when possible
447
 #define LCD_DECIMAL_SMALL_XY
450
 #define LCD_DECIMAL_SMALL_XY
448
 
451
 

+ 3
- 0
Marlin/example_configurations/K8200/Configuration_adv.h View File

455
 // Include a page of printer information in the LCD Main Menu
455
 // Include a page of printer information in the LCD Main Menu
456
 //#define LCD_INFO_MENU
456
 //#define LCD_INFO_MENU
457
 
457
 
458
+// Scroll a longer status message into view
459
+//#define STATUS_MESSAGE_SCROLLING
460
+
458
 // On the Info Screen, display XY with one decimal place when possible
461
 // On the Info Screen, display XY with one decimal place when possible
459
 //#define LCD_DECIMAL_SMALL_XY
462
 //#define LCD_DECIMAL_SMALL_XY
460
 
463
 

+ 3
- 0
Marlin/example_configurations/K8400/Configuration_adv.h View File

442
 // Include a page of printer information in the LCD Main Menu
442
 // Include a page of printer information in the LCD Main Menu
443
 //#define LCD_INFO_MENU
443
 //#define LCD_INFO_MENU
444
 
444
 
445
+// Scroll a longer status message into view
446
+//#define STATUS_MESSAGE_SCROLLING
447
+
445
 // On the Info Screen, display XY with one decimal place when possible
448
 // On the Info Screen, display XY with one decimal place when possible
446
 //#define LCD_DECIMAL_SMALL_XY
449
 //#define LCD_DECIMAL_SMALL_XY
447
 
450
 

+ 3
- 0
Marlin/example_configurations/RigidBot/Configuration_adv.h View File

442
 // Include a page of printer information in the LCD Main Menu
442
 // Include a page of printer information in the LCD Main Menu
443
 //#define LCD_INFO_MENU
443
 //#define LCD_INFO_MENU
444
 
444
 
445
+// Scroll a longer status message into view
446
+//#define STATUS_MESSAGE_SCROLLING
447
+
445
 // On the Info Screen, display XY with one decimal place when possible
448
 // On the Info Screen, display XY with one decimal place when possible
446
 //#define LCD_DECIMAL_SMALL_XY
449
 //#define LCD_DECIMAL_SMALL_XY
447
 
450
 

+ 3
- 0
Marlin/example_configurations/SCARA/Configuration_adv.h View File

442
 // Include a page of printer information in the LCD Main Menu
442
 // Include a page of printer information in the LCD Main Menu
443
 //#define LCD_INFO_MENU
443
 //#define LCD_INFO_MENU
444
 
444
 
445
+// Scroll a longer status message into view
446
+//#define STATUS_MESSAGE_SCROLLING
447
+
445
 // On the Info Screen, display XY with one decimal place when possible
448
 // On the Info Screen, display XY with one decimal place when possible
446
 //#define LCD_DECIMAL_SMALL_XY
449
 //#define LCD_DECIMAL_SMALL_XY
447
 
450
 

+ 3
- 0
Marlin/example_configurations/TAZ4/Configuration_adv.h View File

442
 // Include a page of printer information in the LCD Main Menu
442
 // Include a page of printer information in the LCD Main Menu
443
 //#define LCD_INFO_MENU
443
 //#define LCD_INFO_MENU
444
 
444
 
445
+// Scroll a longer status message into view
446
+//#define STATUS_MESSAGE_SCROLLING
447
+
445
 // On the Info Screen, display XY with one decimal place when possible
448
 // On the Info Screen, display XY with one decimal place when possible
446
 //#define LCD_DECIMAL_SMALL_XY
449
 //#define LCD_DECIMAL_SMALL_XY
447
 
450
 

+ 3
- 0
Marlin/example_configurations/TinyBoy2/Configuration_adv.h View File

442
 // Include a page of printer information in the LCD Main Menu
442
 // Include a page of printer information in the LCD Main Menu
443
 #define LCD_INFO_MENU
443
 #define LCD_INFO_MENU
444
 
444
 
445
+// Scroll a longer status message into view
446
+//#define STATUS_MESSAGE_SCROLLING
447
+
445
 // On the Info Screen, display XY with one decimal place when possible
448
 // On the Info Screen, display XY with one decimal place when possible
446
 //#define LCD_DECIMAL_SMALL_XY
449
 //#define LCD_DECIMAL_SMALL_XY
447
 
450
 

+ 3
- 0
Marlin/example_configurations/WITBOX/Configuration_adv.h View File

442
 // Include a page of printer information in the LCD Main Menu
442
 // Include a page of printer information in the LCD Main Menu
443
 //#define LCD_INFO_MENU
443
 //#define LCD_INFO_MENU
444
 
444
 
445
+// Scroll a longer status message into view
446
+//#define STATUS_MESSAGE_SCROLLING
447
+
445
 // On the Info Screen, display XY with one decimal place when possible
448
 // On the Info Screen, display XY with one decimal place when possible
446
 //#define LCD_DECIMAL_SMALL_XY
449
 //#define LCD_DECIMAL_SMALL_XY
447
 
450
 

+ 3
- 0
Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h View File

444
 // Include a page of printer information in the LCD Main Menu
444
 // Include a page of printer information in the LCD Main Menu
445
 //#define LCD_INFO_MENU
445
 //#define LCD_INFO_MENU
446
 
446
 
447
+// Scroll a longer status message into view
448
+//#define STATUS_MESSAGE_SCROLLING
449
+
447
 // On the Info Screen, display XY with one decimal place when possible
450
 // On the Info Screen, display XY with one decimal place when possible
448
 //#define LCD_DECIMAL_SMALL_XY
451
 //#define LCD_DECIMAL_SMALL_XY
449
 
452
 

+ 3
- 0
Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h View File

444
 // Include a page of printer information in the LCD Main Menu
444
 // Include a page of printer information in the LCD Main Menu
445
 //#define LCD_INFO_MENU
445
 //#define LCD_INFO_MENU
446
 
446
 
447
+// Scroll a longer status message into view
448
+//#define STATUS_MESSAGE_SCROLLING
449
+
447
 // On the Info Screen, display XY with one decimal place when possible
450
 // On the Info Screen, display XY with one decimal place when possible
448
 //#define LCD_DECIMAL_SMALL_XY
451
 //#define LCD_DECIMAL_SMALL_XY
449
 
452
 

+ 3
- 0
Marlin/example_configurations/delta/generic/Configuration_adv.h View File

444
 // Include a page of printer information in the LCD Main Menu
444
 // Include a page of printer information in the LCD Main Menu
445
 //#define LCD_INFO_MENU
445
 //#define LCD_INFO_MENU
446
 
446
 
447
+// Scroll a longer status message into view
448
+//#define STATUS_MESSAGE_SCROLLING
449
+
447
 // On the Info Screen, display XY with one decimal place when possible
450
 // On the Info Screen, display XY with one decimal place when possible
448
 //#define LCD_DECIMAL_SMALL_XY
451
 //#define LCD_DECIMAL_SMALL_XY
449
 
452
 

+ 3
- 0
Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h View File

444
 // Include a page of printer information in the LCD Main Menu
444
 // Include a page of printer information in the LCD Main Menu
445
 //#define LCD_INFO_MENU
445
 //#define LCD_INFO_MENU
446
 
446
 
447
+// Scroll a longer status message into view
448
+//#define STATUS_MESSAGE_SCROLLING
449
+
447
 // On the Info Screen, display XY with one decimal place when possible
450
 // On the Info Screen, display XY with one decimal place when possible
448
 //#define LCD_DECIMAL_SMALL_XY
451
 //#define LCD_DECIMAL_SMALL_XY
449
 
452
 

+ 3
- 0
Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h View File

449
 // Include a page of printer information in the LCD Main Menu
449
 // Include a page of printer information in the LCD Main Menu
450
 //#define LCD_INFO_MENU
450
 //#define LCD_INFO_MENU
451
 
451
 
452
+// Scroll a longer status message into view
453
+//#define STATUS_MESSAGE_SCROLLING
454
+
452
 // On the Info Screen, display XY with one decimal place when possible
455
 // On the Info Screen, display XY with one decimal place when possible
453
 //#define LCD_DECIMAL_SMALL_XY
456
 //#define LCD_DECIMAL_SMALL_XY
454
 
457
 

+ 3
- 0
Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h View File

444
 // Include a page of printer information in the LCD Main Menu
444
 // Include a page of printer information in the LCD Main Menu
445
 //#define LCD_INFO_MENU
445
 //#define LCD_INFO_MENU
446
 
446
 
447
+// Scroll a longer status message into view
448
+//#define STATUS_MESSAGE_SCROLLING
449
+
447
 // On the Info Screen, display XY with one decimal place when possible
450
 // On the Info Screen, display XY with one decimal place when possible
448
 //#define LCD_DECIMAL_SMALL_XY
451
 //#define LCD_DECIMAL_SMALL_XY
449
 
452
 

+ 3
- 0
Marlin/example_configurations/gCreate_gMax1.5+/Configuration_adv.h View File

442
 // Include a page of printer information in the LCD Main Menu
442
 // Include a page of printer information in the LCD Main Menu
443
 //#define LCD_INFO_MENU
443
 //#define LCD_INFO_MENU
444
 
444
 
445
+// Scroll a longer status message into view
446
+//#define STATUS_MESSAGE_SCROLLING
447
+
445
 // On the Info Screen, display XY with one decimal place when possible
448
 // On the Info Screen, display XY with one decimal place when possible
446
 //#define LCD_DECIMAL_SMALL_XY
449
 //#define LCD_DECIMAL_SMALL_XY
447
 
450
 

+ 3
- 0
Marlin/example_configurations/makibox/Configuration_adv.h View File

442
 // Include a page of printer information in the LCD Main Menu
442
 // Include a page of printer information in the LCD Main Menu
443
 //#define LCD_INFO_MENU
443
 //#define LCD_INFO_MENU
444
 
444
 
445
+// Scroll a longer status message into view
446
+//#define STATUS_MESSAGE_SCROLLING
447
+
445
 // On the Info Screen, display XY with one decimal place when possible
448
 // On the Info Screen, display XY with one decimal place when possible
446
 //#define LCD_DECIMAL_SMALL_XY
449
 //#define LCD_DECIMAL_SMALL_XY
447
 
450
 

+ 3
- 0
Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h View File

442
 // Include a page of printer information in the LCD Main Menu
442
 // Include a page of printer information in the LCD Main Menu
443
 //#define LCD_INFO_MENU
443
 //#define LCD_INFO_MENU
444
 
444
 
445
+// Scroll a longer status message into view
446
+//#define STATUS_MESSAGE_SCROLLING
447
+
445
 // On the Info Screen, display XY with one decimal place when possible
448
 // On the Info Screen, display XY with one decimal place when possible
446
 //#define LCD_DECIMAL_SMALL_XY
449
 //#define LCD_DECIMAL_SMALL_XY
447
 
450
 

+ 3
- 0
Marlin/example_configurations/wt150/Configuration_adv.h View File

442
 // Include a page of printer information in the LCD Main Menu
442
 // Include a page of printer information in the LCD Main Menu
443
 #define LCD_INFO_MENU
443
 #define LCD_INFO_MENU
444
 
444
 
445
+// Scroll a longer status message into view
446
+//#define STATUS_MESSAGE_SCROLLING
447
+
445
 // On the Info Screen, display XY with one decimal place when possible
448
 // On the Info Screen, display XY with one decimal place when possible
446
 //#define LCD_DECIMAL_SMALL_XY
449
 //#define LCD_DECIMAL_SMALL_XY
447
 
450
 

+ 1
- 1
Marlin/gcode.h View File

133
     // Code is found in the string. If not found, value_ptr is unchanged.
133
     // Code is found in the string. If not found, value_ptr is unchanged.
134
     // This allows "if (seen('A')||seen('B'))" to use the last-found value.
134
     // This allows "if (seen('A')||seen('B'))" to use the last-found value.
135
     static bool seen(const char c) {
135
     static bool seen(const char c) {
136
-      char *p = strchr(command_args, c);
136
+      const char *p = strchr(command_args, c);
137
       const bool b = !!p;
137
       const bool b = !!p;
138
       if (b) value_ptr = DECIMAL_SIGNED(p[1]) ? &p[1] : NULL;
138
       if (b) value_ptr = DECIMAL_SIGNED(p[1]) ? &p[1] : NULL;
139
       return b;
139
       return b;

+ 1
- 1
Marlin/planner.cpp View File

1510
 /**
1510
 /**
1511
  * Setters for planner position (also setting stepper position).
1511
  * Setters for planner position (also setting stepper position).
1512
  */
1512
  */
1513
-void Planner::set_position_mm(const AxisEnum axis, const float& v) {
1513
+void Planner::set_position_mm(const AxisEnum axis, const float &v) {
1514
   #if ENABLED(DISTINCT_E_FACTORS)
1514
   #if ENABLED(DISTINCT_E_FACTORS)
1515
     const uint8_t axis_index = axis + (axis == E_AXIS ? active_extruder : 0);
1515
     const uint8_t axis_index = axis + (axis == E_AXIS ? active_extruder : 0);
1516
     last_extruder = active_extruder;
1516
     last_extruder = active_extruder;

+ 5
- 2
Marlin/temperature.cpp View File

67
       Temperature::current_temperature_bed = 0.0;
67
       Temperature::current_temperature_bed = 0.0;
68
 int16_t Temperature::current_temperature_raw[HOTENDS] = { 0 },
68
 int16_t Temperature::current_temperature_raw[HOTENDS] = { 0 },
69
         Temperature::target_temperature[HOTENDS] = { 0 },
69
         Temperature::target_temperature[HOTENDS] = { 0 },
70
-        Temperature::current_temperature_bed_raw = 0,
71
-        Temperature::target_temperature_bed = 0;
70
+        Temperature::current_temperature_bed_raw = 0;
71
+
72
+#if HAS_HEATER_BED
73
+  int16_t Temperature::target_temperature_bed = 0;
74
+#endif
72
 
75
 
73
 #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
76
 #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
74
   float Temperature::redundant_temperature = 0.0;
77
   float Temperature::redundant_temperature = 0.0;

+ 20
- 5
Marlin/temperature.h View File

92
 
92
 
93
 #define ACTUAL_ADC_SAMPLES max(int(MIN_ADC_ISR_LOOPS), int(SensorsReady))
93
 #define ACTUAL_ADC_SAMPLES max(int(MIN_ADC_ISR_LOOPS), int(SensorsReady))
94
 
94
 
95
+#if !HAS_HEATER_BED
96
+  constexpr int16_t target_temperature_bed = 0;
97
+#endif
98
+
95
 class Temperature {
99
 class Temperature {
96
 
100
 
97
   public:
101
   public:
100
                  current_temperature_bed;
104
                  current_temperature_bed;
101
     static int16_t current_temperature_raw[HOTENDS],
105
     static int16_t current_temperature_raw[HOTENDS],
102
                    target_temperature[HOTENDS],
106
                    target_temperature[HOTENDS],
103
-                   current_temperature_bed_raw,
104
-                   target_temperature_bed;
107
+                   current_temperature_bed_raw;
108
+
109
+    #if HAS_HEATER_BED
110
+      static int16_t target_temperature_bed;
111
+    #endif
105
 
112
 
106
     static volatile bool in_temp_isr;
113
     static volatile bool in_temp_isr;
107
 
114
 
382
     }
389
     }
383
 
390
 
384
     static void setTargetBed(const int16_t celsius) {
391
     static void setTargetBed(const int16_t celsius) {
385
-      target_temperature_bed = celsius;
386
-      #if WATCH_THE_BED
387
-        start_watching_bed();
392
+      #if HAS_HEATER_BED
393
+        target_temperature_bed =
394
+          #ifdef BED_MAXTEMP
395
+            min(celsius, BED_MAXTEMP)
396
+          #else
397
+            celsius
398
+          #endif
399
+        ;
400
+        #if WATCH_THE_BED
401
+          start_watching_bed();
402
+        #endif
388
       #endif
403
       #endif
389
     }
404
     }
390
 
405
 

+ 2
- 2
Marlin/ubl_motion.cpp View File

585
       float seg_dest[XYZE];  // per-segment destination, initialize to first segment
585
       float seg_dest[XYZE];  // per-segment destination, initialize to first segment
586
       LOOP_XYZE(i) seg_dest[i] = current_position[i] + segment_distance[i];
586
       LOOP_XYZE(i) seg_dest[i] = current_position[i] + segment_distance[i];
587
 
587
 
588
-      const float& dx_seg = segment_distance[X_AXIS];  // alias for clarity
589
-      const float& dy_seg = segment_distance[Y_AXIS];
588
+      const float &dx_seg = segment_distance[X_AXIS];  // alias for clarity
589
+      const float &dy_seg = segment_distance[Y_AXIS];
590
 
590
 
591
       float rx = RAW_X_POSITION(seg_dest[X_AXIS]),  // assume raw vs logical coordinates shifted but not scaled.
591
       float rx = RAW_X_POSITION(seg_dest[X_AXIS]),  // assume raw vs logical coordinates shifted but not scaled.
592
             ry = RAW_Y_POSITION(seg_dest[Y_AXIS]);
592
             ry = RAW_Y_POSITION(seg_dest[Y_AXIS]);

+ 27
- 13
Marlin/ultralcd.cpp View File

60
 
60
 
61
 uint8_t lcd_status_message_level;
61
 uint8_t lcd_status_message_level;
62
 char lcd_status_message[3 * (LCD_WIDTH) + 1] = WELCOME_MSG; // worst case is kana with up to 3*LCD_WIDTH+1
62
 char lcd_status_message[3 * (LCD_WIDTH) + 1] = WELCOME_MSG; // worst case is kana with up to 3*LCD_WIDTH+1
63
+#if ENABLED(STATUS_MESSAGE_SCROLLING)
64
+  uint8_t status_scroll_pos = 0;
65
+#endif
63
 
66
 
64
 #if ENABLED(DOGLCD)
67
 #if ENABLED(DOGLCD)
65
   #include "ultralcd_impl_DOGM.h"
68
   #include "ultralcd_impl_DOGM.h"
3961
   } // ELAPSED(ms, next_lcd_update_ms)
3964
   } // ELAPSED(ms, next_lcd_update_ms)
3962
 }
3965
 }
3963
 
3966
 
3964
-void set_utf_strlen(char* s, uint8_t n) {
3965
-  uint8_t i = 0, j = 0;
3966
-  while (s[i] && (j < n)) {
3967
-    #if ENABLED(MAPPER_NON)
3968
-      j++;
3969
-    #else
3970
-      if ((s[i] & 0xC0u) != 0x80u) j++;
3971
-    #endif
3972
-    i++;
3967
+#if DISABLED(STATUS_MESSAGE_SCROLLING)
3968
+
3969
+  void set_utf_strlen(char* s, uint8_t n) {
3970
+    uint8_t i = 0, j = 0;
3971
+    while (s[i] && (j < n)) {
3972
+      #if ENABLED(MAPPER_NON)
3973
+        j++;
3974
+      #else
3975
+        if ((s[i] & 0xC0u) != 0x80u) j++;
3976
+      #endif
3977
+      i++;
3978
+    }
3979
+    while (j++ < n) s[i++] = ' ';
3980
+    s[i] = '\0';
3973
   }
3981
   }
3974
-  while (j++ < n) s[i++] = ' ';
3975
-  s[i] = '\0';
3976
-}
3982
+
3983
+#endif // !STATUS_MESSAGE_SCROLLING
3977
 
3984
 
3978
 void lcd_finishstatus(bool persist=false) {
3985
 void lcd_finishstatus(bool persist=false) {
3979
-  set_utf_strlen(lcd_status_message, LCD_WIDTH);
3986
+  #if DISABLED(STATUS_MESSAGE_SCROLLING)
3987
+    set_utf_strlen(lcd_status_message, LCD_WIDTH);
3988
+  #endif
3989
+
3980
   #if !(ENABLED(LCD_PROGRESS_BAR) && (PROGRESS_MSG_EXPIRE > 0))
3990
   #if !(ENABLED(LCD_PROGRESS_BAR) && (PROGRESS_MSG_EXPIRE > 0))
3981
     UNUSED(persist);
3991
     UNUSED(persist);
3982
   #endif
3992
   #endif
3992
   #if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT)
4002
   #if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT)
3993
     previous_lcd_status_ms = millis();  //get status message to show up for a while
4003
     previous_lcd_status_ms = millis();  //get status message to show up for a while
3994
   #endif
4004
   #endif
4005
+
4006
+  #if ENABLED(STATUS_MESSAGE_SCROLLING)
4007
+    status_scroll_pos = 0;
4008
+  #endif
3995
 }
4009
 }
3996
 
4010
 
3997
 #if ENABLED(LCD_PROGRESS_BAR) && PROGRESS_MSG_EXPIRE > 0
4011
 #if ENABLED(LCD_PROGRESS_BAR) && PROGRESS_MSG_EXPIRE > 0

+ 33
- 14
Marlin/ultralcd_impl_DOGM.h View File

234
   else return charset_mapper(c);
234
   else return charset_mapper(c);
235
 }
235
 }
236
 
236
 
237
-void lcd_print(const char* const str) {
238
-  for (uint8_t i = 0; char c = str[i]; ++i) lcd_print(c);
237
+/**
238
+ * Core LCD printing functions
239
+ * On DOGM all strings go through a filter for utf
240
+ * But only use lcd_print_utf and lcd_printPGM_utf for translated text
241
+ */
242
+void lcd_print(const char* const str) { for (uint8_t i = 0; char c = str[i]; ++i) lcd_print(c); }
243
+void lcd_printPGM(const char* str) { for (; char c = pgm_read_byte(str); ++str) lcd_print(c); }
244
+
245
+void lcd_print_utf(const char* const str, const uint8_t maxLength=LCD_WIDTH) {
246
+  char c;
247
+  for (uint8_t i = 0, n = maxLength; n && (c = str[i]); ++i)
248
+    n -= charset_mapper(c);
239
 }
249
 }
240
 
250
 
241
-/* Arduino < 1.0.0 is missing a function to print PROGMEM strings, so we need to implement our own */
242
-void lcd_printPGM(const char* str) {
243
-  for (; char c = pgm_read_byte(str); ++str) lcd_print(c);
251
+void lcd_printPGM_utf(const char* str, const uint8_t maxLength=LCD_WIDTH) {
252
+  char c;
253
+  for (uint8_t i = 0, n = maxLength; n && (c = str[i]); ++i)
254
+    n -= charset_mapper(c);
244
 }
255
 }
245
 
256
 
246
 // Initialize or re-initialize the LCD
257
 // Initialize or re-initialize the LCD
320
 void lcd_kill_screen() {
331
 void lcd_kill_screen() {
321
   lcd_setFont(FONT_MENU);
332
   lcd_setFont(FONT_MENU);
322
   u8g.setPrintPos(0, u8g.getHeight()/4*1);
333
   u8g.setPrintPos(0, u8g.getHeight()/4*1);
323
-  lcd_print(lcd_status_message);
334
+  lcd_print_utf(lcd_status_message);
324
   u8g.setPrintPos(0, u8g.getHeight()/4*2);
335
   u8g.setPrintPos(0, u8g.getHeight()/4*2);
325
   lcd_printPGM(PSTR(MSG_HALTED));
336
   lcd_printPGM(PSTR(MSG_HALTED));
326
   u8g.setPrintPos(0, u8g.getHeight()/4*3);
337
   u8g.setPrintPos(0, u8g.getHeight()/4*3);
395
   }
406
   }
396
 }
407
 }
397
 
408
 
409
+inline void lcd_implementation_status_message() {
410
+  #if ENABLED(STATUS_MESSAGE_SCROLLING)
411
+    lcd_print_utf(lcd_status_message + status_scroll_pos);
412
+    const uint8_t slen = lcd_strlen(lcd_status_message);
413
+    if (slen > LCD_WIDTH) {
414
+      // Skip any non-printing bytes
415
+      while (!charset_mapper(lcd_status_message[status_scroll_pos])) ++status_scroll_pos;
416
+      if (++status_scroll_pos > slen - LCD_WIDTH) status_scroll_pos = 0;
417
+    }
418
+  #else
419
+    lcd_print_utf(lcd_status_message);
420
+  #endif
421
+}
422
+
398
 //#define DOGM_SD_PERCENT
423
 //#define DOGM_SD_PERCENT
399
 
424
 
400
 static void lcd_implementation_status_screen() {
425
 static void lcd_implementation_status_screen() {
645
 
670
 
646
     #if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT)
671
     #if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT)
647
       if (PENDING(millis(), previous_lcd_status_ms + 5000UL)) {  //Display both Status message line and Filament display on the last line
672
       if (PENDING(millis(), previous_lcd_status_ms + 5000UL)) {  //Display both Status message line and Filament display on the last line
648
-        const char *str = lcd_status_message;
649
-        uint8_t i = LCD_WIDTH;
650
-        char c;
651
-        while (i-- && (c = *str++)) lcd_print(c);
673
+        lcd_implementation_status_message();
652
       }
674
       }
653
       else {
675
       else {
654
         lcd_printPGM(PSTR(LCD_STR_FILAM_DIA));
676
         lcd_printPGM(PSTR(LCD_STR_FILAM_DIA));
660
         u8g.print('%');
682
         u8g.print('%');
661
       }
683
       }
662
     #else
684
     #else
663
-      const char *str = lcd_status_message;
664
-      uint8_t i = LCD_WIDTH;
665
-      char c;
666
-      while (i-- && (c = *str++)) lcd_print(c);
685
+      lcd_implementation_status_message();
667
     #endif
686
     #endif
668
   }
687
   }
669
 }
688
 }

+ 25
- 12
Marlin/ultralcd_impl_HD44780.h View File

380
 
380
 
381
 void lcd_implementation_clear() { lcd.clear(); }
381
 void lcd_implementation_clear() { lcd.clear(); }
382
 
382
 
383
-/* Arduino < 1.0.0 is missing a function to print PROGMEM strings, so we need to implement our own */
384
-void lcd_printPGM(const char *str) {
385
-  for (; char c = pgm_read_byte(str); ++str) charset_mapper(c);
386
-}
383
+void lcd_print(const char c) { charset_mapper(c); }
384
+
385
+void lcd_print(const char * const str) { for (uint8_t i = 0; char c = str[i]; ++i) lcd.print(c); }
386
+void lcd_printPGM(const char* str) { for (; char c = pgm_read_byte(str); ++str) lcd.print(c); }
387
 
387
 
388
-void lcd_print(const char* const str) {
389
-  for (uint8_t i = 0; const char c = str[i]; ++i) charset_mapper(c);
388
+void lcd_print_utf(const char * const str, const uint8_t maxLength=LCD_WIDTH) {
389
+  char c;
390
+  for (uint8_t i = 0, n = maxLength; n && (c = str[i]); ++i)
391
+    n -= charset_mapper(c);
390
 }
392
 }
391
 
393
 
392
-void lcd_print(const char c) { charset_mapper(c); }
394
+void lcd_printPGM_utf(const char* str, const uint8_t maxLength=LCD_WIDTH) {
395
+  char c;
396
+  for (uint8_t i = 0, n = maxLength; n && (c = str[i]); ++i)
397
+    n -= charset_mapper(c);
398
+}
393
 
399
 
394
 #if ENABLED(SHOW_BOOTSCREEN)
400
 #if ENABLED(SHOW_BOOTSCREEN)
395
 
401
 
545
 
551
 
546
 void lcd_kill_screen() {
552
 void lcd_kill_screen() {
547
   lcd.setCursor(0, 0);
553
   lcd.setCursor(0, 0);
548
-  lcd_print(lcd_status_message);
554
+  lcd_print_utf(lcd_status_message);
549
   #if LCD_HEIGHT < 4
555
   #if LCD_HEIGHT < 4
550
     lcd.setCursor(0, 2);
556
     lcd.setCursor(0, 2);
551
   #else
557
   #else
818
 
824
 
819
   #endif // FILAMENT_LCD_DISPLAY && SDSUPPORT
825
   #endif // FILAMENT_LCD_DISPLAY && SDSUPPORT
820
 
826
 
821
-  const char *str = lcd_status_message;
822
-  uint8_t i = LCD_WIDTH;
823
-  char c;
824
-  while (i-- && (c = *str++)) lcd_print(c);
827
+  #if ENABLED(STATUS_MESSAGE_SCROLLING)
828
+    lcd_print_utf(lcd_status_message + status_scroll_pos);
829
+    const uint8_t slen = lcd_strlen(lcd_status_message);
830
+    if (slen > LCD_WIDTH) {
831
+      // Skip any non-printing bytes
832
+      while (!charset_mapper(lcd_status_message[status_scroll_pos])) ++status_scroll_pos;
833
+      if (++status_scroll_pos > slen - LCD_WIDTH) status_scroll_pos = 0;
834
+    }
835
+  #else
836
+    lcd_print_utf(lcd_status_message);
837
+  #endif
825
 }
838
 }
826
 
839
 
827
 #if ENABLED(ULTIPANEL)
840
 #if ENABLED(ULTIPANEL)

+ 14
- 14
Marlin/utility.cpp View File

57
   #define MINUSOR(n, alt) (n >= 0 ? (alt) : (n = -n, '-'))
57
   #define MINUSOR(n, alt) (n >= 0 ? (alt) : (n = -n, '-'))
58
 
58
 
59
   // Convert unsigned int to string with 12 format
59
   // Convert unsigned int to string with 12 format
60
-  char* itostr2(const uint8_t& xx) {
60
+  char* itostr2(const uint8_t &xx) {
61
     conv[5] = DIGIMOD(xx, 10);
61
     conv[5] = DIGIMOD(xx, 10);
62
     conv[6] = DIGIMOD(xx, 1);
62
     conv[6] = DIGIMOD(xx, 1);
63
     return &conv[5];
63
     return &conv[5];
64
   }
64
   }
65
 
65
 
66
   // Convert signed int to rj string with 123 or -12 format
66
   // Convert signed int to rj string with 123 or -12 format
67
-  char* itostr3(const int& x) {
67
+  char* itostr3(const int &x) {
68
     int xx = x;
68
     int xx = x;
69
     conv[4] = MINUSOR(xx, RJDIGIT(xx, 100));
69
     conv[4] = MINUSOR(xx, RJDIGIT(xx, 100));
70
     conv[5] = RJDIGIT(xx, 10);
70
     conv[5] = RJDIGIT(xx, 10);
73
   }
73
   }
74
 
74
 
75
   // Convert unsigned int to lj string with 123 format
75
   // Convert unsigned int to lj string with 123 format
76
-  char* itostr3left(const int& xx) {
76
+  char* itostr3left(const int &xx) {
77
     char *str = &conv[6];
77
     char *str = &conv[6];
78
     *str = DIGIMOD(xx, 1);
78
     *str = DIGIMOD(xx, 1);
79
     if (xx >= 10) {
79
     if (xx >= 10) {
85
   }
85
   }
86
 
86
 
87
   // Convert signed int to rj string with 1234, _123, -123, _-12, or __-1 format
87
   // Convert signed int to rj string with 1234, _123, -123, _-12, or __-1 format
88
-  char *itostr4sign(const int& x) {
88
+  char *itostr4sign(const int &x) {
89
     const bool neg = x < 0;
89
     const bool neg = x < 0;
90
     const int xx = neg ? -x : x;
90
     const int xx = neg ? -x : x;
91
     if (x >= 1000) {
91
     if (x >= 1000) {
116
   }
116
   }
117
 
117
 
118
   // Convert unsigned float to string with 1.23 format
118
   // Convert unsigned float to string with 1.23 format
119
-  char* ftostr12ns(const float& x) {
119
+  char* ftostr12ns(const float &x) {
120
     const long xx = (x < 0 ? -x : x) * 100;
120
     const long xx = (x < 0 ? -x : x) * 100;
121
     conv[3] = DIGIMOD(xx, 100);
121
     conv[3] = DIGIMOD(xx, 100);
122
     conv[4] = '.';
122
     conv[4] = '.';
126
   }
126
   }
127
 
127
 
128
   // Convert signed float to fixed-length string with 023.45 / -23.45 format
128
   // Convert signed float to fixed-length string with 023.45 / -23.45 format
129
-  char *ftostr32(const float& x) {
129
+  char *ftostr32(const float &x) {
130
     long xx = x * 100;
130
     long xx = x * 100;
131
     conv[1] = MINUSOR(xx, DIGIMOD(xx, 10000));
131
     conv[1] = MINUSOR(xx, DIGIMOD(xx, 10000));
132
     conv[2] = DIGIMOD(xx, 1000);
132
     conv[2] = DIGIMOD(xx, 1000);
140
   #if ENABLED(LCD_DECIMAL_SMALL_XY)
140
   #if ENABLED(LCD_DECIMAL_SMALL_XY)
141
 
141
 
142
     // Convert float to rj string with 1234, _123, -123, _-12, 12.3, _1.2, or -1.2 format
142
     // Convert float to rj string with 1234, _123, -123, _-12, 12.3, _1.2, or -1.2 format
143
-    char *ftostr4sign(const float& fx) {
143
+    char *ftostr4sign(const float &fx) {
144
       const int x = fx * 10;
144
       const int x = fx * 10;
145
       if (!WITHIN(x, -99, 999)) return itostr4sign((int)fx);
145
       if (!WITHIN(x, -99, 999)) return itostr4sign((int)fx);
146
       const bool neg = x < 0;
146
       const bool neg = x < 0;
155
   #endif // LCD_DECIMAL_SMALL_XY
155
   #endif // LCD_DECIMAL_SMALL_XY
156
 
156
 
157
   // Convert float to fixed-length string with +123.4 / -123.4 format
157
   // Convert float to fixed-length string with +123.4 / -123.4 format
158
-  char* ftostr41sign(const float& x) {
158
+  char* ftostr41sign(const float &x) {
159
     int xx = x * 10;
159
     int xx = x * 10;
160
     conv[1] = MINUSOR(xx, '+');
160
     conv[1] = MINUSOR(xx, '+');
161
     conv[2] = DIGIMOD(xx, 1000);
161
     conv[2] = DIGIMOD(xx, 1000);
167
   }
167
   }
168
 
168
 
169
   // Convert signed float to string (6 digit) with -1.234 / _0.000 / +1.234 format
169
   // Convert signed float to string (6 digit) with -1.234 / _0.000 / +1.234 format
170
-  char* ftostr43sign(const float& x, char plus/*=' '*/) {
170
+  char* ftostr43sign(const float &x, char plus/*=' '*/) {
171
     long xx = x * 1000;
171
     long xx = x * 1000;
172
     conv[1] = xx ? MINUSOR(xx, plus) : ' ';
172
     conv[1] = xx ? MINUSOR(xx, plus) : ' ';
173
     conv[2] = DIGIMOD(xx, 1000);
173
     conv[2] = DIGIMOD(xx, 1000);
179
   }
179
   }
180
 
180
 
181
   // Convert unsigned float to rj string with 12345 format
181
   // Convert unsigned float to rj string with 12345 format
182
-  char* ftostr5rj(const float& x) {
182
+  char* ftostr5rj(const float &x) {
183
     const long xx = x < 0 ? -x : x;
183
     const long xx = x < 0 ? -x : x;
184
     conv[2] = RJDIGIT(xx, 10000);
184
     conv[2] = RJDIGIT(xx, 10000);
185
     conv[3] = RJDIGIT(xx, 1000);
185
     conv[3] = RJDIGIT(xx, 1000);
190
   }
190
   }
191
 
191
 
192
   // Convert signed float to string with +1234.5 format
192
   // Convert signed float to string with +1234.5 format
193
-  char* ftostr51sign(const float& x) {
193
+  char* ftostr51sign(const float &x) {
194
     long xx = x * 10;
194
     long xx = x * 10;
195
     conv[0] = MINUSOR(xx, '+');
195
     conv[0] = MINUSOR(xx, '+');
196
     conv[1] = DIGIMOD(xx, 10000);
196
     conv[1] = DIGIMOD(xx, 10000);
203
   }
203
   }
204
 
204
 
205
   // Convert signed float to string with +123.45 format
205
   // Convert signed float to string with +123.45 format
206
-  char* ftostr52sign(const float& x) {
206
+  char* ftostr52sign(const float &x) {
207
     long xx = x * 100;
207
     long xx = x * 100;
208
     conv[0] = MINUSOR(xx, '+');
208
     conv[0] = MINUSOR(xx, '+');
209
     conv[1] = DIGIMOD(xx, 10000);
209
     conv[1] = DIGIMOD(xx, 10000);
216
   }
216
   }
217
 
217
 
218
   // Convert unsigned float to string with 1234.56 format omitting trailing zeros
218
   // Convert unsigned float to string with 1234.56 format omitting trailing zeros
219
-  char* ftostr62rj(const float& x) {
219
+  char* ftostr62rj(const float &x) {
220
     const long xx = (x < 0 ? -x : x) * 100;
220
     const long xx = (x < 0 ? -x : x) * 100;
221
     conv[0] = RJDIGIT(xx, 100000);
221
     conv[0] = RJDIGIT(xx, 100000);
222
     conv[1] = RJDIGIT(xx, 10000);
222
     conv[1] = RJDIGIT(xx, 10000);
229
   }
229
   }
230
 
230
 
231
   // Convert signed float to space-padded string with -_23.4_ format
231
   // Convert signed float to space-padded string with -_23.4_ format
232
-  char* ftostr52sp(const float& x) {
232
+  char* ftostr52sp(const float &x) {
233
     long xx = x * 100;
233
     long xx = x * 100;
234
     uint8_t dig;
234
     uint8_t dig;
235
     conv[1] = MINUSOR(xx, RJDIGIT(xx, 10000));
235
     conv[1] = MINUSOR(xx, RJDIGIT(xx, 10000));

+ 16
- 16
Marlin/utility.h View File

32
 #if ENABLED(ULTRA_LCD)
32
 #if ENABLED(ULTRA_LCD)
33
 
33
 
34
   // Convert unsigned int to string with 12 format
34
   // Convert unsigned int to string with 12 format
35
-  char* itostr2(const uint8_t& x);
35
+  char* itostr2(const uint8_t &x);
36
 
36
 
37
   // Convert signed int to rj string with 123 or -12 format
37
   // Convert signed int to rj string with 123 or -12 format
38
-  char* itostr3(const int& x);
38
+  char* itostr3(const int &x);
39
 
39
 
40
   // Convert unsigned int to lj string with 123 format
40
   // Convert unsigned int to lj string with 123 format
41
-  char* itostr3left(const int& xx);
41
+  char* itostr3left(const int &xx);
42
 
42
 
43
   // Convert signed int to rj string with _123, -123, _-12, or __-1 format
43
   // Convert signed int to rj string with _123, -123, _-12, or __-1 format
44
-  char *itostr4sign(const int& x);
44
+  char *itostr4sign(const int &x);
45
 
45
 
46
   // Convert unsigned float to string with 1.23 format
46
   // Convert unsigned float to string with 1.23 format
47
-  char* ftostr12ns(const float& x);
47
+  char* ftostr12ns(const float &x);
48
 
48
 
49
   // Convert signed float to fixed-length string with 023.45 / -23.45 format
49
   // Convert signed float to fixed-length string with 023.45 / -23.45 format
50
-  char *ftostr32(const float& x);
50
+  char *ftostr32(const float &x);
51
 
51
 
52
   // Convert float to fixed-length string with +123.4 / -123.4 format
52
   // Convert float to fixed-length string with +123.4 / -123.4 format
53
-  char* ftostr41sign(const float& x);
53
+  char* ftostr41sign(const float &x);
54
 
54
 
55
   // Convert signed float to string (6 digit) with -1.234 / _0.000 / +1.234 format
55
   // Convert signed float to string (6 digit) with -1.234 / _0.000 / +1.234 format
56
-  char* ftostr43sign(const float& x, char plus=' ');
56
+  char* ftostr43sign(const float &x, char plus=' ');
57
 
57
 
58
   // Convert unsigned float to rj string with 12345 format
58
   // Convert unsigned float to rj string with 12345 format
59
-  char* ftostr5rj(const float& x);
59
+  char* ftostr5rj(const float &x);
60
 
60
 
61
   // Convert signed float to string with +1234.5 format
61
   // Convert signed float to string with +1234.5 format
62
-  char* ftostr51sign(const float& x);
62
+  char* ftostr51sign(const float &x);
63
 
63
 
64
   // Convert signed float to space-padded string with -_23.4_ format
64
   // Convert signed float to space-padded string with -_23.4_ format
65
-  char* ftostr52sp(const float& x);
65
+  char* ftostr52sp(const float &x);
66
 
66
 
67
   // Convert signed float to string with +123.45 format
67
   // Convert signed float to string with +123.45 format
68
-  char* ftostr52sign(const float& x);
68
+  char* ftostr52sign(const float &x);
69
 
69
 
70
   // Convert unsigned float to string with 1234.56 format omitting trailing zeros
70
   // Convert unsigned float to string with 1234.56 format omitting trailing zeros
71
-  char* ftostr62rj(const float& x);
71
+  char* ftostr62rj(const float &x);
72
 
72
 
73
   // Convert float to rj string with 123 or -12 format
73
   // Convert float to rj string with 123 or -12 format
74
-  FORCE_INLINE char *ftostr3(const float& x) { return itostr3((int)x); }
74
+  FORCE_INLINE char *ftostr3(const float &x) { return itostr3((int)x); }
75
 
75
 
76
   #if ENABLED(LCD_DECIMAL_SMALL_XY)
76
   #if ENABLED(LCD_DECIMAL_SMALL_XY)
77
     // Convert float to rj string with 1234, _123, 12.3, _1.2, -123, _-12, or -1.2 format
77
     // Convert float to rj string with 1234, _123, 12.3, _1.2, -123, _-12, or -1.2 format
78
-    char *ftostr4sign(const float& fx);
78
+    char *ftostr4sign(const float &fx);
79
   #else
79
   #else
80
     // Convert float to rj string with 1234, _123, -123, __12, _-12, ___1, or __-1 format
80
     // Convert float to rj string with 1234, _123, -123, __12, _-12, ___1, or __-1 format
81
-    FORCE_INLINE char *ftostr4sign(const float& x) { return itostr4sign((int)x); }
81
+    FORCE_INLINE char *ftostr4sign(const float &x) { return itostr4sign((int)x); }
82
   #endif
82
   #endif
83
 
83
 
84
 #endif // ULTRA_LCD
84
 #endif // ULTRA_LCD

+ 1
- 1
Marlin/vector_3.h View File

77
 };
77
 };
78
 
78
 
79
 
79
 
80
-void apply_rotation_xyz(matrix_3x3 rotationMatrix, float& x, float& y, float& z);
80
+void apply_rotation_xyz(matrix_3x3 rotationMatrix, float &x, float &y, float &z);
81
 
81
 
82
 #endif // HAS_ABL
82
 #endif // HAS_ABL
83
 #endif // VECTOR_3_H
83
 #endif // VECTOR_3_H

Loading…
Cancel
Save