31 lines
2.3 KiB
Raw Normal View History

# nrf51-sdk
2015-12-23 15:36:47 +00:00
Module to contain files provided by the nordic nRF51 SDK. The latest version of this module uses files from Nordic SDK 10.0.0. The files are extracted from [here](
## Changes made to Nordic files
The files are kept the same as much as possible to the Nordic SDK. Modifications are made in order to integrate with mbed.
- ble/common/ble_conn_state.c: Preprocessor tests regarding S110, S120 or S130 macro should be replace by TARGET_MCU_NRF51_XXK_SXXX tests
## Porting new versions of Nordic SDK
2015-11-17 23:08:20 +00:00
A list of files currently requierd by mbed is maintained in [script/required_files.txt]( [A python script]( is written to help porting from nordic sdk releases. **required_files.txt** is parsed to find a list of filenames. The script searches for these filenames in the sdk folder, and copy then into the yotta module mirroring the folder structure in the sdk. **extraIncludes** is automatically added to module.json to allow direct inclusion of noridc headers with just the filename.
### Script usage
python [options] <full-noridc-sdk-path> <nrf51-sdk-yotta-module-path>
options: --purge : to delete all existing files and start again
--dry-run : to list the files to be copied but not actually copy them
2015-11-17 22:49:24 +00:00
There are files in the sdk with the same filename but in different folder. This is dealt with by excluding certain directories. The excluded directories are listed in [](
2015-11-17 22:49:24 +00:00
After running the script, the changes in [the previous section](#changes-made-to-nordic-files) will have to be applied manually again.
Folder structure or even file name can change between releases of the nordic sdk, hence a degree of manual adjustment is needed when porting.
2015-11-17 23:06:18 +00:00
## Using Noridc Headers
2015-11-17 22:49:24 +00:00
The nordic sdk is written in C and yotta modules support C++. If you are trying to include Nordic files in a cpp program, you need to use the `extern "C"` keyword around the includes.
extern "C" {
#include "softdevice_handler.h"