add no-std

This commit is contained in:
2025-12-06 22:30:42 +01:00
parent f3b79bb9aa
commit c2b9eaa8d3
5 changed files with 47 additions and 12 deletions

View File

@@ -18,6 +18,14 @@ pub fn calculate_checksum(length: u8, message_identifier: MessageIdentifier, fun
#[cfg(test)]
mod tests {
use crate::{enums::{FunctionCode, MessageIdentifier}, message::Protocol300Message, utils::calculate_checksum};
#[cfg(not(feature = "std"))]
extern crate alloc;
#[cfg(not(feature = "std"))]
use alloc::vec;
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
#[test]
fn test_check_checksum_1() {