rust: use repr(C) for aligned structs

Just a precaution: we want a predictable layout here.
This commit is contained in:
Wladimir J. van der Laan 2019-09-05 11:17:23 +00:00
parent adfa176f77
commit ce5c41f0da
2 changed files with 2 additions and 2 deletions

View File

@ -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],
}

View File

@ -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],