Skip to content

Commit e0c628c

Browse files
committed
NRF51822: Fix baremetal linker error
Ensure the NRF51822 `us_ticker.c` module content is compiled in only if the target supports USTICKER.
1 parent af03f83 commit e0c628c

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

targets/TARGET_NORDIC/TARGET_MCU_NRF51822/us_ticker.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
17+
#if DEVICE_USTICKER
1618
#include <stddef.h>
1719
#include <stdbool.h>
1820
#include "us_ticker_api.h"
@@ -613,3 +615,4 @@ uint32_t os_tick_val(void) {
613615
return clock_cycles_by_tick - ((current_counter - next_tick_cc_value) % clock_cycles_by_tick);
614616
}
615617
}
618+
#endif // DEVICE_USTICKER

targets/targets.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5043,8 +5043,13 @@
50435043
"SERIAL",
50445044
"SLEEP",
50455045
"SPI",
5046-
"SPISLAVE"
5047-
]
5046+
"SPISLAVE",
5047+
"USTICKER"
5048+
],
5049+
"overrides": {
5050+
"tickless-from-us-ticker" : true,
5051+
"boot-stack-size" : "0x400"
5052+
}
50485053
},
50495054
"MCU_NRF51_16K_BASE": {
50505055
"inherits": ["MCU_NRF51"],

0 commit comments

Comments
 (0)