File tree Expand file tree Collapse file tree 3 files changed +68
-1
lines changed
targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52 Expand file tree Collapse file tree 3 files changed +68
-1
lines changed Original file line number Diff line number Diff line change 5757 uint32_t nrf_dispatch_vector [NVIC_NUM_VECTORS ] @ ".nvictable" ;
5858#endif
5959
60+ #include "platform/mbed_toolchain.h"
61+ #include "subtarget_init.h"
62+
6063extern uint32_t __Vectors [];
6164
6265#define VECTORS_FLASH_START __Vectors
@@ -113,7 +116,6 @@ void nrf_reloc_vector_table(void)
113116#endif
114117}
115118
116-
117119void mbed_sdk_init (void )
118120{
119121 if (STDIO_UART_RTS != NC ) {
@@ -122,4 +124,6 @@ void mbed_sdk_init(void)
122124 /* Set STDIO_UART_RTS as gpio driven low */
123125 gpio_write (& rts , 0 );
124126 }
127+
128+ subtarget_sdk_init ();
125129}
Original file line number Diff line number Diff line change 1+ /* mbed Microcontroller Library
2+ * Copyright (c) 2021 ARM Limited
3+ * Copyright (c) 2021 Embedded Planet, Inc.
4+ * SPDX-License-Identifier: Apache-2.0
5+ *
6+ * Licensed under the Apache License, Version 2.0 (the "License");
7+ * you may not use this file except in compliance with the License.
8+ * You may obtain a copy of the License at
9+ *
10+ * http://www.apache.org/licenses/LICENSE-2.0
11+ *
12+ * Unless required by applicable law or agreed to in writing, software
13+ * distributed under the License is distributed on an "AS IS" BASIS,
14+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+ * See the License for the specific language governing permissions and
16+ * limitations under the License.
17+ */
18+
19+ #include "subtarget_init.h"
20+ #include "platform/mbed_toolchain.h"
21+
22+ MBED_WEAK void subtarget_sdk_init (void ) {
23+ /* Do nothing by default */
24+ }
Original file line number Diff line number Diff line change 1+ /* mbed Microcontroller Library
2+ * Copyright (c) 2021 ARM Limited
3+ * Copyright (c) 2021 Embedded Planet, Inc.
4+ * SPDX-License-Identifier: Apache-2.0
5+ *
6+ * Licensed under the Apache License, Version 2.0 (the "License");
7+ * you may not use this file except in compliance with the License.
8+ * You may obtain a copy of the License at
9+ *
10+ * http://www.apache.org/licenses/LICENSE-2.0
11+ *
12+ * Unless required by applicable law or agreed to in writing, software
13+ * distributed under the License is distributed on an "AS IS" BASIS,
14+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+ * See the License for the specific language governing permissions and
16+ * limitations under the License.
17+ */
18+
19+ #ifndef _NORDIC_SUBTARGET_INIT_
20+ #define _NORDIC_SUBTARGET_INIT_
21+
22+ #ifdef __cplusplus
23+ extern "C" {
24+ #endif
25+
26+ /**
27+ * Since Mbed's `mbed_sdk_init` hook is used by the NRF52 family code, this
28+ * initialization hook is provided so subtargets may implement their own startup
29+ * initialization code, if necessary.
30+ *
31+ * By default, it is a blank function that is declared a "weak" symbol
32+ */
33+ void subtarget_sdk_init (void );
34+
35+ #ifdef __cplusplus
36+ }
37+ #endif
38+
39+ #endif /* _NORDIC_SUBTARGET_INIT_ */
You can’t perform that action at this time.
0 commit comments