Merge branch 'main' into nrf9151
This commit is contained in:
commit
eefaf1b02e
2 changed files with 2 additions and 2 deletions
|
@ -70,7 +70,7 @@ pub fn wasm() -> TokenStream {
|
||||||
let executor = ::std::boxed::Box::leak(::std::boxed::Box::new(::embassy_executor::Executor::new()));
|
let executor = ::std::boxed::Box::leak(::std::boxed::Box::new(::embassy_executor::Executor::new()));
|
||||||
|
|
||||||
executor.start(|spawner| {
|
executor.start(|spawner| {
|
||||||
spawner.spawn(__embassy_main(spawner)).unwrap();
|
spawner.must_spawn(__embassy_main(spawner));
|
||||||
});
|
});
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
|
@ -16,7 +16,7 @@ const CRC8X_TABLE: [u8; 256] = [
|
||||||
0xcb, 0xe6, 0xe1, 0xe8, 0xef, 0xfa, 0xfd, 0xf4, 0xf3,
|
0xcb, 0xe6, 0xe1, 0xe8, 0xef, 0xfa, 0xfd, 0xf4, 0xf3,
|
||||||
];
|
];
|
||||||
|
|
||||||
/// Calculate the crc of a pease of data.
|
/// Calculate the crc of a piece of data.
|
||||||
pub fn crc8(data: &[u8]) -> u8 {
|
pub fn crc8(data: &[u8]) -> u8 {
|
||||||
data.iter().fold(0, |crc, &byte| CRC8X_TABLE[usize::from(byte ^ crc)])
|
data.iter().fold(0, |crc, &byte| CRC8X_TABLE[usize::from(byte ^ crc)])
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue