Skip to content

Commit 3fe77a5

Browse files
committed
Fix known BUG in nrf_svc.h when compiled by GCC.
1 parent 96b2604 commit 3fe77a5

File tree

2 files changed

+30
-30
lines changed
  • hal/targets/hal/TARGET_NORDIC/TARGET_NRF5
    • TARGET_MCU_NRF51822/sdk/softdevice/s130/headers
    • TARGET_MCU_NRF52832/sdk/softdevice/s132/headers

2 files changed

+30
-30
lines changed

hal/targets/hal/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF51822/sdk/softdevice/s130/headers/nrf_svc.h

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
/*
1+
/*
22
* Copyright (c) Nordic Semiconductor ASA
33
* All rights reserved.
4-
*
4+
*
55
* Redistribution and use in source and binary forms, with or without modification,
66
* are permitted provided that the following conditions are met:
7-
*
7+
*
88
* 1. Redistributions of source code must retain the above copyright notice, this
99
* list of conditions and the following disclaimer.
10-
*
10+
*
1111
* 2. Redistributions in binary form must reproduce the above copyright notice, this
1212
* list of conditions and the following disclaimer in the documentation and/or
1313
* other materials provided with the distribution.
14-
*
14+
*
1515
* 3. Neither the name of Nordic Semiconductor ASA nor the names of other
1616
* contributors to this software may be used to endorse or promote products
1717
* derived from this software without specific prior written permission.
18-
*
18+
*
1919
* 4. This software must only be used in a processor manufactured by Nordic
2020
* Semiconductor ASA, or in a processor manufactured by a third party that
2121
* is used in combination with a processor manufactured by Nordic Semiconductor.
22-
*
23-
*
22+
*
23+
*
2424
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
2525
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
2626
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -31,9 +31,9 @@
3131
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3232
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
3333
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34-
*
34+
*
3535
*/
36-
36+
3737
#ifndef NRF_SVC__
3838
#define NRF_SVC__
3939

@@ -42,7 +42,7 @@
4242
#ifdef __cplusplus
4343
extern "C" {
4444
#endif
45-
45+
4646
#ifdef SVCALL_AS_NORMAL_FUNCTION
4747
#define SVCALL(number, return_type, signature) return_type signature
4848
#else
@@ -52,9 +52,9 @@ extern "C" {
5252
#define SVCALL(number, return_type, signature) return_type __svc(number) signature
5353
#elif defined (__GNUC__)
5454
#ifdef __cplusplus
55-
#define GCC_CAST_CPP (uint8_t)
55+
#define GCC_CAST_CPP (uint16_t)
5656
#else
57-
#define GCC_CAST_CPP
57+
#define GCC_CAST_CPP
5858
#endif
5959
#define SVCALL(number, return_type, signature) \
6060
_Pragma("GCC diagnostic push") \
@@ -69,14 +69,14 @@ extern "C" {
6969
); \
7070
} \
7171
_Pragma("GCC diagnostic pop")
72-
72+
7373
#elif defined (__ICCARM__)
7474
#define PRAGMA(x) _Pragma(#x)
7575
#define SVCALL(number, return_type, signature) \
7676
PRAGMA(swi_number = (number)) \
7777
__swi return_type signature;
7878
#else
79-
#define SVCALL(number, return_type, signature) return_type signature
79+
#define SVCALL(number, return_type, signature) return_type signature
8080
#endif
8181
#endif // SVCALL
8282

hal/targets/hal/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52832/sdk/softdevice/s132/headers/nrf_svc.h

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
/*
1+
/*
22
* Copyright (c) Nordic Semiconductor ASA
33
* All rights reserved.
4-
*
4+
*
55
* Redistribution and use in source and binary forms, with or without modification,
66
* are permitted provided that the following conditions are met:
7-
*
7+
*
88
* 1. Redistributions of source code must retain the above copyright notice, this
99
* list of conditions and the following disclaimer.
10-
*
10+
*
1111
* 2. Redistributions in binary form must reproduce the above copyright notice, this
1212
* list of conditions and the following disclaimer in the documentation and/or
1313
* other materials provided with the distribution.
14-
*
14+
*
1515
* 3. Neither the name of Nordic Semiconductor ASA nor the names of other
1616
* contributors to this software may be used to endorse or promote products
1717
* derived from this software without specific prior written permission.
18-
*
18+
*
1919
* 4. This software must only be used in a processor manufactured by Nordic
2020
* Semiconductor ASA, or in a processor manufactured by a third party that
2121
* is used in combination with a processor manufactured by Nordic Semiconductor.
22-
*
23-
*
22+
*
23+
*
2424
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
2525
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
2626
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -31,9 +31,9 @@
3131
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3232
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
3333
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34-
*
34+
*
3535
*/
36-
36+
3737
#ifndef NRF_SVC__
3838
#define NRF_SVC__
3939

@@ -42,7 +42,7 @@
4242
#ifdef __cplusplus
4343
extern "C" {
4444
#endif
45-
45+
4646
#ifdef SVCALL_AS_NORMAL_FUNCTION
4747
#define SVCALL(number, return_type, signature) return_type signature
4848
#else
@@ -52,9 +52,9 @@ extern "C" {
5252
#define SVCALL(number, return_type, signature) return_type __svc(number) signature
5353
#elif defined (__GNUC__)
5454
#ifdef __cplusplus
55-
#define GCC_CAST_CPP (uint8_t)
55+
#define GCC_CAST_CPP (uint16_t)
5656
#else
57-
#define GCC_CAST_CPP
57+
#define GCC_CAST_CPP
5858
#endif
5959
#define SVCALL(number, return_type, signature) \
6060
_Pragma("GCC diagnostic push") \
@@ -69,14 +69,14 @@ extern "C" {
6969
); \
7070
} \
7171
_Pragma("GCC diagnostic pop")
72-
72+
7373
#elif defined (__ICCARM__)
7474
#define PRAGMA(x) _Pragma(#x)
7575
#define SVCALL(number, return_type, signature) \
7676
PRAGMA(swi_number = (number)) \
7777
__swi return_type signature;
7878
#else
79-
#define SVCALL(number, return_type, signature) return_type signature
79+
#define SVCALL(number, return_type, signature) return_type signature
8080
#endif
8181
#endif // SVCALL
8282

0 commit comments

Comments
 (0)