mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-15 04:15:44 +03:00
Improved accgyro device structure alignment
This commit is contained in:
parent
7a7f1ceda5
commit
81ebdb38b6
4 changed files with 27 additions and 22 deletions
|
@ -97,10 +97,10 @@ static inline int32_t cmp32(uint32_t a, uint32_t b) { return (int32_t)(a-b); }
|
|||
|
||||
// using memcpy_fn will force memcpy function call, instead of inlining it. In most cases function call takes fewer instructions
|
||||
// than inlined version (inlining is cheaper for very small moves < 8 bytes / 2 store instructions)
|
||||
#ifdef UNIT_TEST
|
||||
#if defined(UNIT_TEST) || defined(SIMULATOR_BUILD)
|
||||
// Call memcpy when building unittest - this is easier that asm symbol name mangling (symbols start with _underscore on win32)
|
||||
#include <string.h>
|
||||
static inline void memcpy_fn ( void * destination, const void * source, size_t num ) { memcpy(destination, source, num); };
|
||||
static inline void memcpy_fn ( void * destination, const void * source, size_t num ) { memcpy(destination, source, num); }
|
||||
#else
|
||||
void * memcpy_fn ( void * destination, const void * source, size_t num ) asm("memcpy");
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue