-
Notifications
You must be signed in to change notification settings - Fork 759
Open
Description
Hi,
I have the following static inline C function (from the ARM CMSIS):
__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority)
{
*pPreemptPriority = ...;
*pSubPriority = ...;
}
I'm using .wrap_static_fns(true)
to generate a C wrapper for this.
However, the wrapper that's generated is:
void NVIC_DecodePriority__extern(uint32_t Priority, uint32_t PriorityGroup, const uint32_t *const pPreemptPriority, const uint32_t *const pSubPriority)
{
NVIC_DecodePriority(Priority, PriorityGroup, pPreemptPriority, pSubPriority);
}
The pPreemptPriority
and pSubPriority
parameters have gained an extra const
, turning them into pointer-to-const. This causes the C compiler to raise warnings.
The Rust binding however looks fine:
#[link_name = "NVIC_DecodePriority__extern"]
pub fn NVIC_DecodePriority(
Priority: u32,
PriorityGroup: u32,
pPreemptPriority: *mut u32,
pSubPriority: *mut u32,
);
Thanks!
Metadata
Metadata
Assignees
Labels
No labels