Skip to content

Commit ab483c2

Browse files
authored
Merge pull request #12654 from kbarm/feature-remove-cc-arm-macro
Removed all references to __CC_ARM
2 parents 197e1d2 + 4465295 commit ab483c2

File tree

18 files changed

+32
-232
lines changed

18 files changed

+32
-232
lines changed

features/FEATURE_BLE/ble/Gap.h

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2636,12 +2636,9 @@ class LegacyGap :
26362636

26372637
/* -------- deprecated template implementation -------- */
26382638

2639-
#if defined(__GNUC__) && !defined(__CC_ARM)
2639+
#if defined(__GNUC__)
26402640
#pragma GCC diagnostic push
26412641
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
2642-
#elif defined(__CC_ARM)
2643-
#pragma push
2644-
#pragma diag_suppress 1361
26452642
#endif
26462643

26472644
#if BLE_ROLE_OBSERVER
@@ -2687,10 +2684,8 @@ void LegacyGap<Impl>::onRadioNotification(T *tptr, void (T::*mptr)(bool))
26872684
radioNotificationCallback.attach(tptr, mptr);
26882685
}
26892686

2690-
#if defined(__GNUC__) && !defined(__CC_ARM)
2687+
#if defined(__GNUC__)
26912688
#pragma GCC diagnostic pop
2692-
#elif defined(__CC_ARM)
2693-
#pragma pop
26942689
#endif
26952690

26962691
} // interface

features/FEATURE_BLE/ble/pal/Deprecated.h

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,27 +19,20 @@
1919
/**
2020
* Declare the beginning of a code block that uses a deprecated API
2121
*/
22-
#if defined(__GNUC__) && !defined(__CC_ARM)
22+
#if defined(__GNUC__)
2323
#define BLE_DEPRECATED_API_USE_BEGIN() \
2424
_Pragma("GCC diagnostic push") \
2525
_Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
26-
#elif defined(__CC_ARM)
27-
#define BLE_DEPRECATED_API_USE_BEGIN() \
28-
_Pragma("push") \
29-
_Pragma("diag_suppress 1361")
3026
#else
3127
#define BLE_DEPRECATED_API_USE_BEGIN()
3228
#endif
3329

3430
/**
3531
* Declare the end of a code block that uses a deprecated API
3632
*/
37-
#if defined(__GNUC__) && !defined(__CC_ARM)
33+
#if defined(__GNUC__)
3834
#define BLE_DEPRECATED_API_USE_END() \
3935
_Pragma("GCC diagnostic pop")
40-
#elif defined(__CC_ARM)
41-
#define BLE_DEPRECATED_API_USE_END() \
42-
_Pragma("pop")
4336
#else
4437
#define BLE_DEPRECATED_API_USE_END()
4538
#endif

features/FEATURE_BLE/source/LegacyGap.tpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -267,12 +267,9 @@ ble_error_t LegacyGap<Impl>::initRadioNotification(void) {
267267

268268
/* -------- deprecated template implementation -------- */
269269

270-
#if defined(__GNUC__) && !defined(__CC_ARM)
270+
#if defined(__GNUC__)
271271
#pragma GCC diagnostic push
272272
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
273-
#elif defined(__CC_ARM)
274-
#pragma push
275-
#pragma diag_suppress 1361
276273
#endif
277274

278275
template<class Impl>
@@ -850,10 +847,8 @@ void LegacyGap<Impl>::processAdvertisementReport(
850847
onAdvertisementReport.call(&params);
851848
}
852849

853-
#if defined(__GNUC__) && !defined(__CC_ARM)
850+
#if defined(__GNUC__)
854851
#pragma GCC diagnostic pop
855-
#elif defined(__CC_ARM)
856-
#pragma pop
857852
#endif
858853

859854
#if BLE_ROLE_BROADCASTER

features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/include/util/print.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
**************************************************************************************************/
3636

3737
/*! \brief Print function attributes. */
38-
#if defined(__GNUC__) || defined(__CC_ARM)
38+
#if defined(__GNUC__)
3939
#define PRINT_ATTRIBUTE(a, b) __attribute__((format(printf, a, b)))
4040
#else
4141
#define PRINT_ATTRIBUTE(a, b)

features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/include/wsf_types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ extern "C" {
5959
#if (((defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) && \
6060
(!defined(__ICC8051__) || (__ICC8051__ == 0))) || \
6161
(defined(__clang__) || defined(_MSC_VER)) || \
62-
defined(__CC_ARM) || defined(__IAR_SYSTEMS_ICC__) || defined(__ARMCC_VERSION))
62+
defined(__IAR_SYSTEMS_ICC__) || defined(__ARMCC_VERSION))
6363
#include <stdint.h>
6464
#else
6565
/*! \brief Signed 8-bit value. */

features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/thirdparty/uecc/uECC_ll.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ void uECC_set_rng_ll(uECC_RNG_Function rng_function) {
168168
g_rng_function = rng_function;
169169
}
170170

171-
#if !defined(__CC_ARM) && !defined(__ARMCC_VERSION) && !defined(__ICCARM__) && defined(__GNUC__) /* Only support GCC inline asm for now */
171+
#if !defined(__ARMCC_VERSION) && !defined(__ICCARM__) && defined(__GNUC__) /* Only support GCC inline asm for now */
172172
#if (uECC_ASM && (uECC_PLATFORM == uECC_arm || uECC_PLATFORM == uECC_arm_thumb || \
173173
uECC_PLATFORM == uECC_arm_thumb2))
174174
#include "asm_arm.inc"

features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/thirdparty/uecc/uECC_ll.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ uECC_asm_fast - Use GCC inline assembly optimized for maximum speed. */
2929
#define uECC_asm_small 1
3030
#define uECC_asm_fast 2
3131
#ifndef uECC_ASM
32-
#if !defined(__CC_ARM) && !defined(__ARMCC_VERSION) && !defined(__ICCARM__) && defined(__GNUC__) /* Only support GCC inline asm for now */
32+
#if !defined(__ARMCC_VERSION) && !defined(__ICCARM__) && defined(__GNUC__) /* Only support GCC inline asm for now */
3333
#define uECC_ASM uECC_asm_fast
3434
#else // DG: ARMCC 5, unlike GCC, IAR and CLANG, doesn't support GNU-style inline assembly
3535
#define uECC_ASM uECC_asm_none

features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_SOFTDEVICE/TARGET_MCU_NRF51822/sdk/source/ble/common/ble_conn_state.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,7 @@
3939
#include "app_error.h"
4040

4141

42-
#if defined(__CC_ARM)
43-
#pragma push
44-
#pragma anon_unions
45-
#elif defined(__ICCARM__)
42+
#if defined(__ICCARM__)
4643
#pragma language=extended
4744
#elif defined(__GNUC__)
4845
/* anonymous unions are enabled by default */
@@ -80,9 +77,7 @@ typedef struct
8077
} ble_conn_state_t;
8178

8279

83-
#if defined(__CC_ARM)
84-
#pragma pop
85-
#elif defined(__ICCARM__)
80+
#if defined(__ICCARM__)
8681
/* leave anonymous unions enabled */
8782
#elif defined(__GNUC__)
8883
/* 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_
411406
return 0;
412407
}
413408
}
414-

features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_SOFTDEVICE/TARGET_MCU_NRF51822/sdk/source/ble/device_manager/device_manager_peripheral.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,7 @@
3535
#include "ble_hci.h"
3636
#include "app_error.h"
3737

38-
#if defined ( __CC_ARM )
39-
#ifndef __ALIGN
40-
#define __ALIGN(x) __align(x) /**< Forced aligment keyword for ARM Compiler */
41-
#endif
42-
#elif defined ( __ICCARM__ )
38+
#if defined ( __ICCARM__ )
4339
#ifndef __ALIGN
4440
#define __ALIGN(x) /**< Forced aligment keyword for IAR Compiler */
4541
#endif

features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_SOFTDEVICE/TARGET_MCU_NRF51822/sdk/source/device/compiler_abstraction.h

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -34,28 +34,7 @@
3434

3535
/*lint ++flb "Enter library region" */
3636

37-
#if defined ( __CC_ARM )
38-
39-
#ifndef __ASM
40-
#define __ASM __asm
41-
#endif
42-
43-
#ifndef __INLINE
44-
#define __INLINE __inline
45-
#endif
46-
47-
#ifndef __WEAK
48-
#define __WEAK __weak
49-
#endif
50-
51-
#ifndef __ALIGN
52-
#define __ALIGN(n) __align(n)
53-
#endif
54-
55-
#define GET_SP() __current_sp()
56-
57-
#elif defined ( __ICCARM__ )
58-
37+
#if defined ( __ICCARM__ )
5938
#ifndef __ASM
6039
#define __ASM __asm
6140
#endif

features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_SOFTDEVICE/TARGET_MCU_NRF51822/sdk/source/device/nrf51.h

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,7 @@ typedef enum {
109109

110110

111111
/* ------------------- Start of section using anonymous unions ------------------ */
112-
#if defined(__CC_ARM)
113-
#pragma push
114-
#pragma anon_unions
115-
#elif defined(__ICCARM__)
112+
#if defined(__ICCARM__)
116113
#pragma language=extended
117114
#elif defined(__GNUC__)
118115
/* anonymous unions are enabled by default */
@@ -1155,9 +1152,7 @@ typedef struct { /*!< GPIO Structure
11551152

11561153

11571154
/* -------------------- End of section using anonymous unions ------------------- */
1158-
#if defined(__CC_ARM)
1159-
#pragma pop
1160-
#elif defined(__ICCARM__)
1155+
#if defined(__ICCARM__)
11611156
/* leave anonymous unions enabled */
11621157
#elif defined(__GNUC__)
11631158
/* anonymous unions are enabled by default */

features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_SOFTDEVICE/TARGET_MCU_NRF51822/sdk/source/drivers_nrf/delay/nrf_delay.h

Lines changed: 1 addition & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -43,75 +43,8 @@
4343
* @param number_of_ms
4444
*/
4545
/*lint --e{438, 522} "Variable not used" "Function lacks side-effects" */
46-
#if defined ( __CC_ARM )
4746

48-
static __ASM void __INLINE nrf_delay_us(uint32_t volatile number_of_us)
49-
{
50-
loop
51-
SUBS R0, R0, #1
52-
NOP
53-
NOP
54-
NOP
55-
NOP
56-
NOP
57-
NOP
58-
NOP
59-
NOP
60-
NOP
61-
NOP
62-
NOP
63-
NOP
64-
#ifdef NRF52
65-
NOP
66-
NOP
67-
NOP
68-
NOP
69-
NOP
70-
NOP
71-
NOP
72-
NOP
73-
NOP
74-
NOP
75-
NOP
76-
NOP
77-
NOP
78-
NOP
79-
NOP
80-
NOP
81-
NOP
82-
NOP
83-
NOP
84-
NOP
85-
NOP
86-
NOP
87-
NOP
88-
NOP
89-
NOP
90-
NOP
91-
NOP
92-
NOP
93-
NOP
94-
NOP
95-
NOP
96-
NOP
97-
NOP
98-
NOP
99-
NOP
100-
NOP
101-
NOP
102-
NOP
103-
NOP
104-
NOP
105-
NOP
106-
NOP
107-
NOP
108-
NOP
109-
#endif
110-
BNE loop
111-
BX LR
112-
}
113-
114-
#elif defined ( __ICCARM__ )
47+
#if defined ( __ICCARM__ )
11548

11649
static void __INLINE nrf_delay_us(uint32_t volatile number_of_us)
11750
{

features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_SOFTDEVICE/TARGET_MCU_NRF51822/sdk/source/libraries/bootloader_dfu/bootloader_util.c

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -49,42 +49,7 @@
4949
*
5050
* @note This function will never return but issue a reset into provided application.
5151
*/
52-
#if defined ( __CC_ARM )
53-
__asm static void bootloader_util_reset(uint32_t start_addr)
54-
{
55-
LDR R5, [R0] ; Get App initial MSP for bootloader.
56-
MSR MSP, R5 ; Set the main stack pointer to the applications MSP.
57-
LDR R0, [R0, #0x04] ; Load Reset handler into R0. This will be first argument to branch instruction (BX).
58-
59-
MOVS R4, #0xFF ; Load ones to R4.
60-
SXTB R4, R4 ; Sign extend R4 to obtain 0xFFFFFFFF instead of 0xFF.
61-
MRS R5, IPSR ; Load IPSR to R5 to check for handler or thread mode.
62-
CMP R5, #0x00 ; Compare, if 0 then we are in thread mode and can continue to reset handler of bootloader.
63-
BNE isr_abort ; If not zero we need to exit current ISR and jump to reset handler of bootloader.
64-
65-
MOV LR, R4 ; Clear the link register and set to ones to ensure no return, R4 = 0xFFFFFFFF.
66-
BX R0 ; Branch to reset handler of bootloader.
67-
68-
isr_abort
69-
; R4 contains ones from line above. Will be popped as R12 when exiting ISR (Cleaning up the registers).
70-
MOV R5, R4 ; Fill with ones before jumping to reset handling. We be popped as LR when exiting ISR. Ensures no return to application.
71-
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.
72-
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.
73-
REV r7, r7 ; Reverse byte order to put 0x21 as MSB.
74-
PUSH {r4-r7} ; Push everything to new stack to allow interrupt handler to fetch it on exiting the ISR.
75-
76-
MOVS R4, #0x00 ; Fill with zeros before jumping to reset handling. We be popped as R0 when exiting ISR (Cleaning up of the registers).
77-
MOVS R5, #0x00 ; Fill with zeros before jumping to reset handling. We be popped as R1 when exiting ISR (Cleaning up of the registers).
78-
MOVS R6, #0x00 ; Fill with zeros before jumping to reset handling. We be popped as R2 when exiting ISR (Cleaning up of the registers).
79-
MOVS R7, #0x00 ; Fill with zeros before jumping to reset handling. We be popped as R3 when exiting ISR (Cleaning up of the registers).
80-
PUSH {r4-r7} ; Push zeros (R4-R7) to stack to prepare for exiting the interrupt routine.
81-
82-
MOVS R0, #0xF9 ; Move the execution return command into register, 0xFFFFFFF9.
83-
SXTB R0, R0 ; Sign extend R0 to obtain 0xFFFFFFF9 instead of 0xF9.
84-
BX R0 ; No return - Handler mode will be exited. Stack will be popped and execution will continue in reset handler initializing other application.
85-
ALIGN
86-
}
87-
#elif defined ( __GNUC__ )
52+
#if defined ( __GNUC__ )
8853
static inline void bootloader_util_reset(uint32_t start_addr)
8954
{
9055
__asm volatile(

0 commit comments

Comments
 (0)