Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Esp idf sys update #2

Merged
merged 1 commit into from
Jul 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/target
/Cargo.lock
/.embuild
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ categories = ["embedded", "api-bindings"]
default = ["log"]

[dependencies]
esp-idf-sys = { version = "0.31.6" }
esp-idf-sys = { version = "0.33.0" }
# If the `log` feature is enabled, the crate does some internal logging during the OTA operations
log = { version = "0.4", optional = true }

Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ impl OtaUpdate {
}

let mut ota_handle = 0;
match unsafe { esp_ota_begin(partition, OTA_SIZE_UNKNOWN, &mut ota_handle) } {
match unsafe { esp_ota_begin(partition, OTA_SIZE_UNKNOWN as usize, &mut ota_handle) } {
ESP_OK => Ok(()),
ESP_ERR_INVALID_ARG => panic!("Invalid partition or out_handle"),
ESP_ERR_NO_MEM => Err(Error::from_kind(ErrorKind::AllocFailed)),
Expand Down Expand Up @@ -150,7 +150,7 @@ impl OtaUpdate {
let chunk_ptr = app_image_chunk.as_ptr() as *const _;
let chunk_len = u32::try_from(app_image_chunk.len()).expect("Too large firmware chunk");

match unsafe { esp_ota_write(self.ota_handle, chunk_ptr, chunk_len) } {
match unsafe { esp_ota_write(self.ota_handle, chunk_ptr, chunk_len as usize) } {
ESP_OK => Ok(()),
ESP_ERR_INVALID_ARG => panic!("Invalid OTA handle"),
ESP_ERR_OTA_VALIDATE_FAILED => Err(Error::from_kind(ErrorKind::InvalidMagicByte)),
Expand Down