Browse Source

misc. cleanup

Scott Lahteine 3 years ago
parent
commit
fd270ddc6c

+ 3
- 3
Marlin/src/HAL/STM32/tft/tft_spi.cpp View File

207
   while ((SPIx.Instance->SR & SPI_FLAG_BSY) == SPI_FLAG_BSY) {}
207
   while ((SPIx.Instance->SR & SPI_FLAG_BSY) == SPI_FLAG_BSY) {}
208
 
208
 
209
   if (TFT_MISO_PIN != TFT_MOSI_PIN)
209
   if (TFT_MISO_PIN != TFT_MOSI_PIN)
210
-    __HAL_SPI_CLEAR_OVRFLAG(&SPIx);   /* Clear overrun flag in 2 Lines communication mode because received is not read */
210
+    __HAL_SPI_CLEAR_OVRFLAG(&SPIx);   // Clear overrun flag in 2 Lines communication mode because received is not read
211
 }
211
 }
212
 
212
 
213
 void TFT_SPI::TransmitDMA(uint32_t MemoryIncrease, uint16_t *Data, uint16_t Count) {
213
 void TFT_SPI::TransmitDMA(uint32_t MemoryIncrease, uint16_t *Data, uint16_t Count) {
214
   // Wait last dma finish, to start another
214
   // Wait last dma finish, to start another
215
-  while(isBusy()) { }
215
+  while (isBusy()) { /* nada */ }
216
 
216
 
217
   DMAtx.Init.MemInc = MemoryIncrease;
217
   DMAtx.Init.MemInc = MemoryIncrease;
218
   HAL_DMA_Init(&DMAtx);
218
   HAL_DMA_Init(&DMAtx);
225
   HAL_DMA_Start(&DMAtx, (uint32_t)Data, (uint32_t)&(SPIx.Instance->DR), Count);
225
   HAL_DMA_Start(&DMAtx, (uint32_t)Data, (uint32_t)&(SPIx.Instance->DR), Count);
226
   __HAL_SPI_ENABLE(&SPIx);
226
   __HAL_SPI_ENABLE(&SPIx);
227
 
227
 
228
-  SET_BIT(SPIx.Instance->CR2, SPI_CR2_TXDMAEN);   /* Enable Tx DMA Request */
228
+  SET_BIT(SPIx.Instance->CR2, SPI_CR2_TXDMAEN);   // Enable Tx DMA Request
229
 
229
 
230
   HAL_DMA_PollForTransfer(&DMAtx, HAL_DMA_FULL_TRANSFER, HAL_MAX_DELAY);
230
   HAL_DMA_PollForTransfer(&DMAtx, HAL_DMA_FULL_TRANSFER, HAL_MAX_DELAY);
231
   Abort();
231
   Abort();

+ 2
- 2
Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft.cpp View File

310
 
310
 
311
   bool ChironTFT::ReadTFTCommand() {
311
   bool ChironTFT::ReadTFTCommand() {
312
     bool command_ready = false;
312
     bool command_ready = false;
313
-    while(TFTSer.available() > 0 && command_len < MAX_CMND_LEN) {
313
+    while (TFTSer.available() > 0 && command_len < MAX_CMND_LEN) {
314
       panel_command[command_len] = TFTSer.read();
314
       panel_command[command_len] = TFTSer.read();
315
       if (panel_command[command_len] == '\n') {
315
       if (panel_command[command_len] == '\n') {
316
         command_ready = true;
316
         command_ready = true;
338
 
338
 
339
   int8_t ChironTFT::Findcmndpos(const char * buff, char q) {
339
   int8_t ChironTFT::Findcmndpos(const char * buff, char q) {
340
     int8_t pos = 0;
340
     int8_t pos = 0;
341
-    do { if (buff[pos] == q) return pos; } while(++pos < MAX_CMND_LEN);
341
+    do { if (buff[pos] == q) return pos; } while (++pos < MAX_CMND_LEN);
342
     return -1;
342
     return -1;
343
   }
343
   }
344
 
344
 

+ 1
- 1
Marlin/src/lcd/extui/lib/dgus/mks/DGUSScreenHandler.cpp View File

264
 
264
 
265
   void DGUSScreenHandler::SDPrintingFinished() {
265
   void DGUSScreenHandler::SDPrintingFinished() {
266
     if (DGUSAutoTurnOff) {
266
     if (DGUSAutoTurnOff) {
267
-      while(!queue.ring_buffer.empty()) queue.advance();
267
+      while (!queue.ring_buffer.empty()) queue.advance();
268
       gcode.process_subcommands_now_P(PSTR("M81"));
268
       gcode.process_subcommands_now_P(PSTR("M81"));
269
     }
269
     }
270
     GotoScreen(MKSLCD_SCREEN_PrintDone);
270
     GotoScreen(MKSLCD_SCREEN_PrintDone);

+ 4
- 2
Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp View File

66
     //root2.rewind();
66
     //root2.rewind();
67
     //SERIAL_ECHOLN(list_file.curDirPath);
67
     //SERIAL_ECHOLN(list_file.curDirPath);
68
 
68
 
69
-    if (curDirLever != 0) card.cd(list_file.curDirPath);
70
-    else card.cdroot(); // while(card.cdup());
69
+    if (curDirLever != 0)
70
+      card.cd(list_file.curDirPath);
71
+    else
72
+      card.cdroot();
71
 
73
 
72
     const uint16_t fileCnt = card.get_num_Files();
74
     const uint16_t fileCnt = card.get_num_Files();
73
 
75
 

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

476
         if (position_is_reachable(xy)) break; // Found a valid point
476
         if (position_is_reachable(xy)) break; // Found a valid point
477
         ui.encoderPosition += step_dir;       // Test the next point
477
         ui.encoderPosition += step_dir;       // Test the next point
478
       #endif
478
       #endif
479
-    } while(ENABLED(IS_KINEMATIC));
479
+    } while (ENABLED(IS_KINEMATIC));
480
 
480
 
481
     // Determine number of points to edit
481
     // Determine number of points to edit
482
     #if IS_KINEMATIC
482
     #if IS_KINEMATIC

Loading…
Cancel
Save