Commit 2fc7171c authored by 李茂军's avatar 李茂军

Merge branch 'httpserver' of...

Merge branch 'httpserver' of http://tyw-server.synology.me:12345/rt200t/rt200t_esp32 into httpserver
parents a01c680c 750759ff
...@@ -334,14 +334,17 @@ Protocol_uint32_t UpdateBAT32A239Protocol_Send(UpdateProtocolStructure SendPd) ...@@ -334,14 +334,17 @@ Protocol_uint32_t UpdateBAT32A239Protocol_Send(UpdateProtocolStructure SendPd)
dataBuf[frameLen-2]=(Protocol_uint8_t)(DAT_CRC>>24); dataBuf[frameLen-2]=(Protocol_uint8_t)(DAT_CRC>>24);
} }
} }
if(SendPd.CMDH == CMD_FLASH_ERASE)
{
memcpy(&dataBuf[6],&SendPd.DAT[0],SendPd.LEN);
}
for(i = 0 ;i < (frameLen - 1); i++) for(i = 0 ;i < (frameLen - 1); i++)
{ {
checksumXor^=dataBuf[i]; checksumXor^=dataBuf[i];
} }
dataBuf[frameLen - 1]=(Protocol_uint8_t)checksumXor; dataBuf[frameLen - 1]=(Protocol_uint8_t)checksumXor;
printf("dataBuf[frameLen - 1] = %2x\n", dataBuf[frameLen - 1]); //printf("dataBuf[frameLen - 1] = %2x\n", dataBuf[frameLen - 1]);
printf("frameLen = %d\n", frameLen); //printf("frameLen = %d\n", frameLen);
if ( UARTSend_Cbk != Protocol_NULL ) if ( UARTSend_Cbk != Protocol_NULL )
{ {
return UARTSend_Cbk(dataBuf, frameLen); return UARTSend_Cbk(dataBuf, frameLen);
......
...@@ -445,10 +445,10 @@ void SendCmd_EraseBAT32A239_Chip(void) ...@@ -445,10 +445,10 @@ void SendCmd_EraseBAT32A239_Chip(void)
Update_Frame.DAT[1] = StartAddr >> 16; Update_Frame.DAT[1] = StartAddr >> 16;
Update_Frame.DAT[2] = StartAddr >> 8; Update_Frame.DAT[2] = StartAddr >> 8;
Update_Frame.DAT[3] = StartAddr; Update_Frame.DAT[3] = StartAddr;
Update_Frame.DAT[0] = BackupDataTotalLen >> 24; Update_Frame.DAT[4] = BackupDataTotalLen >> 24;
Update_Frame.DAT[1] = BackupDataTotalLen >> 16; Update_Frame.DAT[5] = BackupDataTotalLen >> 16;
Update_Frame.DAT[2] = BackupDataTotalLen >> 8; Update_Frame.DAT[6] = BackupDataTotalLen >> 8;
Update_Frame.DAT[3] = BackupDataTotalLen; Update_Frame.DAT[7] = BackupDataTotalLen;
UpdateBAT32A239Protocol_Send(Update_Frame); UpdateBAT32A239Protocol_Send(Update_Frame);
} }
uint32_t Write_Size=0; uint32_t Write_Size=0;
...@@ -651,14 +651,14 @@ void BAT32A239_MCU_Update(void) ...@@ -651,14 +651,14 @@ void BAT32A239_MCU_Update(void)
} }
if(DataTotalLen > MAX_OTA_BUFF) if(DataTotalLen > MAX_OTA_BUFF)
{ {
ESP_LOGI("MSI","~~~~~~~~~~~~~~~~~~~~~~\n"); //ESP_LOGI("MSI","~~~~~~~~~~~~~~~~~~~~~~\n");
Flash_Size = MAX_OTA_BUFF; Flash_Size = MAX_OTA_BUFF;
esp_partition_read(assert_update_partition,StartAddr - BackupStartAddr + 16,buf,Flash_Size); esp_partition_read(assert_update_partition,StartAddr - BackupStartAddr + 16,buf,Flash_Size);
DataTotalLen -= Flash_Size; DataTotalLen -= Flash_Size;
} }
else if(DataTotalLen != 0) else if(DataTotalLen != 0)
{ {
ESP_LOGI("MSI","!!!!!!!!!!!!!!!!!!!!!!!!!!\n"); //ESP_LOGI("MSI","!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
Flash_Size = DataTotalLen; Flash_Size = DataTotalLen;
esp_partition_read(assert_update_partition,StartAddr - BackupStartAddr + 16,buf,Flash_Size); esp_partition_read(assert_update_partition,StartAddr - BackupStartAddr + 16,buf,Flash_Size);
DataTotalLen = 0; DataTotalLen = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment