From 99295c9ae8f40a1be7fd23de9171f820b6a42db6 Mon Sep 17 00:00:00 2001 From: Meco Jianting Man <920369182@qq.com> Date: Wed, 14 Apr 2021 22:46:46 +0800 Subject: [PATCH] simplify and beautify portBYTE_ALIGNMENT (#309) --- include/portable.h | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/include/portable.h b/include/portable.h index 3768e2cd8..774d3b5b6 100644 --- a/include/portable.h +++ b/include/portable.h @@ -53,29 +53,17 @@ #if portBYTE_ALIGNMENT == 32 #define portBYTE_ALIGNMENT_MASK ( 0x001f ) -#endif - -#if portBYTE_ALIGNMENT == 16 +#elif portBYTE_ALIGNMENT == 16 #define portBYTE_ALIGNMENT_MASK ( 0x000f ) -#endif - -#if portBYTE_ALIGNMENT == 8 +#elif portBYTE_ALIGNMENT == 8 #define portBYTE_ALIGNMENT_MASK ( 0x0007 ) -#endif - -#if portBYTE_ALIGNMENT == 4 +#elif portBYTE_ALIGNMENT == 4 #define portBYTE_ALIGNMENT_MASK ( 0x0003 ) -#endif - -#if portBYTE_ALIGNMENT == 2 +#elif portBYTE_ALIGNMENT == 2 #define portBYTE_ALIGNMENT_MASK ( 0x0001 ) -#endif - -#if portBYTE_ALIGNMENT == 1 +#elif portBYTE_ALIGNMENT == 1 #define portBYTE_ALIGNMENT_MASK ( 0x0000 ) -#endif - -#ifndef portBYTE_ALIGNMENT_MASK +#else #error "Invalid portBYTE_ALIGNMENT definition" #endif