Browse Source

Merge pull request #2 from Sergey1560/FB4S_WIFI

Fix автозапуска
pull/15/head
X-Dron 4 years ago
committed by GitHub
parent
commit
23e3e6e64e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      Marlin/Configuration_adv.h
  2. 3
      Marlin/src/module/mks_wifi/mks_wifi.cpp
  3. 30
      Marlin/src/module/mks_wifi/mks_wifi_sd.cpp
  4. BIN
      firmware/all_drv_2208/Robin_nano35.bin
  5. BIN
      firmware/fb_4s/Robin_nano35.bin
  6. BIN
      firmware/fb_5/Robin_nano35.bin

2
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:

3
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){

30
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

BIN
firmware/all_drv_2208/Robin_nano35.bin

Binary file not shown.

BIN
firmware/fb_4s/Robin_nano35.bin

Binary file not shown.

BIN
firmware/fb_5/Robin_nano35.bin

Binary file not shown.
Loading…
Cancel
Save