diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index bdaf3e2cf4..e55f0de744 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -784,7 +784,7 @@ #define RESTORE_LEVELING_AFTER_G35 // Add a menu item for Assisted Tramming - //#define ASSISTED_TRAMMING_MENU_ITEM + #define ASSISTED_TRAMMING_MENU_ITEM /** * Screw thread: diff --git a/Marlin/src/module/mks_wifi/mks_wifi.cpp b/Marlin/src/module/mks_wifi/mks_wifi.cpp index 5b412dfd02..01c45d7b4e 100644 --- a/Marlin/src/module/mks_wifi/mks_wifi.cpp +++ b/Marlin/src/module/mks_wifi/mks_wifi.cpp @@ -134,6 +134,7 @@ uint8_t mks_wifi_input(uint8_t data){ //Не отдавать данные в очередь команд, если идет печать if (CardReader::isPrinting()){ + DEBUG("No input while printing"); return 1; } @@ -142,6 +143,8 @@ uint8_t mks_wifi_input(uint8_t data){ packet_start_flag=1; packet_index=0; memset((uint8_t*)mks_in_buffer,0,MKS_IN_BUFF_SIZE); + }else if(!packet_start_flag){ + DEBUG("Byte not in packet %0X %c",data,data); } if(packet_start_flag){ diff --git a/Marlin/src/module/mks_wifi/mks_wifi_sd.cpp b/Marlin/src/module/mks_wifi/mks_wifi_sd.cpp index f54472c8d5..71154c589c 100644 --- a/Marlin/src/module/mks_wifi/mks_wifi_sd.cpp +++ b/Marlin/src/module/mks_wifi/mks_wifi_sd.cpp @@ -129,7 +129,7 @@ void mks_wifi_start_file_upload(ESP_PROTOC_FRAME *packet){ file_name[packet->dataLen - 5 + 3] = 0; file_size=(packet->data[4] << 24) | (packet->data[3] << 16) | (packet->data[2] << 8) | packet->data[1]; - DEBUG("Start file %s size %d",str,file_size); + DEBUG("Start file %s size %d",file_name,file_size); //Отмонтировать SD от Marlin, Монтировать FATFs if(mks_wifi_sd_init()){ @@ -270,6 +270,7 @@ void mks_wifi_start_file_upload(ESP_PROTOC_FRAME *packet){ } if(*(buff+7) == 0x80){ //Последний пакет с данными + WRITE(MKS_WIFI_IO4, HIGH); //Остановить передачу от ESP DEBUG("Last packet"); if(file_data_size != 0){ //В буфере что-то есть file_inc_size += file_data_size; @@ -309,6 +310,19 @@ void mks_wifi_start_file_upload(ESP_PROTOC_FRAME *packet){ } + + //Выключить DMA + DMA1->IFCR = DMA_IFCR_CGIF5|DMA_IFCR_CTEIF5|DMA_IFCR_CHTIF5|DMA_IFCR_CTCIF5; + DMA1_Channel5->CCR = 0; + + //Восстановить USART1 + USART1->CR1 = 0; + USART1->CR1 = (USART_CR1_TE | USART_CR1_RE | USART_CR1_RXNEIE); + USART1->CR3 = 0; + USART1->BRR = usart1_brr; + USART1->CR1 |= USART_CR1_UE; + + f_close((FIL *)&upload_file); if( (file_size == file_inc_size) && (file_size == file_size_writen) ){ @@ -348,24 +362,12 @@ void mks_wifi_start_file_upload(ESP_PROTOC_FRAME *packet){ BUZZ(436,392); } - //Восстановить USART1 - USART1->CR1 = 0; - USART1->CR1 = (USART_CR1_TE | USART_CR1_RE | USART_CR1_RXNEIE); - USART1->CR3 = 0; - USART1->BRR = usart1_brr; - USART1->CR1 |= USART_CR1_UE; - - //Выключить DMA - DMA1->IFCR = DMA_IFCR_CGIF5|DMA_IFCR_CTEIF5|DMA_IFCR_CHTIF5|DMA_IFCR_CTCIF5; - DMA1_Channel5->CCR = 0; - mks_wifi_sd_deinit(); - WRITE(MKS_WIFI_IO4, LOW); //Включить передачу от ESP - thermalManager.setTargetBed(save_bed); thermalManager.setTargetHotend(save_e0,0); DEBUG("Restore thermal settings E0:%d Bed:%d",save_bed,save_e0); + WRITE(MKS_WIFI_IO4, LOW); //Включить передачу от ESP } #endif \ No newline at end of file diff --git a/firmware/all_drv_2208/Robin_nano35.bin b/firmware/all_drv_2208/Robin_nano35.bin index 0715510260..681084fa54 100644 Binary files a/firmware/all_drv_2208/Robin_nano35.bin and b/firmware/all_drv_2208/Robin_nano35.bin differ diff --git a/firmware/fb_4s/Robin_nano35.bin b/firmware/fb_4s/Robin_nano35.bin index 6c17e1a6a1..9076241ec8 100644 Binary files a/firmware/fb_4s/Robin_nano35.bin and b/firmware/fb_4s/Robin_nano35.bin differ diff --git a/firmware/fb_5/Robin_nano35.bin b/firmware/fb_5/Robin_nano35.bin index 6b3d815c03..7f1c8e00ac 100644 Binary files a/firmware/fb_5/Robin_nano35.bin and b/firmware/fb_5/Robin_nano35.bin differ