Ver código fonte

Various general cleanups

Mostly from the L6470-oriented PR
Scott Lahteine 5 anos atrás
pai
commit
ce563d7c2e

+ 3
- 3
Marlin/src/HAL/HAL_DUE/EepromEmulation_Due.cpp Ver arquivo

@@ -120,14 +120,14 @@ static uint8_t buffer[256] = {0},   // The RAM buffer to accumulate writes
120 120
     const uint8_t* c = (const uint8_t*) data;
121 121
     char buffer[80];
122 122
 
123
-    sprintf(buffer, "Page: %d (0x%04x)\n", page, page);
123
+    sprintf_P(buffer, PSTR("Page: %d (0x%04x)\n"), page, page);
124 124
     SERIAL_ECHO(buffer);
125 125
 
126 126
     char* p = &buffer[0];
127 127
     for (int i = 0; i< PageSize; ++i) {
128
-      if ((i & 0xF) == 0) p += sprintf(p,"%04x] ", i);
128
+      if ((i & 0xF) == 0) p += sprintf_P(p, PSTR("%04x] "), i);
129 129
 
130
-      p += sprintf(p," %02x", c[i]);
130
+      p += sprintf_P(p, PSTR(" %02x"), c[i]);
131 131
       if ((i & 0xF) == 0xF) {
132 132
         *p++ = '\n';
133 133
         *p = 0;

+ 1
- 1
Marlin/src/HAL/HAL_DUE/pinsDebug.h Ver arquivo

@@ -71,7 +71,7 @@
71 71
 #define GET_ARRAY_PIN(p) pin_array[p].pin
72 72
 #define VALID_PIN(pin) (pin >= 0 && pin < (int8_t)NUMBER_PINS_TOTAL ? 1 : 0)
73 73
 #define DIGITAL_PIN_TO_ANALOG_PIN(p) int(p - analogInputToDigitalPin(0))
74
-#define IS_ANALOG(P) (((P) >= analogInputToDigitalPin(0)) && ((P) <= analogInputToDigitalPin(NUM_ANALOG_INPUTS - 1)))
74
+#define IS_ANALOG(P) WITHIN(P, char(analogInputToDigitalPin(0)), char(analogInputToDigitalPin(NUM_ANALOG_INPUTS - 1)))
75 75
 #define pwm_status(pin) (((g_pinStatus[pin] & 0xF) == PIN_STATUS_PWM) && \
76 76
                         ((g_APinDescription[pin].ulPinAttribute & PIN_ATTR_PWM) == PIN_ATTR_PWM))
77 77
 #define MULTI_NAME_PAD 14 // space needed to be pretty if not first name assigned to a pin

+ 2
- 2
Marlin/src/HAL/HAL_DUE/usb/sd_mmc_spi_mem.cpp Ver arquivo

@@ -66,7 +66,7 @@ Ctrl_status sd_mmc_spi_usb_read_10(uint32_t addr, uint16_t nb_sector) {
66 66
 
67 67
   #ifdef DEBUG_MMC
68 68
     char buffer[80];
69
-    sprintf(buffer, "SDRD: %d @ 0x%08x\n", nb_sector, addr);
69
+    sprintf_P(buffer, PSTR("SDRD: %d @ 0x%08x\n"), nb_sector, addr);
70 70
     SERIAL_ECHO_P(0, buffer);
71 71
   #endif
72 72
 
@@ -100,7 +100,7 @@ Ctrl_status sd_mmc_spi_usb_write_10(uint32_t addr, uint16_t nb_sector) {
100 100
 
101 101
   #ifdef DEBUG_MMC
102 102
     char buffer[80];
103
-    sprintf(buffer, "SDWR: %d @ 0x%08x\n", nb_sector, addr);
103
+    sprintf_P(buffer, PSTR("SDWR: %d @ 0x%08x\n"), nb_sector, addr);
104 104
     SERIAL_ECHO_P(0, buffer);
105 105
   #endif
106 106
 

+ 5
- 5
Marlin/src/HAL/HAL_TEENSY35_36/pinsDebug.h Ver arquivo

@@ -53,16 +53,16 @@
53 53
 #define IS_ANALOG(P) ((P) >= analogInputToDigitalPin(0) && (P) <= analogInputToDigitalPin(9)) || ((P) >= analogInputToDigitalPin(12) && (P) <= analogInputToDigitalPin(20))
54 54
 
55 55
 void HAL_print_analog_pin(char buffer[], int8_t pin) {
56
-  if (pin <= 23)      sprintf(buffer, "(A%2d)  ", int(pin - 14));
57
-  else if (pin <= 39) sprintf(buffer, "(A%2d)  ", int(pin - 19));
56
+  if (pin <= 23)      sprintf_P(buffer, PSTR("(A%2d)  "), int(pin - 14));
57
+  else if (pin <= 39) sprintf_P(buffer, PSTR("(A%2d)  "), int(pin - 19));
58 58
 }
59 59
 
60 60
 void HAL_analog_pin_state(char buffer[], int8_t pin) {
61
-  if (pin <= 23)      sprintf(buffer, "Analog in =% 5d", analogRead(pin - 14));
62
-  else if (pin <= 39) sprintf(buffer, "Analog in =% 5d", analogRead(pin - 19));
61
+  if (pin <= 23)      sprintf_P(buffer, PSTR("Analog in =% 5d"), analogRead(pin - 14));
62
+  else if (pin <= 39) sprintf_P(buffer, PSTR("Analog in =% 5d"), analogRead(pin - 19));
63 63
 }
64 64
 
65
-#define PWM_PRINT(V) do{ sprintf(buffer, "PWM:  %4d", 22); SERIAL_ECHO(buffer); }while(0)
65
+#define PWM_PRINT(V) do{ sprintf_P(buffer, PSTR("PWM:  %4d"), 22); SERIAL_ECHO(buffer); }while(0)
66 66
 #define FTM_CASE(N,Z) \
67 67
   case FTM##N##_CH##Z##_PIN: \
68 68
     if (FTM##N##_C##Z##V) { \

+ 2
- 4
Marlin/src/config/examples/3DFabXYZ/Migbot/Configuration_adv.h Ver arquivo

@@ -1788,10 +1788,8 @@
1788 1788
 
1789 1789
   #define USER_DESC_1 "Test Print"
1790 1790
   #define USER_GCODE_1 "G28\nG29\nG26"
1791
-/*
1792
-  #define USER_DESC_1 "Home & UBL Info"
1793
-  #define USER_GCODE_1 "G28\nG29 W"
1794 1791
 
1792
+  /*
1795 1793
   #define USER_DESC_2 "Preheat for " PREHEAT_1_LABEL
1796 1794
   #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND)
1797 1795
 
@@ -1803,7 +1801,7 @@
1803 1801
 
1804 1802
   #define USER_DESC_5 "Home & Info"
1805 1803
   #define USER_GCODE_5 "G28\nM503"
1806
-*/  
1804
+  */
1807 1805
 #endif
1808 1806
 
1809 1807
 /**

+ 1
- 3
Marlin/src/core/macros.h Ver arquivo

@@ -56,9 +56,7 @@
56 56
 #define NANOSECONDS_PER_CYCLE (1000000000.0 / F_CPU)
57 57
 
58 58
 // Remove compiler warning on an unused variable
59
-#if !defined(ARDUINO_ARCH_STM32) || defined(STM32GENERIC)
60
-  #define UNUSED(x) ((void)(x))
61
-#endif
59
+#define UNUSED(x) ((void)(x))
62 60
 
63 61
 // Macros to make a string from a macro
64 62
 #define STRINGIFY_(M) #M

+ 2
- 1
Marlin/src/gcode/config/M302.cpp Ver arquivo

@@ -54,7 +54,8 @@ void GcodeSuite::M302() {
54 54
   else if (!seen_S) {
55 55
     // Report current state
56 56
     SERIAL_ECHO_START();
57
-    SERIAL_ECHOPAIR("Cold extrudes are ", (thermalManager.allow_cold_extrude ? "en" : "dis"));
57
+    SERIAL_ECHOPGM("Cold extrudes are ");
58
+    serialprintPGM(thermalManager.allow_cold_extrude ? PSTR("en") : PSTR("dis"));
58 59
     SERIAL_ECHOPAIR("abled (min temp ", thermalManager.extrude_min_temp);
59 60
     SERIAL_ECHOLNPGM("C)");
60 61
   }

+ 1
- 1
Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.cpp Ver arquivo

@@ -110,7 +110,7 @@ bool Sd2Card::init(const uint8_t sckRateID/*=0*/, const pin_t chipSelectPin/*=SD
110 110
 
111 111
   const uint32_t sectorSize = bulk.GetSectorSize(0);
112 112
   if (sectorSize != 512) {
113
-    SERIAL_ECHOLNPAIR("Expecting sector size of 512, got:", sectorSize);
113
+    SERIAL_ECHOLNPAIR("Expecting sector size of 512. Got: ", sectorSize);
114 114
     return false;
115 115
   }
116 116
 

+ 1
- 1
Marlin/src/sd/usb_flashdrive/usb_host.cpp Ver arquivo

@@ -127,7 +127,7 @@ bool MAX3421e::start() {
127 127
 
128 128
   const uint8_t revision = regRd(rREVISION);
129 129
   if (revision == 0x00 || revision == 0xFF) {
130
-    SERIAL_ECHOLNPAIR("Revision register appears incorrect on MAX3421e initialization, got ", revision);
130
+    SERIAL_ECHOLNPAIR("Revision register appears incorrect on MAX3421e initialization. Got ", revision);
131 131
     return false;
132 132
   }
133 133
 

+ 3
- 0
buildroot/share/atom/auto_build.py Ver arquivo

@@ -105,6 +105,7 @@ current_OS = platform.system()
105 105
 target_env = ''
106 106
 board_name = ''
107 107
 
108
+from datetime import datetime, date, time
108 109
 
109 110
 #########
110 111
 #  Python 2 error messages:
@@ -892,6 +893,8 @@ def run_PIO(dummy):
892 893
     write_to_screen_queue('\nBoard name: ' + board_name  + '\n')  # put build info at the bottom of the screen
893 894
     write_to_screen_queue('Build type: ' + build_type  + '\n')
894 895
     write_to_screen_queue('Environment used: ' + target_env  + '\n')
896
+    write_to_screen_queue(str(datetime.now()) + '\n')
897
+
895 898
 # end - run_PIO
896 899
 
897 900
 

Carregando…
Cancelar
Salvar