Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Duet3D/RepRapFirmware.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/Networking/ESP8266WiFi/WifiFirmwareUploader.h')
-rw-r--r--src/Networking/ESP8266WiFi/WifiFirmwareUploader.h28
1 files changed, 20 insertions, 8 deletions
diff --git a/src/Networking/ESP8266WiFi/WifiFirmwareUploader.h b/src/Networking/ESP8266WiFi/WifiFirmwareUploader.h
index b574315d..e1332e92 100644
--- a/src/Networking/ESP8266WiFi/WifiFirmwareUploader.h
+++ b/src/Networking/ESP8266WiFi/WifiFirmwareUploader.h
@@ -26,24 +26,35 @@ public:
static const uint32_t WebFilesAddress = 0x00100000;
private:
- static const uint32_t defaultTimeout = 500; // default timeout in milliseconds
+ static const uint32_t defaultTimeout = 500; // default timeout in milliseconds
static const uint32_t syncTimeout = 1000;
static const unsigned int retriesPerBaudRate = 9;
static const unsigned int retriesPerReset = 3;
static const uint32_t connectAttemptInterval = 50;
static const uint32_t resetDelay = 500;
- static const uint32_t blockWriteInterval = 15; // 15ms is long enough, 10ms is mostly too short
+ static const uint32_t blockWriteInterval = 15; // 15ms is long enough, 10ms is mostly too short
static const uint32_t blockWriteTimeout = 200;
- static const uint32_t eraseTimeout = 15000; // increased from 12 to 15 seconds because Roland's board was timing out
- static const unsigned int percentToReportIncrement = 5; // how often we report % complete
+ static const uint32_t eraseTimeout = 15000; // increased from 12 to 15 seconds because Roland's board was timing out
+ static const unsigned int percentToReportIncrement = 5; // how often we report % complete
static const uint32_t systemParametersAddress = 0x3FE000; // the address of the system + user parameter area that needs to be cleared when changing SDK version
static const uint32_t systemParametersSize = 0x2000; // the size of the system + user parameter area
- // Return codes - this list must be kept in step with the corresponding messages
- enum class EspUploadResult
+ // Return codes
+ // *** This list must be kept in step with the corresponding messages! ***
+ enum class EspUploadResult : uint8_t
{
success = 0,
- timeout,
+
+ // The following are status codes return by the ESP
+ invalidMessage = 0x05,
+ failedToAct = 0x06,
+ invalidCrc = 0x07,
+ flashWriteError = 0x08,
+ flashReadError = 0x09,
+ deflateError = 0x0b,
+
+ // The remainder are our own status codes
+ timeout = 0x10,
connect,
badReply,
fileRead,
@@ -70,12 +81,13 @@ private:
void WriteByteRaw(uint8_t b) noexcept;
void WriteByteSlip(uint8_t b) noexcept;
void flushInput() noexcept;
- EspUploadResult readPacket(uint8_t op, uint32_t *valp, size_t& bodyLen, uint32_t msTimeout) noexcept;
+ EspUploadResult readPacket(uint8_t op, uint32_t *valp, size_t& bodyLen, uint32_t *status, uint32_t msTimeout) noexcept;
void writePacket(const uint8_t *data, size_t len) noexcept;
void writePacketRaw(const uint8_t *buf, size_t len) noexcept;
void writePacket(const uint8_t *hdr, size_t hdrLen, const uint8_t *data, size_t dataLen) noexcept;
void writePacketRaw(const uint8_t *hdr, size_t hdrLen, const uint8_t *data, size_t dataLen) noexcept;
void sendCommand(uint8_t op, uint32_t checkVal, const uint8_t *data, size_t dataLen) noexcept;
+ static uint32_t getEraseSize(uint32_t offset, uint32_t size) noexcept;
EspUploadResult doCommand(uint8_t op, const uint8_t *data, size_t dataLen, uint32_t checkVal, uint32_t *valp, uint32_t msTimeout) noexcept;
EspUploadResult Sync(uint16_t timeout) noexcept;
EspUploadResult flashBegin(uint32_t addr, uint32_t size) noexcept;