-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from taks/esp32c6
Support for esp32c6
- Loading branch information
Showing
8 changed files
with
65 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
use core::ffi::c_int; | ||
use esp_idf_sys::os_mbuf; | ||
|
||
/// Allocate a packet header structure from the MSYS pool. See os_msys_register() for a description of MSYS. | ||
pub(crate) fn os_msys_get_pkthdr(dsize: u16, user_hdr_len: u16) -> *mut os_mbuf { | ||
#[cfg(not(esp_idf_soc_esp_nimble_controller))] | ||
unsafe { | ||
esp_idf_sys::os_msys_get_pkthdr(dsize, user_hdr_len) | ||
} | ||
|
||
#[cfg(esp_idf_soc_esp_nimble_controller)] | ||
unsafe { | ||
esp_idf_sys::r_os_msys_get_pkthdr(dsize, user_hdr_len) | ||
} | ||
} | ||
|
||
/// Append data onto a mbuf | ||
pub(crate) fn os_mbuf_append(m: *mut os_mbuf, data: &[u8]) -> c_int { | ||
#[cfg(not(esp_idf_soc_esp_nimble_controller))] | ||
unsafe { | ||
esp_idf_sys::os_mbuf_append(m, data.as_ptr() as _, data.len() as _) | ||
} | ||
|
||
#[cfg(esp_idf_soc_esp_nimble_controller)] | ||
unsafe { | ||
esp_idf_sys::r_os_mbuf_append(m, data.as_ptr() as _, data.len() as _) | ||
} | ||
} |