mirror of
https://github.com/laanwj/k210-sdk-stuff.git
synced 2024-11-22 01:16:20 +04:00
rust: use repr(C) for aligned structs
Just a precaution: we want a predictable layout here.
This commit is contained in:
parent
adfa176f77
commit
ce5c41f0da
@ -20,7 +20,7 @@ use k210_shared::soc::dvp::{DVPExt,sccb_addr_len,image_format};
|
||||
use k210_shared::board::ov2640;
|
||||
|
||||
/** 64-byte aligned screen RAM */
|
||||
#[repr(align(64))]
|
||||
#[repr(C, align(64))]
|
||||
struct ScreenRAM {
|
||||
pub image: [u32; DISP_PIXELS / 2],
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ use k210_shared::soc::dvp::{DVPExt,sccb_addr_len,image_format};
|
||||
use k210_shared::board::ov2640;
|
||||
|
||||
/** 64-byte aligned planar RAM */
|
||||
#[repr(align(64))]
|
||||
#[repr(C, align(64))]
|
||||
struct PlanarScreenRAM {
|
||||
pub r: [u8; DISP_PIXELS],
|
||||
pub g: [u8; DISP_PIXELS],
|
||||
|
Loading…
Reference in New Issue
Block a user