heap_remove, sp_brightness_grid_into_packet

This commit is contained in:
Vinzenz Schroeter 2025-04-12 21:56:07 +02:00
commit 1e442012be
6 changed files with 42 additions and 13 deletions

View file

@ -1,4 +1,4 @@
use crate::{heap_drop, heap_move, heap_move_nonnull, ByteSlice};
use crate::{heap_drop, heap_move, heap_move_nonnull, heap_remove, ByteSlice};
use servicepoint::{CommandCode, Header, Packet, TypedCommand};
use std::ptr::NonNull;
@ -10,7 +10,7 @@ use std::ptr::NonNull;
pub unsafe extern "C" fn sp_packet_from_command(
command: NonNull<TypedCommand>,
) -> *mut Packet {
let command = unsafe { *Box::from_raw(command.as_ptr()) };
let command = unsafe { heap_remove(command) };
if let Ok(packet) = command.try_into() {
heap_move(packet)
} else {