Merge pull request #12654 from kbarm/feature-remove-cc-arm-macro

Removed all references to __CC_ARM
pull/12666/head
Anna Bridge 2020-03-20 15:22:03 +00:00 committed by GitHub
commit ab483c2ead
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 32 additions and 232 deletions

View File

@ -2636,12 +2636,9 @@ protected:
/* -------- deprecated template implementation -------- */
#if defined(__GNUC__) && !defined(__CC_ARM)
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#elif defined(__CC_ARM)
#pragma push
#pragma diag_suppress 1361
#endif
#if BLE_ROLE_OBSERVER
@ -2687,10 +2684,8 @@ void LegacyGap<Impl>::onRadioNotification(T *tptr, void (T::*mptr)(bool))
radioNotificationCallback.attach(tptr, mptr);
}
#if defined(__GNUC__) && !defined(__CC_ARM)
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#elif defined(__CC_ARM)
#pragma pop
#endif
} // interface

View File

@ -19,14 +19,10 @@
/**
* Declare the beginning of a code block that uses a deprecated API
*/
#if defined(__GNUC__) && !defined(__CC_ARM)
#if defined(__GNUC__)
#define BLE_DEPRECATED_API_USE_BEGIN() \
_Pragma("GCC diagnostic push") \
_Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
#elif defined(__CC_ARM)
#define BLE_DEPRECATED_API_USE_BEGIN() \
_Pragma("push") \
_Pragma("diag_suppress 1361")
#else
#define BLE_DEPRECATED_API_USE_BEGIN()
#endif
@ -34,12 +30,9 @@
/**
* Declare the end of a code block that uses a deprecated API
*/
#if defined(__GNUC__) && !defined(__CC_ARM)
#if defined(__GNUC__)
#define BLE_DEPRECATED_API_USE_END() \
_Pragma("GCC diagnostic pop")
#elif defined(__CC_ARM)
#define BLE_DEPRECATED_API_USE_END() \
_Pragma("pop")
#else
#define BLE_DEPRECATED_API_USE_END()
#endif

View File

@ -267,12 +267,9 @@ ble_error_t LegacyGap<Impl>::initRadioNotification(void) {
/* -------- deprecated template implementation -------- */
#if defined(__GNUC__) && !defined(__CC_ARM)
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#elif defined(__CC_ARM)
#pragma push
#pragma diag_suppress 1361
#endif
template<class Impl>
@ -850,10 +847,8 @@ void LegacyGap<Impl>::processAdvertisementReport(
onAdvertisementReport.call(&params);
}
#if defined(__GNUC__) && !defined(__CC_ARM)
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#elif defined(__CC_ARM)
#pragma pop
#endif
#if BLE_ROLE_BROADCASTER

View File

@ -35,7 +35,7 @@
**************************************************************************************************/
/*! \brief Print function attributes. */
#if defined(__GNUC__) || defined(__CC_ARM)
#if defined(__GNUC__)
#define PRINT_ATTRIBUTE(a, b) __attribute__((format(printf, a, b)))
#else
#define PRINT_ATTRIBUTE(a, b)

View File

@ -59,7 +59,7 @@ extern "C" {
#if (((defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) && \
(!defined(__ICC8051__) || (__ICC8051__ == 0))) || \
(defined(__clang__) || defined(_MSC_VER)) || \
defined(__CC_ARM) || defined(__IAR_SYSTEMS_ICC__) || defined(__ARMCC_VERSION))
defined(__IAR_SYSTEMS_ICC__) || defined(__ARMCC_VERSION))
#include <stdint.h>
#else
/*! \brief Signed 8-bit value. */

View File

@ -168,7 +168,7 @@ void uECC_set_rng_ll(uECC_RNG_Function rng_function) {
g_rng_function = rng_function;
}
#if !defined(__CC_ARM) && !defined(__ARMCC_VERSION) && !defined(__ICCARM__) && defined(__GNUC__) /* Only support GCC inline asm for now */
#if !defined(__ARMCC_VERSION) && !defined(__ICCARM__) && defined(__GNUC__) /* Only support GCC inline asm for now */
#if (uECC_ASM && (uECC_PLATFORM == uECC_arm || uECC_PLATFORM == uECC_arm_thumb || \
uECC_PLATFORM == uECC_arm_thumb2))
#include "asm_arm.inc"

View File

@ -29,7 +29,7 @@ uECC_asm_fast - Use GCC inline assembly optimized for maximum speed. */
#define uECC_asm_small 1
#define uECC_asm_fast 2
#ifndef uECC_ASM
#if !defined(__CC_ARM) && !defined(__ARMCC_VERSION) && !defined(__ICCARM__) && defined(__GNUC__) /* Only support GCC inline asm for now */
#if !defined(__ARMCC_VERSION) && !defined(__ICCARM__) && defined(__GNUC__) /* Only support GCC inline asm for now */
#define uECC_ASM uECC_asm_fast
#else // DG: ARMCC 5, unlike GCC, IAR and CLANG, doesn't support GNU-style inline assembly
#define uECC_ASM uECC_asm_none

View File

@ -39,10 +39,7 @@
#include "app_error.h"
#if defined(__CC_ARM)
#pragma push
#pragma anon_unions
#elif defined(__ICCARM__)
#if defined(__ICCARM__)
#pragma language=extended
#elif defined(__GNUC__)
/* anonymous unions are enabled by default */
@ -80,9 +77,7 @@ typedef struct
} ble_conn_state_t;
#if defined(__CC_ARM)
#pragma pop
#elif defined(__ICCARM__)
#if defined(__ICCARM__)
/* leave anonymous unions enabled */
#elif defined(__GNUC__)
/* anonymous unions are enabled by default */
@ -411,4 +406,3 @@ sdk_mapped_flags_t ble_conn_state_user_flag_collection(ble_conn_state_user_flag_
return 0;
}
}

View File

@ -35,11 +35,7 @@
#include "ble_hci.h"
#include "app_error.h"
#if defined ( __CC_ARM )
#ifndef __ALIGN
#define __ALIGN(x) __align(x) /**< Forced aligment keyword for ARM Compiler */
#endif
#elif defined ( __ICCARM__ )
#if defined ( __ICCARM__ )
#ifndef __ALIGN
#define __ALIGN(x) /**< Forced aligment keyword for IAR Compiler */
#endif

View File

@ -34,28 +34,7 @@
/*lint ++flb "Enter library region" */
#if defined ( __CC_ARM )
#ifndef __ASM
#define __ASM __asm
#endif
#ifndef __INLINE
#define __INLINE __inline
#endif
#ifndef __WEAK
#define __WEAK __weak
#endif
#ifndef __ALIGN
#define __ALIGN(n) __align(n)
#endif
#define GET_SP() __current_sp()
#elif defined ( __ICCARM__ )
#if defined ( __ICCARM__ )
#ifndef __ASM
#define __ASM __asm
#endif

View File

@ -109,10 +109,7 @@ typedef enum {
/* ------------------- Start of section using anonymous unions ------------------ */
#if defined(__CC_ARM)
#pragma push
#pragma anon_unions
#elif defined(__ICCARM__)
#if defined(__ICCARM__)
#pragma language=extended
#elif defined(__GNUC__)
/* anonymous unions are enabled by default */
@ -1155,9 +1152,7 @@ typedef struct { /*!< GPIO Structure
/* -------------------- End of section using anonymous unions ------------------- */
#if defined(__CC_ARM)
#pragma pop
#elif defined(__ICCARM__)
#if defined(__ICCARM__)
/* leave anonymous unions enabled */
#elif defined(__GNUC__)
/* anonymous unions are enabled by default */

View File

@ -43,75 +43,8 @@
* @param number_of_ms
*/
/*lint --e{438, 522} "Variable not used" "Function lacks side-effects" */
#if defined ( __CC_ARM )
static __ASM void __INLINE nrf_delay_us(uint32_t volatile number_of_us)
{
loop
SUBS R0, R0, #1
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
#ifdef NRF52
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
#endif
BNE loop
BX LR
}
#elif defined ( __ICCARM__ )
#if defined ( __ICCARM__ )
static void __INLINE nrf_delay_us(uint32_t volatile number_of_us)
{

View File

@ -49,42 +49,7 @@
*
* @note This function will never return but issue a reset into provided application.
*/
#if defined ( __CC_ARM )
__asm static void bootloader_util_reset(uint32_t start_addr)
{
LDR R5, [R0] ; Get App initial MSP for bootloader.
MSR MSP, R5 ; Set the main stack pointer to the applications MSP.
LDR R0, [R0, #0x04] ; Load Reset handler into R0. This will be first argument to branch instruction (BX).
MOVS R4, #0xFF ; Load ones to R4.
SXTB R4, R4 ; Sign extend R4 to obtain 0xFFFFFFFF instead of 0xFF.
MRS R5, IPSR ; Load IPSR to R5 to check for handler or thread mode.
CMP R5, #0x00 ; Compare, if 0 then we are in thread mode and can continue to reset handler of bootloader.
BNE isr_abort ; If not zero we need to exit current ISR and jump to reset handler of bootloader.
MOV LR, R4 ; Clear the link register and set to ones to ensure no return, R4 = 0xFFFFFFFF.
BX R0 ; Branch to reset handler of bootloader.
isr_abort
; R4 contains ones from line above. Will be popped as R12 when exiting ISR (Cleaning up the registers).
MOV R5, R4 ; Fill with ones before jumping to reset handling. We be popped as LR when exiting ISR. Ensures no return to application.
MOV R6, R0 ; Move address of reset handler to R6. Will be popped as PC when exiting ISR. Ensures the reset handler will be executed when exist ISR.
MOVS r7, #0x21 ; Move MSB reset value of xPSR to R7. Will be popped as xPSR when exiting ISR. xPSR is 0x21000000 thus MSB is 0x21.
REV r7, r7 ; Reverse byte order to put 0x21 as MSB.
PUSH {r4-r7} ; Push everything to new stack to allow interrupt handler to fetch it on exiting the ISR.
MOVS R4, #0x00 ; Fill with zeros before jumping to reset handling. We be popped as R0 when exiting ISR (Cleaning up of the registers).
MOVS R5, #0x00 ; Fill with zeros before jumping to reset handling. We be popped as R1 when exiting ISR (Cleaning up of the registers).
MOVS R6, #0x00 ; Fill with zeros before jumping to reset handling. We be popped as R2 when exiting ISR (Cleaning up of the registers).
MOVS R7, #0x00 ; Fill with zeros before jumping to reset handling. We be popped as R3 when exiting ISR (Cleaning up of the registers).
PUSH {r4-r7} ; Push zeros (R4-R7) to stack to prepare for exiting the interrupt routine.
MOVS R0, #0xF9 ; Move the execution return command into register, 0xFFFFFFF9.
SXTB R0, R0 ; Sign extend R0 to obtain 0xFFFFFFF9 instead of 0xF9.
BX R0 ; No return - Handler mode will be exited. Stack will be popped and execution will continue in reset handler initializing other application.
ALIGN
}
#elif defined ( __GNUC__ )
#if defined ( __GNUC__ )
static inline void bootloader_util_reset(uint32_t start_addr)
{
__asm volatile(

View File

@ -59,12 +59,7 @@
*
* @param[in] section_name Name of the section to register
**/
#if defined __CC_ARM
// Not required by this compiler
#define NRF_SECTION_VARS_REGISTER_SECTION(section_name)
#elif defined __GNUC__
#if defined __GNUC__
// Not required by this compiler
#define NRF_SECTION_VARS_REGISTER_SECTION(section_name)
@ -88,11 +83,7 @@
*
* @param[in] section_name Name of the section
*/
#if defined __CC_ARM
#define NRF_SECTION_VARS_START_SYMBOL(section_name) section_name ## $$Base
#elif defined __GNUC__
#if defined __GNUC__
#define NRF_SECTION_VARS_START_SYMBOL(section_name) __start_ ## section_name
@ -114,11 +105,7 @@
*
* @param[in] section_name Name of the section
*/
#if defined __CC_ARM
#define NRF_SECTION_VARS_END_SYMBOL(section_name) section_name ## $$Limit
#elif defined __GNUC__
#if defined __GNUC__
#define NRF_SECTION_VARS_END_SYMBOL(section_name) __stop_ ## section_name
@ -138,12 +125,7 @@
* @param[in] section_name Name of the section
*/
#if defined __CC_ARM
#define NRF_SECTION_VARS_LENGTH(section_name) \
((uint32_t)&NRF_SECTION_VARS_END_SYMBOL(section_name) - (uint32_t)&NRF_SECTION_VARS_START_SYMBOL(section_name))
#elif defined __GNUC__
#if defined __GNUC__
#define NRF_SECTION_VARS_LENGTH(section_name) \
((uint32_t)&NRF_SECTION_VARS_END_SYMBOL(section_name) - (uint32_t)&NRF_SECTION_VARS_START_SYMBOL(section_name))
@ -164,16 +146,11 @@
*
* param[in] section_name Name of the section to get the start address from
*/
#if defined __CC_ARM
#if defined __GNUC__
#define NRF_SECTION_VARS_START_ADDR(section_name) (uint32_t)&NRF_SECTION_VARS_START_SYMBOL(section_name)
#elif defined __GNUC__
#define NRF_SECTION_VARS_START_ADDR(section_name) (uint32_t)&NRF_SECTION_VARS_START_SYMBOL(section_name)
#elif defined __ICCARM__
#define NRF_SECTION_VARS_START_ADDR(section_name) (uint32_t)iar_ ## section_name ## _start
#else
@ -187,14 +164,10 @@
*
* @param[in] section_name Name of the section to get end address from
*/
#if defined __CC_ARM
#if defined __GNUC__
#define NRF_SECTION_VARS_END_ADDR(section_name) (uint32_t)&NRF_SECTION_VARS_END_SYMBOL(section_name)
#elif defined __GNUC__
#define NRF_SECTION_VARS_END_ADDR(section_name) (uint32_t)&NRF_SECTION_VARS_END_SYMBOL(section_name)
#elif defined __ICCARM__
#define NRF_SECTION_VARS_END_ADDR(section_name) (uint32_t)iar_ ## section_name ## _end
@ -213,13 +186,7 @@
* @param[in] type_name Name of the type stored in the section
* @param[in] section_name Name of the section
*/
#if defined __CC_ARM
#define NRF_SECTION_VARS_REGISTER_SYMBOLS(type_name, section_name) \
extern type_name* NRF_SECTION_VARS_START_SYMBOL(section_name); \
extern void* NRF_SECTION_VARS_END_SYMBOL(section_name)
#elif defined __GNUC__
#if defined __GNUC__
#define NRF_SECTION_VARS_REGISTER_SYMBOLS(type_name, section_name) \
extern type_name* NRF_SECTION_VARS_START_SYMBOL(section_name); \
@ -253,12 +220,7 @@
* @param[in] section_name Name of the section
* @param[in] type_def Datatype of the symbol to place in the given section
*/
#if defined __CC_ARM
#define NRF_SECTION_VARS_ADD(section_name, type_def) \
static type_def __attribute__((section( #section_name ))) __attribute__((used))
#elif defined __GNUC__
#if defined __GNUC__
#define NRF_SECTION_VARS_ADD(section_name, type_def) \
static type_def __attribute__ ((section( #section_name ))) __attribute__ ((used))
@ -287,13 +249,8 @@
* @param[in] type_name Type name of item in section
* @param[in] section_name Name of the section
*/
#if defined __CC_ARM
#define NRF_SECTION_VARS_GET(i, type_name, section_name) \
(type_name*)(NRF_SECTION_VARS_START_ADDR(section_name) + i * sizeof(type_name))
#elif defined __GNUC__
#if defined __GNUC__
#define NRF_SECTION_VARS_GET(i, type_name, section_name) \
(type_name*)(NRF_SECTION_VARS_START_ADDR(section_name) + i * sizeof(type_name))

View File

@ -38,9 +38,7 @@
#else
#ifndef SVCALL
#if defined (__CC_ARM)
#define SVCALL(number, return_type, signature) return_type __svc(number) signature
#elif defined (__GNUC__)
#if defined (__GNUC__)
#define SVCALL(number, return_type, signature) \
_Pragma("GCC diagnostic push") \
_Pragma("GCC diagnostic ignored \"-Wreturn-type\"") \

View File

@ -60,7 +60,7 @@
/// test n-th bit of x
#define BIT_TEST(x, n) ( (x) & BIT(n) )
#if defined(__GNUC__) && !defined(__CC_ARM) // keil does not support binary format
#if defined(__GNUC__) // keil does not support binary format
#define BIN8(x) ((uint8_t) (0b##x))
#define BIN16(b1, b2) ((uint16_t) (0b##b1##b2))

View File

@ -60,7 +60,7 @@
/// test n-th bit of x
#define BIT_TEST(x, n) ( (x) & BIT(n) )
#if defined(__GNUC__) && !defined(__CC_ARM) // keil does not support binary format
#if defined(__GNUC__) // keil does not support binary format
#define BIN8(x) ((uint8_t) (0b##x))
#define BIN16(b1, b2) ((uint16_t) (0b##b1##b2))

View File

@ -60,7 +60,7 @@
/// test n-th bit of x
#define BIT_TEST(x, n) ( (x) & BIT(n) )
#if defined(__GNUC__) && !defined(__CC_ARM) // keil does not support binary format
#if defined(__GNUC__) // keil does not support binary format
#define BIN8(x) ((uint8_t) (0b##x))
#define BIN16(b1, b2) ((uint16_t) (0b##b1##b2))