Browse Source

Fix various errors, warnings in example config builds (#19686)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
Jason Smith 4 years ago
parent
commit
c762b7c91b
No account linked to committer's email address

+ 3
- 5
Marlin/src/gcode/bedlevel/G26.cpp View File

511
        g26_keep_heaters_on       = parser.boolval('K');
511
        g26_keep_heaters_on       = parser.boolval('K');
512
 
512
 
513
   // Accept 'I' if temperature presets are defined
513
   // Accept 'I' if temperature presets are defined
514
-  const uint8_t preset_index = (0
515
-    #if PREHEAT_COUNT
516
-      + (parser.seenval('I') ? _MIN(parser.value_byte(), PREHEAT_COUNT - 1) + 1 : 0)
517
-    #endif
518
-  );
514
+  #if PREHEAT_COUNT
515
+    const uint8_t preset_index = parser.seenval('I') ? _MIN(parser.value_byte(), PREHEAT_COUNT - 1) + 1 : 0;
516
+  #endif
519
 
517
 
520
   #if HAS_HEATED_BED
518
   #if HAS_HEATED_BED
521
 
519
 

+ 1
- 1
Marlin/src/gcode/motion/M290.cpp View File

127
         #else
127
         #else
128
           PSTR("Babystep Z")
128
           PSTR("Babystep Z")
129
         #endif
129
         #endif
130
-        , babystep.axis_total[BS_AXIS_IND(Z_AXIS)]
130
+        , babystep.axis_total[BS_TOTAL_IND(Z_AXIS)]
131
       );
131
       );
132
     }
132
     }
133
     #endif
133
     #endif

+ 1
- 1
Marlin/src/lcd/dogm/dogm_Statusscreen.h View File

1341
     #undef STATUS_LOGO_WIDTH
1341
     #undef STATUS_LOGO_WIDTH
1342
   #endif
1342
   #endif
1343
 
1343
 
1344
-  #if (HAS_MULTI_HOTEND && STATUS_LOGO_WIDTH && BED_OR_CHAMBER_OR_FAN) || (HOTENDS >= 3 && !BED_OR_CHAMBER_OR_FAN)
1344
+  #if !defined(STATUS_HEATERS_X) && ((HAS_MULTI_HOTEND && STATUS_LOGO_WIDTH && BED_OR_CHAMBER_OR_FAN) || (HOTENDS >= 3 && !BED_OR_CHAMBER_OR_FAN))
1345
     #define _STATUS_HEATERS_X(H,S,N) ((LCD_PIXEL_WIDTH - (H * (S + N)) - (_EXTRA_WIDTH) + (STATUS_LOGO_WIDTH)) / 2)
1345
     #define _STATUS_HEATERS_X(H,S,N) ((LCD_PIXEL_WIDTH - (H * (S + N)) - (_EXTRA_WIDTH) + (STATUS_LOGO_WIDTH)) / 2)
1346
     #if STATUS_HOTEND1_WIDTH
1346
     #if STATUS_HOTEND1_WIDTH
1347
       #if HOTENDS > 2
1347
       #if HOTENDS > 2

+ 8
- 10
Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp View File

46
 
46
 
47
 extern lv_group_t * g;
47
 extern lv_group_t * g;
48
 static lv_obj_t * scr;
48
 static lv_obj_t * scr;
49
-static lv_obj_t *labelExt1, * labelExt2, * labelFan, * labelZpos, * labelTime;
49
+static lv_obj_t *labelExt1, * labelFan, * labelZpos, * labelTime;
50
+TERN_(HAS_MULTI_EXTRUDER, static lv_obj_t *labelExt2;)
50
 static lv_obj_t *labelPause, * labelStop, * labelOperat;
51
 static lv_obj_t *labelPause, * labelStop, * labelOperat;
51
 static lv_obj_t * bar1, *bar1ValueText;
52
 static lv_obj_t * bar1, *bar1ValueText;
52
 static lv_obj_t * buttonPause, *buttonOperat, *buttonStop;
53
 static lv_obj_t * buttonPause, *buttonOperat, *buttonStop;
137
 }
138
 }
138
 
139
 
139
 void lv_draw_printing(void) {
140
 void lv_draw_printing(void) {
140
-  lv_obj_t *buttonExt1, *buttonExt2, *buttonFanstate, *buttonZpos, *buttonTime;
141
-  TERN_(HAS_HEATED_BED, lv_obj_t * buttonBedstate);
142
-
143
   disp_state_stack._disp_index = 0;
141
   disp_state_stack._disp_index = 0;
144
   ZERO(disp_state_stack._disp_state);
142
   ZERO(disp_state_stack._disp_state);
145
   disp_state_stack._disp_state[disp_state_stack._disp_index] = PRINTING_UI;
143
   disp_state_stack._disp_state[disp_state_stack._disp_index] = PRINTING_UI;
162
   lv_refr_now(lv_refr_get_disp_refreshing());
160
   lv_refr_now(lv_refr_get_disp_refreshing());
163
 
161
 
164
   // Create image buttons
162
   // Create image buttons
165
-  buttonExt1 = lv_img_create(scr, NULL);
163
+  lv_obj_t *buttonExt1 = lv_img_create(scr, NULL);
166
   #if HAS_MULTI_EXTRUDER
164
   #if HAS_MULTI_EXTRUDER
167
-    buttonExt2 = lv_img_create(scr, NULL);
165
+    lv_obj_t *buttonExt2 = lv_img_create(scr, NULL);
168
   #endif
166
   #endif
169
   #if HAS_HEATED_BED
167
   #if HAS_HEATED_BED
170
-    buttonBedstate = lv_img_create(scr, NULL);
168
+    lv_obj_t *buttonBedstate = lv_img_create(scr, NULL);
171
   #endif
169
   #endif
172
-  buttonFanstate = lv_img_create(scr, NULL);
173
-  buttonTime     = lv_img_create(scr, NULL);
174
-  buttonZpos     = lv_img_create(scr, NULL);
170
+  lv_obj_t *buttonFanstate = lv_img_create(scr, NULL);
171
+  lv_obj_t *buttonTime     = lv_img_create(scr, NULL);
172
+  lv_obj_t *buttonZpos     = lv_img_create(scr, NULL);
175
   buttonPause    = lv_imgbtn_create(scr, NULL);
173
   buttonPause    = lv_imgbtn_create(scr, NULL);
176
   buttonStop     = lv_imgbtn_create(scr, NULL);
174
   buttonStop     = lv_imgbtn_create(scr, NULL);
177
   buttonOperat   = lv_imgbtn_create(scr, NULL);
175
   buttonOperat   = lv_imgbtn_create(scr, NULL);

+ 20
- 20
Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp View File

799
   //static const int8_t encoderDirection = 1;
799
   //static const int8_t encoderDirection = 1;
800
   //static int16_t enc_Direction;
800
   //static int16_t enc_Direction;
801
   void lv_update_encoder() {
801
   void lv_update_encoder() {
802
-    static uint8_t buttons;
803
     static uint32_t encoder_time1;
802
     static uint32_t encoder_time1;
804
     uint32_t tmpTime, diffTime = 0;
803
     uint32_t tmpTime, diffTime = 0;
805
     tmpTime = millis();
804
     tmpTime = millis();
806
     diffTime = getTickDiff(tmpTime, encoder_time1);
805
     diffTime = getTickDiff(tmpTime, encoder_time1);
807
     if (diffTime > 50) {
806
     if (diffTime > 50) {
808
 
807
 
809
-      #if ANY_BUTTON(EN1, EN2, ENC, BACK)
808
+      #if HAS_ENCODER_WHEEL
810
 
809
 
811
-        uint8_t newbutton = 0;
810
+        #if ANY_BUTTON(EN1, EN2, ENC, BACK)
812
 
811
 
813
-        #if BUTTON_EXISTS(EN1)
814
-          if (BUTTON_PRESSED(EN1)) newbutton |= EN_A;
815
-        #endif
816
-        #if BUTTON_EXISTS(EN2)
817
-          if (BUTTON_PRESSED(EN2)) newbutton |= EN_B;
818
-        #endif
819
-        #if BUTTON_EXISTS(ENC)
820
-          if (BUTTON_PRESSED(ENC)) newbutton |= EN_C;
821
-        #endif
822
-        #if BUTTON_EXISTS(BACK)
823
-          if (BUTTON_PRESSED(BACK)) newbutton |= EN_D;
824
-        #endif
812
+          uint8_t newbutton = 0;
825
 
813
 
826
-      #else
814
+          #if BUTTON_EXISTS(EN1)
815
+            if (BUTTON_PRESSED(EN1)) newbutton |= EN_A;
816
+          #endif
817
+          #if BUTTON_EXISTS(EN2)
818
+            if (BUTTON_PRESSED(EN2)) newbutton |= EN_B;
819
+          #endif
820
+          #if BUTTON_EXISTS(ENC)
821
+            if (BUTTON_PRESSED(ENC)) newbutton |= EN_C;
822
+          #endif
823
+          #if BUTTON_EXISTS(BACK)
824
+            if (BUTTON_PRESSED(BACK)) newbutton |= EN_D;
825
+          #endif
827
 
826
 
828
-        constexpr uint8_t newbutton = 0;
827
+        #else
829
 
828
 
830
-      #endif
829
+          constexpr uint8_t newbutton = 0;
831
 
830
 
832
-      buttons = newbutton;
831
+        #endif
833
 
832
 
834
-      #if HAS_ENCODER_WHEEL
833
+
834
+        static uint8_t buttons = newbutton;
835
         static uint8_t lastEncoderBits;
835
         static uint8_t lastEncoderBits;
836
 
836
 
837
         #define encrot0 0
837
         #define encrot0 0

+ 82
- 100
Marlin/src/lcd/extui/lib/mks_ui/wifi_upload.cpp View File

110
 // 230400b always manages to connect.
110
 // 230400b always manages to connect.
111
 static const uint32_t uploadBaudRates[] = { 460800, 230400, 115200, 74880 };
111
 static const uint32_t uploadBaudRates[] = { 460800, 230400, 115200, 74880 };
112
 
112
 
113
-
114
-
115
 signed char IsReady() {
113
 signed char IsReady() {
116
   return esp_upload.state == upload_idle;
114
   return esp_upload.state == upload_idle;
117
 }
115
 }
118
 
116
 
119
-
120
-
121
-
122
-
123
 void uploadPort_write(const uint8_t *buf, size_t len) {
117
 void uploadPort_write(const uint8_t *buf, size_t len) {
124
   #if 0
118
   #if 0
125
   int i;
119
   int i;
126
 
120
 
127
-  for(i = 0; i < len; i++) {
128
-    while (USART_GetFlagStatus(USART1, USART_FLAG_TC) == RESET);
129
-
130
-      USART_SendData(USART1, *(buf + i));
121
+  for (i = 0; i < len; i++) {
122
+    while (USART_GetFlagStatus(USART1, USART_FLAG_TC) == RESET) { /* nada */ }
123
+    USART_SendData(USART1, *(buf + i));
131
   }
124
   }
132
   #endif
125
   #endif
133
 }
126
 }
138
     return retChar;
131
     return retChar;
139
   else
132
   else
140
     return 0;
133
     return 0;
141
-
142
 }
134
 }
143
 
135
 
144
 int uploadPort_available() {
136
 int uploadPort_available() {
145
   return usartFifoAvailable(&WifiRxFifo);
137
   return usartFifoAvailable(&WifiRxFifo);
146
 }
138
 }
147
 
139
 
148
-
149
 void uploadPort_begin() {
140
 void uploadPort_begin() {
150
   esp_port_begin(1);
141
   esp_port_begin(1);
151
 }
142
 }
152
 
143
 
153
 void uploadPort_close() {
144
 void uploadPort_close() {
154
-
155
   //WIFI_COM.end();
145
   //WIFI_COM.end();
156
   //WIFI_COM.begin(115200, true);
146
   //WIFI_COM.begin(115200, true);
157
-
158
   esp_port_begin(0);
147
   esp_port_begin(0);
159
-
160
 }
148
 }
161
 
149
 
162
-
163
 void flushInput() {
150
 void flushInput() {
164
   while (uploadPort_available() != 0) {
151
   while (uploadPort_available() != 0) {
165
     (void)uploadPort_read();
152
     (void)uploadPort_read();
304
 
291
 
305
   *bodyLen = 0;
292
   *bodyLen = 0;
306
 
293
 
307
-
308
   while (state != done) {
294
   while (state != done) {
309
     uint8_t c;
295
     uint8_t c;
310
     EspUploadResult stat;
296
     EspUploadResult stat;
322
     }
308
     }
323
 
309
 
324
     // sufficient bytes have been received for the current state, process them
310
     // sufficient bytes have been received for the current state, process them
325
-    switch(state) {
326
-    case begin: // expecting frame start
327
-      c = uploadPort_read();
328
-      if (c != (uint8_t)0xC0) {
329
-        break;
330
-      }
331
-      state = header;
332
-      needBytes = 2;
311
+    switch (state) {
312
+      case begin: // expecting frame start
313
+        c = uploadPort_read();
314
+        if (c != (uint8_t)0xC0) {
315
+          break;
316
+        }
317
+        state = header;
318
+        needBytes = 2;
333
 
319
 
334
-      break;
335
-    case end:   // expecting frame end
336
-      c = uploadPort_read();
337
-      if (c != (uint8_t)0xC0) {
338
-        return slipFrame;
339
-      }
340
-      state = done;
320
+        break;
321
+      case end:   // expecting frame end
322
+        c = uploadPort_read();
323
+        if (c != (uint8_t)0xC0) {
324
+          return slipFrame;
325
+        }
326
+        state = done;
341
 
327
 
342
-      break;
328
+        break;
343
 
329
 
344
-    case header:  // reading an 8-byte header
345
-    case body:    // reading the response body
346
-      {
347
-        int rslt;
348
-        // retrieve a byte with SLIP decoding
349
-        rslt = ReadByte(&c, 1);
350
-        if (rslt != 1 && rslt != 2) {
351
-          // some error occurred
352
-          stat = (rslt == 0 || rslt == -2) ? slipData : slipFrame;
353
-          return stat;
354
-        }
355
-        else if (state == header) {
356
-          //store the header byte
357
-          hdr[hdrIdx++] = c;
358
-          if (hdrIdx >= headerLength) {
359
-            // get the body length, prepare a buffer for it
360
-            *bodyLen = (uint16_t)getData(2, hdr, 2);
361
-
362
-            // extract the value, if requested
363
-            if (valp != 0) {
364
-              *valp = getData(4, hdr, 4);
330
+      case header:  // reading an 8-byte header
331
+      case body:    // reading the response body
332
+        {
333
+          int rslt;
334
+          // retrieve a byte with SLIP decoding
335
+          rslt = ReadByte(&c, 1);
336
+          if (rslt != 1 && rslt != 2) {
337
+            // some error occurred
338
+            stat = (rslt == 0 || rslt == -2) ? slipData : slipFrame;
339
+            return stat;
340
+          }
341
+          else if (state == header) {
342
+            //store the header byte
343
+            hdr[hdrIdx++] = c;
344
+            if (hdrIdx >= headerLength) {
345
+              // get the body length, prepare a buffer for it
346
+              *bodyLen = (uint16_t)getData(2, hdr, 2);
347
+
348
+              // extract the value, if requested
349
+              if (valp != 0) {
350
+                *valp = getData(4, hdr, 4);
351
+              }
352
+
353
+              if (*bodyLen != 0) {
354
+                state = body;
355
+              }
356
+              else {
357
+                needBytes = 1;
358
+                state = end;
359
+              }
365
             }
360
             }
366
-
367
-            if (*bodyLen != 0) {
368
-              state = body;
361
+          }
362
+          else {
363
+            // Store the response body byte, check for completion
364
+            if (bodyIdx < ARRAY_SIZE(respBuf)) {
365
+              respBuf[bodyIdx] = c;
369
             }
366
             }
370
-            else {
367
+            ++bodyIdx;
368
+            if (bodyIdx >= *bodyLen) {
371
               needBytes = 1;
369
               needBytes = 1;
372
               state = end;
370
               state = end;
373
             }
371
             }
374
           }
372
           }
375
         }
373
         }
376
-        else {
377
-          // Store the response body byte, check for completion
378
-          if (bodyIdx < ARRAY_SIZE(respBuf)) {
379
-            respBuf[bodyIdx] = c;
380
-          }
381
-          ++bodyIdx;
382
-          if (bodyIdx >= *bodyLen) {
383
-            needBytes = 1;
384
-            state = end;
385
-          }
386
-        }
387
-      }
388
-      break;
374
+        break;
389
 
375
 
390
-    default:    // this shouldn't happen
391
-      return slipState;
376
+      default:    // this shouldn't happen
377
+        return slipState;
392
     }
378
     }
393
   }
379
   }
394
 
380
 
397
   opRet = (uint8_t)getData(1, hdr, 1);
383
   opRet = (uint8_t)getData(1, hdr, 1);
398
   // Sync packets often provoke a response with a zero opcode instead of ESP_SYNC
384
   // Sync packets often provoke a response with a zero opcode instead of ESP_SYNC
399
   if (resp != 0x01 || opRet != op) {
385
   if (resp != 0x01 || opRet != op) {
400
-//debug//printf("resp %02x %02x\n", resp, opRet);
386
+    //printf("resp %02x %02x\n", resp, opRet); //debug
401
     return respHeader;
387
     return respHeader;
402
   }
388
   }
403
 
389
 
432
 // 0xC0 and 0xDB replaced by the two-byte sequences {0xDB, 0xDC} and {0xDB, 0xDD} respectively.
418
 // 0xC0 and 0xDB replaced by the two-byte sequences {0xDB, 0xDC} and {0xDB, 0xDD} respectively.
433
 
419
 
434
 void writePacket(const uint8_t *hdr, size_t hdrLen, const uint8_t *data, size_t dataLen) {
420
 void writePacket(const uint8_t *hdr, size_t hdrLen, const uint8_t *data, size_t dataLen) {
435
-
436
-  WriteByteRaw(0xC0);       // send the packet start character
421
+  WriteByteRaw(0xC0);           // send the packet start character
437
   _writePacket(hdr, hdrLen);    // send the header
422
   _writePacket(hdr, hdrLen);    // send the header
438
-  _writePacket(data, dataLen);    // send the data block
439
-  WriteByteRaw(0xC0);       // send the packet end character
423
+  _writePacket(data, dataLen);  // send the data block
424
+  WriteByteRaw(0xC0);           // send the packet end character
440
 }
425
 }
441
 
426
 
442
 // Send a packet to the serial port while performing SLIP framing. The packet data comprises a header and an optional data block.
427
 // Send a packet to the serial port while performing SLIP framing. The packet data comprises a header and an optional data block.
443
 // This is like writePacket except that it does a fast block write for both the header and the main data with no SLIP encoding. Used to send sync commands.
428
 // This is like writePacket except that it does a fast block write for both the header and the main data with no SLIP encoding. Used to send sync commands.
444
 void writePacketRaw(const uint8_t *hdr, size_t hdrLen, const uint8_t *data, size_t dataLen) {
429
 void writePacketRaw(const uint8_t *hdr, size_t hdrLen, const uint8_t *data, size_t dataLen) {
445
-  WriteByteRaw(0xC0);       // send the packet start character
446
-  _writePacketRaw(hdr, hdrLen); // send the header
430
+  WriteByteRaw(0xC0);             // send the packet start character
431
+  _writePacketRaw(hdr, hdrLen);   // send the header
447
   _writePacketRaw(data, dataLen); // send the data block in raw mode
432
   _writePacketRaw(data, dataLen); // send the data block in raw mode
448
-  WriteByteRaw(0xC0);       // send the packet end character
433
+  WriteByteRaw(0xC0);             // send the packet end character
449
 }
434
 }
450
 
435
 
451
 // Send a command to the attached device together with the supplied data, if any.
436
 // Send a command to the attached device together with the supplied data, if any.
460
 
445
 
461
   // send the packet
446
   // send the packet
462
   //flushInput();
447
   //flushInput();
463
-  if (op == ESP_SYNC) {
448
+  if (op == ESP_SYNC)
464
     writePacketRaw(hdr, sizeof(hdr), data, dataLen);
449
     writePacketRaw(hdr, sizeof(hdr), data, dataLen);
465
-  }
466
-  else {
450
+  else
467
     writePacket(hdr, sizeof(hdr), data, dataLen);
451
     writePacket(hdr, sizeof(hdr), data, dataLen);
468
-  }
469
 }
452
 }
470
 
453
 
471
 // Send a command to the attached device together with the supplied data, if any, and get the response
454
 // Send a command to the attached device together with the supplied data, if any, and get the response
476
   sendCommand(op, checkVal, data, dataLen);
459
   sendCommand(op, checkVal, data, dataLen);
477
 
460
 
478
   stat = readPacket(op, valp, &bodyLen, msTimeout);
461
   stat = readPacket(op, valp, &bodyLen, msTimeout);
479
-  if (stat == success && bodyLen != 2) {
462
+  if (stat == success && bodyLen != 2)
480
     stat = badReply;
463
     stat = badReply;
481
-  }
482
 
464
 
483
   return stat;
465
   return stat;
484
 }
466
 }
611
   //printf("Upload %d\%\n", ftell(&esp_upload.uploadFile) * 100 / esp_upload.fileSize);
593
   //printf("Upload %d\%\n", ftell(&esp_upload.uploadFile) * 100 / esp_upload.fileSize);
612
 
594
 
613
   return stat;
595
   return stat;
596
+  #else
597
+    return success;
614
   #endif
598
   #endif
615
 }
599
 }
616
 
600
 
625
       esp_upload.uploadResult = connected;
609
       esp_upload.uploadResult = connected;
626
       esp_upload.state = done;
610
       esp_upload.state = done;
627
     }
611
     }
628
-    else{
612
+    else {
629
 
613
 
630
       // Reset the serial port at the new baud rate. Also reset the ESP8266.
614
       // Reset the serial port at the new baud rate. Also reset the ESP8266.
631
-    //  const uint32_t baud = uploadBaudRates[esp_upload.connectAttemptNumber/esp_upload.retriesPerBaudRate];
615
+      //  const uint32_t baud = uploadBaudRates[esp_upload.connectAttemptNumber/esp_upload.retriesPerBaudRate];
632
       if (esp_upload.connectAttemptNumber % esp_upload.retriesPerBaudRate == 0) {
616
       if (esp_upload.connectAttemptNumber % esp_upload.retriesPerBaudRate == 0) {
633
       }
617
       }
634
-    //  uploadPort.begin(baud);
635
-    //  uploadPort_close();
636
-
618
+      //uploadPort.begin(baud);
619
+      //uploadPort_close();
637
 
620
 
638
       uploadPort_begin();
621
       uploadPort_begin();
639
 
622
 
654
       esp_upload.lastAttemptTime = getWifiTick();
637
       esp_upload.lastAttemptTime = getWifiTick();
655
       if (res == success) {
638
       if (res == success) {
656
         // Successful connection
639
         // Successful connection
657
-//        //MessageF(" success on attempt %d\n", (connectAttemptNumber % retriesPerBaudRate) + 1);
640
+        //MessageF(" success on attempt %d\n", (connectAttemptNumber % retriesPerBaudRate) + 1);
658
         //printf("connect success\n");
641
         //printf("connect success\n");
659
         esp_upload.state = erasing;
642
         esp_upload.state = erasing;
660
       }
643
       }
675
       const uint32_t sectorSize = 4096;
658
       const uint32_t sectorSize = 4096;
676
       const uint32_t numSectors = (esp_upload.fileSize + sectorSize - 1)/sectorSize;
659
       const uint32_t numSectors = (esp_upload.fileSize + sectorSize - 1)/sectorSize;
677
       const uint32_t startSector = esp_upload.uploadAddress/sectorSize;
660
       const uint32_t startSector = esp_upload.uploadAddress/sectorSize;
661
+
678
       uint32_t headSectors = sectorsPerBlock - (startSector % sectorsPerBlock);
662
       uint32_t headSectors = sectorsPerBlock - (startSector % sectorsPerBlock);
663
+      NOMORE(headSectors, numSectors);
679
 
664
 
680
-      if (numSectors < headSectors) {
681
-        headSectors = numSectors;
682
-      }
683
-            eraseSize = (numSectors < 2 * headSectors)
684
-                      ? (numSectors + 1) / 2 * sectorSize
685
-                      : (numSectors - headSectors) * sectorSize;
665
+      eraseSize = (numSectors < 2 * headSectors)
666
+                ? (numSectors + 1) / 2 * sectorSize
667
+                : (numSectors - headSectors) * sectorSize;
686
 
668
 
687
       //MessageF("Erasing %u bytes...\n", fileSize);
669
       //MessageF("Erasing %u bytes...\n", fileSize);
688
       esp_upload.uploadResult = flashBegin(esp_upload.uploadAddress, eraseSize);
670
       esp_upload.uploadResult = flashBegin(esp_upload.uploadAddress, eraseSize);
755
 
737
 
756
   if (res !=  FR_OK) return;
738
   if (res !=  FR_OK) return;
757
 
739
 
758
-    esp_upload.fileSize = f_size(&esp_upload.uploadFile);
740
+  esp_upload.fileSize = f_size(&esp_upload.uploadFile);
759
   if (esp_upload.fileSize == 0) {
741
   if (esp_upload.fileSize == 0) {
760
     f_close(&esp_upload.uploadFile);
742
     f_close(&esp_upload.uploadFile);
761
     return;
743
     return;

+ 1
- 1
Marlin/src/lcd/menu/menu_delta_calibrate.cpp View File

118
 }
118
 }
119
 
119
 
120
 void menu_delta_calibrate() {
120
 void menu_delta_calibrate() {
121
-  const bool all_homed = all_axes_homed();
121
+  TERN_(DELTA_CALIBRATION_MENU, const bool all_homed = all_axes_homed()); // Acquire ahead of loop
122
 
122
 
123
   START_MENU();
123
   START_MENU();
124
   BACK_ITEM(MSG_MAIN);
124
   BACK_ITEM(MSG_MAIN);

+ 1
- 2
Marlin/src/lcd/menu/menu_ubl.cpp View File

188
    */
188
    */
189
   void _lcd_ubl_validate_custom_mesh() {
189
   void _lcd_ubl_validate_custom_mesh() {
190
     char ubl_lcd_gcode[24];
190
     char ubl_lcd_gcode[24];
191
-    const int16_t temp = TERN(HAS_HEATED_BED, custom_bed_temp, 0);
192
     sprintf_P(ubl_lcd_gcode, PSTR("G28\nG26 C P H%" PRIi16 TERN_(HAS_HEATED_BED, " B%" PRIi16))
191
     sprintf_P(ubl_lcd_gcode, PSTR("G28\nG26 C P H%" PRIi16 TERN_(HAS_HEATED_BED, " B%" PRIi16))
193
       , custom_hotend_temp
192
       , custom_hotend_temp
194
       #if HAS_HEATED_BED
193
       #if HAS_HEATED_BED
195
-        , temp
194
+        , custom_bed_temp
196
       #endif
195
       #endif
197
     );
196
     );
198
     queue.inject(ubl_lcd_gcode);
197
     queue.inject(ubl_lcd_gcode);

+ 1
- 2
Marlin/src/module/thermistor/thermistor_666.h View File

33
  * B: 0.00031362
33
  * B: 0.00031362
34
  * C: -2.03978e-07
34
  * C: -2.03978e-07
35
  */
35
  */
36
-#define NUMTEMPS 61
37
-const short temptable_666[NUMTEMPS][2] PROGMEM = {
36
+const temp_entry_t temptable_666[] PROGMEM = {
38
   { OV(  1), 794 },
37
   { OV(  1), 794 },
39
   { OV( 18), 288 },
38
   { OV( 18), 288 },
40
   { OV( 35), 234 },
39
   { OV( 35), 234 },

+ 14
- 15
Marlin/src/pins/sensitive_pins.h View File

608
   #define _Z_PROBE
608
   #define _Z_PROBE
609
 #endif
609
 #endif
610
 
610
 
611
-#if TEMP_SENSOR_BED && PIN_EXISTS(HEATER_BED)
612
-  #define _HEATER_BED HEATER_BED_PIN,
613
-#else
614
-  #define _HEATER_BED
615
-#endif
616
-
617
 #if PIN_EXISTS(FAN)
611
 #if PIN_EXISTS(FAN)
618
   #define _FAN0 FAN_PIN,
612
   #define _FAN0 FAN_PIN,
619
 #else
613
 #else
660
   #define _FANC
654
   #define _FANC
661
 #endif
655
 #endif
662
 
656
 
663
-#if PIN_EXISTS(HEATER_BED) && PIN_EXISTS(TEMP_BED)
657
+#if TEMP_SENSOR_BED && PINS_EXIST(TEMP_BED, HEATER_BED)
664
   #define _BED_PINS HEATER_BED_PIN, analogInputToDigitalPin(TEMP_BED_PIN),
658
   #define _BED_PINS HEATER_BED_PIN, analogInputToDigitalPin(TEMP_BED_PIN),
665
 #else
659
 #else
666
   #define _BED_PINS
660
   #define _BED_PINS
667
 #endif
661
 #endif
668
 
662
 
669
-#if PIN_EXISTS(TEMP_CHAMBER)
670
-  #define __CHAMBER_PINS CHAMBER_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_CHAMBER_PIN),
663
+#if TEMP_SENSOR_CHAMBER && PIN_EXISTS(TEMP_CHAMBER)
664
+  #define _CHAMBER_TEMP analogInputToDigitalPin(TEMP_CHAMBER_PIN),
665
+#else
666
+  #define _CHAMBER_TEMP
667
+#endif
668
+#if TEMP_SENSOR_CHAMBER && PINS_EXIST(TEMP_CHAMBER, HEATER_CHAMBER)
669
+  #define _CHAMBER_HEATER HEATER_CHAMBER_PIN,
671
 #else
670
 #else
672
-  #define __CHAMBER_PINS
671
+  #define _CHAMBER_HEATER
673
 #endif
672
 #endif
674
-#if PIN_EXISTS(HEATER_CHAMBER)
675
-  #define _CHAMBER_PINS __CHAMBER_PINS HEATER_CHAMBER_PIN,
673
+#if TEMP_SENSOR_CHAMBER && PINS_EXIST(TEMP_CHAMBER, CHAMBER_AUTO_FAN)
674
+  #define _CHAMBER_FAN CHAMBER_AUTO_FAN_PIN,
676
 #else
675
 #else
677
-  #define _CHAMBER_PINS
676
+  #define _CHAMBER_FAN
678
 #endif
677
 #endif
679
 
678
 
680
 #ifndef HAL_SENSITIVE_PINS
679
 #ifndef HAL_SENSITIVE_PINS
685
   _X_PINS _Y_PINS _Z_PINS _X2_PINS _Y2_PINS _Z2_PINS _Z3_PINS _Z4_PINS _Z_PROBE \
684
   _X_PINS _Y_PINS _Z_PINS _X2_PINS _Y2_PINS _Z2_PINS _Z3_PINS _Z4_PINS _Z_PROBE \
686
   _E0_PINS _E1_PINS _E2_PINS _E3_PINS _E4_PINS _E5_PINS _E6_PINS _E7_PINS \
685
   _E0_PINS _E1_PINS _E2_PINS _E3_PINS _E4_PINS _E5_PINS _E6_PINS _E7_PINS \
687
   _H0_PINS _H1_PINS _H2_PINS _H3_PINS _H4_PINS _H5_PINS _H6_PINS _H7_PINS \
686
   _H0_PINS _H1_PINS _H2_PINS _H3_PINS _H4_PINS _H5_PINS _H6_PINS _H7_PINS \
688
-  _PS_ON _HEATER_BED _FAN0 _FAN1 _FAN2 _FAN3 _FAN4 _FAN5 _FAN6 _FAN7 _FANC \
689
-  _BED_PINS _CHAMBER_PINS HAL_SENSITIVE_PINS \
687
+  _PS_ON _FAN0 _FAN1 _FAN2 _FAN3 _FAN4 _FAN5 _FAN6 _FAN7 _FANC \
688
+  _BED_PINS _CHAMBER_TEMP _CHAMBER_HEATER _CHAMBER_FAN HAL_SENSITIVE_PINS \
690
 }
689
 }

+ 1
- 0
Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h View File

200
 #elif SD_CONNECTION_IS(ONBOARD)
200
 #elif SD_CONNECTION_IS(ONBOARD)
201
   #define SDIO_SUPPORT
201
   #define SDIO_SUPPORT
202
   #define SD_DETECT_PIN                     PD12
202
   #define SD_DETECT_PIN                     PD12
203
+  #define ONBOARD_SD_CS_PIN                 PC11
203
 #elif SD_CONNECTION_IS(CUSTOM_CABLE)
204
 #elif SD_CONNECTION_IS(CUSTOM_CABLE)
204
   #error "No custom SD drive cable defined for this board."
205
   #error "No custom SD drive cable defined for this board."
205
 #endif
206
 #endif

Loading…
Cancel
Save