|
@@ -178,14 +178,14 @@ void changeFlashMode(const bool dmaMode) {
|
178
|
178
|
}
|
179
|
179
|
}
|
180
|
180
|
|
181
|
|
-static bool longName2DosName(const char *longName, uint8_t *dosName) {
|
|
181
|
+static bool longName2DosName(const char *longName, char *dosName) {
|
182
|
182
|
uint8_t i;
|
183
|
183
|
for (i = FILENAME_LENGTH; i--;) dosName[i] = '\0';
|
184
|
184
|
while (*longName) {
|
185
|
185
|
uint8_t c = *longName++;
|
186
|
186
|
if (c == '.') { // For a dot...
|
187
|
187
|
if (i == 0) return false;
|
188
|
|
- strcat_P((char *)dosName, PSTR(".GCO"));
|
|
188
|
+ strcat_P(dosName, PSTR(".GCO"));
|
189
|
189
|
break;
|
190
|
190
|
}
|
191
|
191
|
else {
|
|
@@ -196,7 +196,7 @@ static bool longName2DosName(const char *longName, uint8_t *dosName) {
|
196
|
196
|
dosName[i++] = c + (WITHIN(c, 'a', 'z') ? 'A' - 'a' : 0); // Uppercase required for 8.3 name
|
197
|
197
|
}
|
198
|
198
|
if (i >= 5) {
|
199
|
|
- strcat_P((char *)dosName, PSTR("~1.GCO"));
|
|
199
|
+ strcat_P(dosName, PSTR("~1.GCO"));
|
200
|
200
|
break;
|
201
|
201
|
}
|
202
|
202
|
}
|
|
@@ -478,7 +478,7 @@ char wait_ip_back_flag = 0;
|
478
|
478
|
|
479
|
479
|
typedef struct {
|
480
|
480
|
int write_index;
|
481
|
|
- char saveFileName[30];
|
|
481
|
+ uint8_t saveFileName[30];
|
482
|
482
|
uint8_t fileTransfer;
|
483
|
483
|
uint32_t fileLen;
|
484
|
484
|
uint32_t tick_begin;
|
|
@@ -593,7 +593,7 @@ uint8_t Explore_Disk(char *path , uint8_t recu_level) {
|
593
|
593
|
}
|
594
|
594
|
|
595
|
595
|
static void wifi_gcode_exec(uint8_t *cmd_line) {
|
596
|
|
- char tempBuf[100] = { 0 };
|
|
596
|
+ int8_t tempBuf[100] = { 0 };
|
597
|
597
|
uint8_t *tmpStr = 0;
|
598
|
598
|
int cmd_value;
|
599
|
599
|
volatile int print_rate;
|
|
@@ -631,7 +631,7 @@ static void wifi_gcode_exec(uint8_t *cmd_line) {
|
631
|
631
|
while (tmpStr[index] == ' ') index++;
|
632
|
632
|
|
633
|
633
|
if (gCfgItems.wifi_type == ESP_WIFI) {
|
634
|
|
- char *path = tempBuf;
|
|
634
|
+ char *path = (char *)tempBuf;
|
635
|
635
|
|
636
|
636
|
if (strlen((char *)&tmpStr[index]) < 80) {
|
637
|
637
|
send_to_wifi((uint8_t *)"Begin file list\r\n", strlen("Begin file list\r\n"));
|
|
@@ -680,7 +680,7 @@ static void wifi_gcode_exec(uint8_t *cmd_line) {
|
680
|
680
|
strcat_P((char *)list_file.file_name[sel_id], PSTR("/"));
|
681
|
681
|
|
682
|
682
|
if (file_writer.fileTransfer == 1) {
|
683
|
|
- uint8_t dosName[FILENAME_LENGTH];
|
|
683
|
+ char dosName[FILENAME_LENGTH];
|
684
|
684
|
uint8_t fileName[sizeof(list_file.file_name[sel_id])];
|
685
|
685
|
fileName[0] = '\0';
|
686
|
686
|
if (has_path_selected == 1) {
|
|
@@ -690,8 +690,8 @@ static void wifi_gcode_exec(uint8_t *cmd_line) {
|
690
|
690
|
else strcat((char *)fileName, (char *)&tmpStr[index]);
|
691
|
691
|
if (!longName2DosName((const char *)fileName, dosName))
|
692
|
692
|
strcpy_P(list_file.file_name[sel_id], PSTR("notValid"));
|
693
|
|
- strcat((char *)list_file.file_name[sel_id], (char *)dosName);
|
694
|
|
- strcat((char *)list_file.long_name[sel_id], (char *)dosName);
|
|
693
|
+ strcat((char *)list_file.file_name[sel_id], dosName);
|
|
694
|
+ strcat((char *)list_file.long_name[sel_id], dosName);
|
695
|
695
|
}
|
696
|
696
|
else {
|
697
|
697
|
strcat((char *)list_file.file_name[sel_id], (char *)&tmpStr[index]);
|
|
@@ -828,8 +828,8 @@ static void wifi_gcode_exec(uint8_t *cmd_line) {
|
828
|
828
|
if ((uiCfg.print_state == WORKING) || (uiCfg.print_state == PAUSED)|| (uiCfg.print_state == REPRINTING)) {
|
829
|
829
|
print_rate = uiCfg.totalSend;
|
830
|
830
|
ZERO(tempBuf);
|
831
|
|
- sprintf_P(tempBuf, PSTR("M27 %d\r\n"), print_rate);
|
832
|
|
- send_to_wifi((uint8_t *)tempBuf, strlen(tempBuf));
|
|
831
|
+ sprintf_P((char *)tempBuf, PSTR("M27 %d\r\n"), print_rate);
|
|
832
|
+ send_to_wifi((uint8_t *)tempBuf, strlen((char *)tempBuf));
|
833
|
833
|
}
|
834
|
834
|
break;
|
835
|
835
|
|
|
@@ -841,15 +841,15 @@ static void wifi_gcode_exec(uint8_t *cmd_line) {
|
841
|
841
|
while (tmpStr[index] == ' ') index++;
|
842
|
842
|
|
843
|
843
|
if (strstr_P((char *)&tmpStr[index], PSTR(".g")) || strstr_P((char *)&tmpStr[index], PSTR(".G"))) {
|
844
|
|
- strcpy(file_writer.saveFileName, (char *)&tmpStr[index]);
|
|
844
|
+ strcpy((char *)file_writer.saveFileName, (char *)&tmpStr[index]);
|
845
|
845
|
|
846
|
846
|
if (gCfgItems.fileSysType == FILE_SYS_SD) {
|
847
|
847
|
ZERO(tempBuf);
|
848
|
|
- sprintf_P(tempBuf, PSTR("%s"), file_writer.saveFileName);
|
|
848
|
+ sprintf_P((char *)tempBuf, PSTR("%s"), file_writer.saveFileName);
|
849
|
849
|
}
|
850
|
850
|
else if (gCfgItems.fileSysType == FILE_SYS_USB) {
|
851
|
851
|
ZERO(tempBuf);
|
852
|
|
- sprintf_P(tempBuf, PSTR("%s"), file_writer.saveFileName);
|
|
852
|
+ sprintf_P((char *)tempBuf, PSTR("%s"), (char *)file_writer.saveFileName);
|
853
|
853
|
}
|
854
|
854
|
mount_file_sys(gCfgItems.fileSysType);
|
855
|
855
|
|
|
@@ -858,11 +858,11 @@ static void wifi_gcode_exec(uint8_t *cmd_line) {
|
858
|
858
|
card.openFileWrite(cur_name);
|
859
|
859
|
if (card.isFileOpen()) {
|
860
|
860
|
ZERO(file_writer.saveFileName);
|
861
|
|
- strcpy(file_writer.saveFileName, (char *)&tmpStr[index]);
|
|
861
|
+ strcpy((char *)file_writer.saveFileName, (char *)&tmpStr[index]);
|
862
|
862
|
ZERO(tempBuf);
|
863
|
|
- sprintf_P(tempBuf, PSTR("Writing to file: %s\r\n"), file_writer.saveFileName);
|
|
863
|
+ sprintf_P((char *)tempBuf, PSTR("Writing to file: %s\r\n"), (char *)file_writer.saveFileName);
|
864
|
864
|
wifi_ret_ack();
|
865
|
|
- send_to_wifi((uint8_t *)tempBuf, strlen(tempBuf));
|
|
865
|
+ send_to_wifi((uint8_t *)tempBuf, strlen((char *)tempBuf));
|
866
|
866
|
wifi_link_state = WIFI_WAIT_TRANS_START;
|
867
|
867
|
}
|
868
|
868
|
else {
|
|
@@ -882,7 +882,7 @@ static void wifi_gcode_exec(uint8_t *cmd_line) {
|
882
|
882
|
|
883
|
883
|
SEND_OK_TO_WIFI;
|
884
|
884
|
|
885
|
|
- char *outBuf = tempBuf;
|
|
885
|
+ char *outBuf = (char *)tempBuf;
|
886
|
886
|
char tbuf[34];
|
887
|
887
|
|
888
|
888
|
sprintf_P(tbuf, PSTR("%d /%d"), (int)thermalManager.degHotend(0), (int)thermalManager.degTargetHotend(0));
|
|
@@ -917,7 +917,7 @@ static void wifi_gcode_exec(uint8_t *cmd_line) {
|
917
|
917
|
strcat_P(outBuf, PSTR(" @:0 B@:0\r\n"));
|
918
|
918
|
}
|
919
|
919
|
else {
|
920
|
|
- sprintf_P(tempBuf, PSTR("T:%d /%d B:%d /%d T0:%d /%d T1:%d /%d @:0 B@:0\r\n"),
|
|
920
|
+ sprintf_P((char *)tempBuf, PSTR("T:%d /%d B:%d /%d T0:%d /%d T1:%d /%d @:0 B@:0\r\n"),
|
921
|
921
|
thermalManager.degHotend(0), thermalManager.degTargetHotend(0),
|
922
|
922
|
#if HAS_HEATED_BED
|
923
|
923
|
thermalManager.degBed(), thermalManager.degTargetBed(),
|
|
@@ -933,16 +933,16 @@ static void wifi_gcode_exec(uint8_t *cmd_line) {
|
933
|
933
|
);
|
934
|
934
|
}
|
935
|
935
|
|
936
|
|
- send_to_wifi((uint8_t *)tempBuf, strlen(tempBuf));
|
|
936
|
+ send_to_wifi((uint8_t *)tempBuf, strlen((char *)tempBuf));
|
937
|
937
|
queue.enqueue_one_P(PSTR("M105"));
|
938
|
938
|
break;
|
939
|
939
|
|
940
|
940
|
case 992:
|
941
|
941
|
if ((uiCfg.print_state == WORKING) || (uiCfg.print_state == PAUSED)) {
|
942
|
942
|
ZERO(tempBuf);
|
943
|
|
- sprintf_P(tempBuf, PSTR("M992 %d%d:%d%d:%d%d\r\n"), print_time.hours/10, print_time.hours%10, print_time.minutes/10, print_time.minutes%10, print_time.seconds/10, print_time.seconds%10);
|
|
943
|
+ sprintf_P((char *)tempBuf, PSTR("M992 %d%d:%d%d:%d%d\r\n"), print_time.hours/10, print_time.hours%10, print_time.minutes/10, print_time.minutes%10, print_time.seconds/10, print_time.seconds%10);
|
944
|
944
|
wifi_ret_ack();
|
945
|
|
- send_to_wifi((uint8_t *)tempBuf, strlen(tempBuf));
|
|
945
|
+ send_to_wifi((uint8_t *)tempBuf, strlen((char *)tempBuf));
|
946
|
946
|
}
|
947
|
947
|
break;
|
948
|
948
|
|
|
@@ -950,9 +950,9 @@ static void wifi_gcode_exec(uint8_t *cmd_line) {
|
950
|
950
|
if ((uiCfg.print_state == WORKING) || (uiCfg.print_state == PAUSED)) {
|
951
|
951
|
ZERO(tempBuf);
|
952
|
952
|
if (strlen((char *)list_file.file_name[sel_id]) > (100 - 1)) return;
|
953
|
|
- sprintf_P(tempBuf, PSTR("M994 %s;%d\n"), list_file.file_name[sel_id], (int)gCfgItems.curFilesize);
|
|
953
|
+ sprintf_P((char *)tempBuf, PSTR("M994 %s;%d\n"), list_file.file_name[sel_id], (int)gCfgItems.curFilesize);
|
954
|
954
|
wifi_ret_ack();
|
955
|
|
- send_to_wifi((uint8_t *)tempBuf, strlen(tempBuf));
|
|
955
|
+ send_to_wifi((uint8_t *)tempBuf, strlen((char *)tempBuf));
|
956
|
956
|
}
|
957
|
957
|
break;
|
958
|
958
|
|
|
@@ -1279,7 +1279,7 @@ static void file_first_msg_handle(uint8_t * msg, uint16_t msgLen) {
|
1279
|
1279
|
|
1280
|
1280
|
ZERO(public_buf);
|
1281
|
1281
|
|
1282
|
|
- if (strlen(file_writer.saveFileName) > sizeof(saveFilePath))
|
|
1282
|
+ if (strlen((const char *)file_writer.saveFileName) > sizeof(saveFilePath))
|
1283
|
1283
|
return;
|
1284
|
1284
|
|
1285
|
1285
|
ZERO(saveFilePath);
|
|
@@ -1305,7 +1305,7 @@ static void file_first_msg_handle(uint8_t * msg, uint16_t msgLen) {
|
1305
|
1305
|
|
1306
|
1306
|
char dosName[FILENAME_LENGTH];
|
1307
|
1307
|
|
1308
|
|
- if (!longName2DosName(file_writer.saveFileName, dosName)) {
|
|
1308
|
+ if (!longName2DosName((const char *)file_writer.saveFileName, dosName)) {
|
1309
|
1309
|
clear_cur_ui();
|
1310
|
1310
|
upload_result = 2;
|
1311
|
1311
|
wifiTransError.flag = 1;
|
|
@@ -1313,7 +1313,7 @@ static void file_first_msg_handle(uint8_t * msg, uint16_t msgLen) {
|
1313
|
1313
|
lv_draw_dialog(DIALOG_TYPE_UPLOAD_FILE);
|
1314
|
1314
|
return;
|
1315
|
1315
|
}
|
1316
|
|
- strcpy(saveFilePath, dosName);
|
|
1316
|
+ strcpy((char *)saveFilePath, dosName);
|
1317
|
1317
|
|
1318
|
1318
|
card.cdroot();
|
1319
|
1319
|
upload_file.close();
|