You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by cc...@apache.org on 2016/11/22 03:25:55 UTC

[40/51] [abbrv] [partial] incubator-mynewt-core git commit: Remove non-Apache-compatible Nordic SDK files.

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/a1481cb2/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/drivers_nrf/pstorage/pstorage.h
----------------------------------------------------------------------
diff --git a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/drivers_nrf/pstorage/pstorage.h b/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/drivers_nrf/pstorage/pstorage.h
deleted file mode 100644
index ac713dd..0000000
--- a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/drivers_nrf/pstorage/pstorage.h
+++ /dev/null
@@ -1,389 +0,0 @@
-/* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved.
- *
- * The information contained herein is property of Nordic Semiconductor ASA.
- * Terms and conditions of usage are described in detail in NORDIC
- * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
- *
- * Licensees are granted free, non-transferable use of the information. NO
- * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
- * the file.
- *
- */
-
-/**@file
- *
- * @defgroup persistent_storage Persistent Storage Interface
- * @{
- * @ingroup app_common
- * @brief Abstracted flash interface.
- *
- * @details  An abstracted interface is provided by the module to easily port the application and 
- *           SDK modules to an alternate option. This ensures that the SDK and application are moved 
- *           to alternate persistent storage instead of the one provided by default.
- */
-
-#ifndef PSTORAGE_H__
-#define PSTORAGE_H__
-
-#include "pstorage_platform.h"
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**@defgroup ps_opcode Persistent Storage Access Operation Codes
- * @{
- * @brief    Persistent Storage Access Operation Codes. 
- *
- * @details  Persistent Storage Access Operation Codes are used by Persistent storage operation 
- *           completion callback @ref pstorage_ntf_cb_t to identify the operation type requested by 
- *           the application.
- */
-#define PSTORAGE_STORE_OP_CODE    0x01  /**< Store Operation type. */
-#define PSTORAGE_LOAD_OP_CODE     0x02  /**< Load Operation type. */
-#define PSTORAGE_CLEAR_OP_CODE    0x03  /**< Clear Operation type. */
-#define PSTORAGE_UPDATE_OP_CODE   0x04  /**< Update Operation type. */
-
-/**@} */
-
-/**@defgroup pstorage_data_types Persistent Memory Interface Data Types
- * @{
- * @brief Data Types needed for interfacing with persistent memory.
- *
- * @details Data Types needed for interfacing with persistent memory.
- */
-
-/**@brief Persistent storage operation completion callback function type.
- *
- * @details The persistent storage operation completion callback is used by the interface to report
- *          success or failure of a flash operation. Since data is not copied for a store operation, 
- *          a callback is an indication that the resident memory can now be reused or freed.
- * 
- * @param[in] handle   Identifies the module and block for the callback that is received.
- * @param[in] op_code  Identifies the operation for the event that is notified.
- * @param[in] result   Identifies the result of a flash access operation. NRF_SUCCESS implies 
- *                     operation succeeded.
- *
- *                     @note Unmanaged (abnormal behaviour) error codes from the SoftDevice flash 
- *                     access API are forwarded as is and are expected to be handled by the 
- *                     application. For details refer to the implementation file and corresponding 
- *                     SoftDevice flash API documentation.
- *                     
- * @param[in] p_data   Identifies the application data pointer. For a store operation, this points 
- *                     to the resident source of application memory that the application can now 
- *                     free or reuse. When there is a clear operation, this is NULL since no 
- *                     application pointer is needed for this operation.
- * @param[in] data_len Length data the application provided for the operation. 
- */
-typedef void (*pstorage_ntf_cb_t)(pstorage_handle_t * p_handle,
-                                  uint8_t             op_code,
-                                  uint32_t            result,
-                                  uint8_t *           p_data,
-                                  uint32_t            data_len);
-
-/**@brief Struct containing module registration context. */
-typedef struct
-{
-    pstorage_ntf_cb_t cb;             /**< Persistent storage operation completion callback function @ref pstorage_ntf_cb_t.  */
-    pstorage_size_t   block_size;     /**< Desired block size for persistent memory storage. For example, if a module has a table with 10 entries, and each entry is 64 bytes in size,
-                                       *   it can request 10 blocks with a block size of 64 bytes. The module can also request one block that is 640 bytes depending 
-                                       *   on how it would like to access or alter the memory in persistent memory.
-                                       *   The first option is preferred when it is a single entry that needs to be updated often and doesn't impact the other entries.
-                                       *   The second option is preferred when table entries are not changed individually but have a common point of loading and storing
-                                       *   data. */
-    pstorage_size_t   block_count;    /** Number of blocks requested by the module; minimum values is 1. */
-} pstorage_module_param_t;
-
-/**@} */
-
-/**@defgroup pstorage_routines Persistent Storage Access Routines
- * @{
- * @brief Functions/Interface SDK modules used to persistently store data.
- *
- * @details Interface for the Application and SDK modules to load/store information persistently.
- *          Note: While implementation of each of the persistent storage access functions
- *          depends on the system and is specific to system/solution, the signature of the
- *          interface routines should not be altered.
- */
-
-/**@brief Function for initializing the module.
- *
- * @details Function for initializing the module. This function is called once before any other APIs 
- *          of the module are used.
- *
- * @retval     NRF_SUCCESS             Operation success.
- */
-uint32_t pstorage_init(void);
-
-/**@brief Function for registering with persistent storage interface.
- *
- * @param[in]  p_module_param Module registration parameter.
- * @param[out] p_block_id     Block identifier to identify persistent memory blocks when 
- *                            registration succeeds. Application is expected to use the block IDs 
- *                            for subsequent operations on requested persistent memory. Maximum 
- *                            registrations permitted is determined by the configuration of the 
- *                            parameter PSTORAGE_NUM_OF_PAGES. If more than one memory block is 
- *                            requested, the identifier provided here is the base identifier for the 
- *                            first block and used to identify the subsequent block. The application 
- *                            uses \@ref pstorage_block_identifier_get with this base identifier and 
- *                            block number. Therefore if 10 blocks of size 64 are requested and the 
- *                            application wishes to store memory in the 6th block, it shall use
- *                            \@ref pstorage_block_identifier_get with the base ID and provide a 
- *                            block number of 5. This way the application is only expected to 
- *                            remember the base block identifier.
- *
- * @retval     NRF_SUCCESS             Operation success.
- * @retval     NRF_ERROR_INVALID_STATE Operation failure. API is called without module 
- *                                     initialization.
- * @retval     NRF_ERROR_NULL          Operation failure. NULL parameter has been passed.
- * @retval     NRF_ERROR_INVALID_PARAM Operation failure. Invalid parameter has been passed.
- * @retval     NRF_ERROR_NO_MEM        Operation failure. Additional registrations can't be 
- *                                     supported.
- */
-uint32_t pstorage_register(pstorage_module_param_t * p_module_param,
-                           pstorage_handle_t *       p_block_id);
-
-/**@brief Function for getting block ID with reference to base block identifier provided at the time 
- *        of registration.
- *
- * @details Function to get the block ID with reference to base block identifier provided at the 
- *          time of registration.
- *          If more than one memory block was requested when registering, the identifier provided 
- *          here is the base identifier for the first block which is used to identify subsequent
- *          blocks. The application shall use this routine to get the block identifier, providing 
- *          input as base identifier and block number. Therefore, if 10 blocks of size 64 are 
- *          requested and the application wishes to store memory in the 6th block, it shall use
- *          \@ref pstorage_block_identifier_get with the base ID and provide a block number of 5.
- *          This way the application is only expected to remember the base block identifier.
- *
- * @param[in]  p_base_id  Base block ID received at the time of registration.
- * @param[in]  block_num  Block Number, with first block numbered zero.
- * @param[out] p_block_id Block identifier for the block number requested when the API succeeds.
- *
- * @retval     NRF_SUCCESS             Operation success. 
- * @retval     NRF_ERROR_INVALID_STATE Operation failure. API is called without module 
- *                                     initialization.
- * @retval     NRF_ERROR_NULL          Operation failure. NULL parameter has been passed.
- * @retval     NRF_ERROR_INVALID_PARAM Operation failure. Invalid parameter has been passed.
- */
-uint32_t pstorage_block_identifier_get(pstorage_handle_t * p_base_id,
-                                       pstorage_size_t     block_num,
-                                       pstorage_handle_t * p_block_id);
-
-/**@brief Function for persistently storing data of length 'size' contained in the 'p_src' address
- *        in the storage module at 'p_dest' address. Equivalent to Storage Write.
- *
- * @param[in]  p_dest Destination address where data is to be stored persistently.
- * @param[in]  p_src  Source address containing data to be stored. API assumes this to be resident
- *                    memory and no intermediate copy of data is made by the API. Must be word 
- *                    aligned.
- * @param[in]  size   Size of data to be stored expressed in bytes. Must be word aligned and size + 
- *                    offset must be <= block size.                      
- * @param[in]  offset Offset in bytes to be applied when writing to the block.
- *                    For example, if within a block of 100 bytes, the application wishes to
- *                    write 20 bytes at an offset of 12, then this field should be set to 12.
- *                    Must be word aligned.
- *
- * @retval     NRF_SUCCESS             Operation success. 
- * @retval     NRF_ERROR_INVALID_STATE Operation failure. API is called without module 
- *                                     initialization.
- * @retval     NRF_ERROR_NULL          Operation failure. NULL parameter has been passed.
- * @retval     NRF_ERROR_INVALID_PARAM Operation failure. Invalid parameter has been passed.
- * @retval     NRF_ERROR_INVALID_ADDR  Operation failure. Parameter is not aligned.
- * @retval     NRF_ERROR_NO_MEM        Operation failure. No storage space available.
- *
- * @warning    No copy of the data is made, meaning memory provided for the data source that is to 
- *             be written to flash cannot be freed or reused by the application until this procedure
- *             is complete. The application is notified when the procedure is finished using the
- *             notification callback registered by the application.
- */
-uint32_t pstorage_store(pstorage_handle_t * p_dest,
-                        uint8_t *           p_src,
-                        pstorage_size_t     size,
-                        pstorage_size_t     offset);
-
-/**@brief Function for updating persistently stored data of length 'size' contained in the 'p_src' 
- *        address in the storage module at 'p_dest' address.
- *
- * @param[in]  p_dest Destination address where data is to be updated.
- * @param[in]  p_src  Source address containing data to be stored. API assumes this to be resident
- *                    memory and no intermediate copy of data is made by the API.
- * @param[in]  size   Size of data to be stored expressed in bytes. Must be word aligned and size + 
- *                    offset must be <= block size.
- * @param[in]  offset Offset in bytes to be applied when writing to the block.
- *                    For example, if within a block of 100 bytes, the application wishes to
- *                    write 20 bytes at an offset of 12 bytes, then this field should be set to 12.
- *                    Must be word aligned.
- *
- * @retval     NRF_SUCCESS             Operation success. 
- * @retval     NRF_ERROR_INVALID_STATE Operation failure. API is called without module 
- *                                     initialization.
- * @retval     NRF_ERROR_NULL          Operation failure. NULL parameter has been passed.
- * @retval     NRF_ERROR_INVALID_PARAM Operation failure. Invalid parameter has been passed.
- * @retval     NRF_ERROR_INVALID_ADDR  Operation failure. Parameter is not aligned.
- * @retval     NRF_ERROR_NO_MEM        Operation failure. No storage space available.
- *
- * @warning    No copy of the data is made, meaning memory provided for the data source that is to 
- *             be written to flash cannot be freed or reused by the application until this procedure
- *             is complete. The application is notified when the procedure is finished using the
- *             notification callback registered by the application.
- */
-uint32_t pstorage_update(pstorage_handle_t * p_dest,
-                         uint8_t *           p_src,
-                         pstorage_size_t     size,
-                         pstorage_size_t     offset);
-
-/**@brief Function for loading persistently stored data of length 'size' from 'p_src' address
- *        to 'p_dest' address. Equivalent to Storage Read.
- *
- * @param[in]  p_dest Destination address where persistently stored data is to be loaded.
- * @param[in]  p_src  Source where data is loaded from persistent memory.
- * @param[in]  size   Size of data to be loaded from persistent memory expressed in bytes.
- *                    Should be word aligned.
- * @param[in]  offset Offset in bytes, to be applied when loading from the block.
- *                    For example, if within a block of 100 bytes, the application wishes to
- *                    load 20 bytes from offset of 12 bytes, then this field should be set to 12.
- *                    Should be word aligned.
- *
- * @retval     NRF_SUCCESS             Operation success. 
- * @retval     NRF_ERROR_INVALID_STATE Operation failure. API is called without module 
- *                                     initialization.
- * @retval     NRF_ERROR_NULL          Operation failure. NULL parameter has been passed.
- * @retval     NRF_ERROR_INVALID_PARAM Operation failure. Invalid parameter has been passed.
- * @retval     NRF_ERROR_INVALID_ADDR  Operation failure. Parameter is not aligned.
- * @retval     NRF_ERROR_NO_MEM        Operation failure. No storage space available.
- */
-uint32_t pstorage_load(uint8_t *           p_dest,
-                       pstorage_handle_t * p_src,
-                       pstorage_size_t     size,
-                       pstorage_size_t     offset);
-
-/**@brief Function for clearing data in persistent memory.
- *
- * @param[in]  p_base_id Base block identifier in persistent memory that needs to be cleared;
- *                       equivalent to an Erase Operation.
- * @param[in]  size      Size of data to be cleared from persistent memory expressed in bytes.
- *                       This parameter is to provision for clearing of certain blocks
- *                       of memory, or all memory blocks in a registered module. If the total size 
- *                       of the application module is used (blocks * block size) in combination with
- *                       the identifier for the first block in the module, all blocks in the 
- *                       module will be erased. Must be multiple of block size.
- *
- * @retval     NRF_SUCCESS             Operation success. 
- * @retval     NRF_ERROR_INVALID_STATE Operation failure. API is called without module 
- *                                     initialization.
- * @retval     NRF_ERROR_NULL          Operation failure. NULL parameter has been passed.
- * @retval     NRF_ERROR_INVALID_PARAM Operation failure. Invalid parameter has been passed.
- * @retval     NRF_ERROR_INVALID_ADDR  Operation failure. Parameter is not aligned.
- * @retval     NRF_ERROR_NO_MEM        Operation failure. No storage space available.
- *
- * @note       Clear operations may take time. This API however, does not block until the clear
- *             procedure is complete. The application is notified of procedure completion using
- *             a notification callback registered by the application. The 'result' parameter of the
- *             callback indicates if the procedure was successful or not.
- */
-uint32_t pstorage_clear(pstorage_handle_t * p_base_id, pstorage_size_t size);
-
-/**@brief Function for getting the number of pending operations with the module.
- *
- * @param[out] p_count Number of storage operations pending with the module. If 0, there are no 
- *                     outstanding requests.
- *
- * @retval     NRF_SUCCESS             Operation success. 
- * @retval     NRF_ERROR_INVALID_STATE Operation failure. API is called without module 
- *                                     initialization.
- * @retval     NRF_ERROR_NULL          Operation failure. NULL parameter has been passed.
- */
-uint32_t pstorage_access_status_get(uint32_t * p_count);
-
-#ifdef PSTORAGE_RAW_MODE_ENABLE
-
-/**@brief Function for registering with the persistent storage interface.
- *
- * @param[in]  p_module_param Module registration parameter.
- * @param[out] p_block_id     Block identifier used to identify persistent memory blocks upon 
- *                            successful registration. The application is expected to use the block 
- *                            IDs for subsequent operations on requested persistent memory. When 
- *                            more than one memory block is requested, this identifier is the base 
- *                            identifier for the first block and used to identify subsequent blocks. 
- *                            The application shall use \@ref pstorage_block_identifier_get with 
- *                            this base identifier and block number. Therefore if 10 blocks of size 
- *                            64 are requested and the application wishes to store memory in the 6th 
- *                            block, it shall use \@ref pstorage_block_identifier_get with the base 
- *                            ID and provide a block number of 5. Therefore, the application is only 
- *                            expected to remember the base block identifier.
- *
- * @retval     NRF_SUCCESS             Operation success. 
- * @retval     NRF_ERROR_INVALID_STATE Operation failure. API is called without module 
- *                                     initialization.
- * @retval     NRF_ERROR_NULL          Operation failure. NULL parameter has been passed.
- * @retval     NRF_ERROR_INVALID_PARAM Operation failure. Invalid parameter has been passed.
- * @retval     NRF_ERROR_NO_MEM        Operation failure. No storage space available.
- */
-uint32_t pstorage_raw_register(pstorage_module_param_t * p_module_param,
-                               pstorage_handle_t *       p_block_id);
-
-/**@brief Function for persistently storing data of length 'size' contained in 'p_src' address in 
- *        storage module at 'p_dest' address. Equivalent to Storage Write.
- *
- * @param[in]  p_dest Destination address where data is to be stored persistently.
- * @param[in]  p_src  Source address containing data to be stored. The API assumes this is resident
- *                    memory and no intermediate copy of data is made by the API. Must be word 
- *                    aligned.
- * @param[in]  size   Size of data to be stored expressed in bytes. Must be word aligned.
- * @param[in]  offset Offset in bytes to be applied when writing to the block.
- *                    For example, if within a block of 100 bytes, the application wishes to
- *                    write 20 bytes at an offset of 12 bytes, this field should be set to 12.
- *                    Must be word aligned.
- *
- * @retval     NRF_SUCCESS             Operation success. 
- * @retval     NRF_ERROR_INVALID_STATE Operation failure. API is called without module 
- *                                     initialization.
- * @retval     NRF_ERROR_NULL          Operation failure. NULL parameter has been passed.
- * @retval     NRF_ERROR_INVALID_PARAM Operation failure. Invalid parameter has been passed.
- * @retval     NRF_ERROR_INVALID_ADDR  Operation failure. Parameter is not aligned.
- * @retval     NRF_ERROR_NO_MEM        Operation failure. No storage space available.
- *
- * @warning    No copy of the data is made, meaning memory provided for data source that is to be 
- *             written to flash cannot be freed or reused by the application until this procedure
- *             is complete. The application is notified when the procedure is finished using the
- *             notification callback registered by the application.
- */
-uint32_t pstorage_raw_store(pstorage_handle_t * p_dest,
-                            uint8_t *           p_src,
-                            pstorage_size_t     size,
-                            pstorage_size_t     offset);
-
-/**@brief Function for clearing data in persistent memory in raw mode.
- *
- * @param[in]  p_dest Base block identifier in persistent memory that needs to be cleared.
- *                    Equivalent to an Erase Operation.
- * @param[in]  size   Size of data to be cleared from persistent memory expressed in bytes. 
- *                    Not used.
- *
- * @retval     NRF_SUCCESS             Operation success. 
- * @retval     NRF_ERROR_INVALID_STATE Operation failure. API is called without module 
- *                                     initialization.
- * @retval     NRF_ERROR_NULL          Operation failure. NULL parameter has been passed.
- * @retval     NRF_ERROR_INVALID_PARAM Operation failure. Invalid parameter has been passed.
- * @retval     NRF_ERROR_NO_MEM        Operation failure. No storage space available.
- *
- * @note       Clear operations may take time. This API, however, does not block until the clear
- *             procedure is complete. The application is notified of procedure completion using
- *             a notification callback registered by the application. The 'result' parameter of the
- *             callback indicates if the procedure was successful or not.
- */
-uint32_t pstorage_raw_clear(pstorage_handle_t * p_dest, pstorage_size_t size);
-
-#endif // PSTORAGE_RAW_MODE_ENABLE
-
-/**@} */
-/**@} */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // PSTORAGE_H__
-

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/a1481cb2/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/drivers_nrf/pstorage/pstorage_nosd.c
----------------------------------------------------------------------
diff --git a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/drivers_nrf/pstorage/pstorage_nosd.c b/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/drivers_nrf/pstorage/pstorage_nosd.c
deleted file mode 100644
index dafa64e..0000000
--- a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/drivers_nrf/pstorage/pstorage_nosd.c
+++ /dev/null
@@ -1,525 +0,0 @@
-/* Copyright (c)  2013 Nordic Semiconductor. All Rights Reserved.
- *
- * The information contained herein is property of Nordic Semiconductor ASA.
- * Terms and conditions of usage are described in detail in NORDIC
- * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
- *
- * Licensees are granted free, non-transferable use of the information. NO
- * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
- * the file.
- *
- */
-
-#include "pstorage.h"
-#include "nordic_common.h"
-#include "nrf_error.h"
-#include "ble_flash.h"
-#include "app_util.h"
-#include <stdlib.h>
-#include <stdint.h>
-#include <string.h>
-
-
-#define no_SUPPORT_MODULES_LARGER_THAN_PAGE
-
-/**
- * @defgroup api_param_check API Parameters check macros.
- *
- * @details Macros that verify parameters passed to the module in the APIs. These macros
- *          could be mapped to nothing in final versions of code to save execution and size.
- *
- * @{
- */
-/**
- * @brief Checks if API parameters are null. Mostly used for pointer parameters.
- */
-#define NULL_PARAM_CHECK(PARAM)                                                                   \
-        if ((PARAM) == NULL)                                                                      \
-        {                                                                                         \
-            return NRF_ERROR_NULL;                                                                \
-        }
-
-/**@brief Verifies the module identifier supplied by the application is within permissible
- *        range.
- */
-#define MODULE_ID_RANGE_CHECK(ID)                                                                 \
-        if ((PSTORAGE_NUM_OF_PAGES <= ((ID)->module_id)) ||                                       \
-            (m_app_table[(ID)->module_id].cb == NULL))                                            \
-        {                                                                                         \
-            return NRF_ERROR_INVALID_PARAM;                                                       \
-        }
-
-/**@brief Verifies the block identifier supplied by the application is within the permissible
- *        range.
- */
-#define BLOCK_ID_RANGE_CHECK(ID)                                                                  \
-        if (                                                                                      \
-            (                                                                                     \
-             m_app_table[(ID)->module_id].base_id                                                 \
-             +                                                                                    \
-             (                                                                                    \
-              m_app_table[(ID)->module_id].block_count                                            \
-              *                                                                                   \
-              MODULE_BLOCK_SIZE(ID)                                                               \
-             )                                                                                    \
-            )                                                                                     \
-            <=                                                                                    \
-            ((ID)->block_id)                                                                      \
-           )                                                                                      \
-        {                                                                                         \
-            return NRF_ERROR_INVALID_PARAM;                                                       \
-        }
-
-
-/**@brief Verifies the block size requested by the application can be supported by the module. */
-#define BLOCK_SIZE_CHECK(X)                                                                       \
-        if (((X) > PSTORAGE_MAX_BLOCK_SIZE) || ((X) < PSTORAGE_MIN_BLOCK_SIZE))                   \
-        {                                                                                         \
-            return NRF_ERROR_INVALID_PARAM;                                                       \
-        }
-
-/**@brief Verifies block size requested by Application in registration API */
-#define BLOCK_COUNT_CHECK(COUNT, SIZE)                                                            \
-        if (((COUNT) == 0) || ((m_next_page_addr + ((COUNT) *(SIZE)) > PSTORAGE_DATA_END_ADDR)))  \
-        {                                                                                         \
-            return NRF_ERROR_INVALID_PARAM;                                                       \
-        }
-
-/**@brief Verifies size parameter provided by application in API. */
-#define SIZE_CHECK(ID, SIZE)                                                                      \
-        if(((SIZE) == 0) || ((SIZE) > MODULE_BLOCK_SIZE(ID)))                                     \
-        {                                                                                         \
-            return NRF_ERROR_INVALID_PARAM;                                                       \
-        }
-
-/**@brief Verifies offset parameter provided by application in API. */
-#define OFFSET_CHECK(ID, OFFSET, SIZE)                                                            \
-        if(((SIZE) + (OFFSET)) > MODULE_BLOCK_SIZE(ID))                                           \
-        {                                                                                         \
-            return NRF_ERROR_INVALID_PARAM;                                                       \
-        }
-
-/**@brief SET BASE by masking offset bits for a address within page */
-#define PAGE_BASE_ADDR(flash_address)  ((flash_address)&(~((uint32_t)PSTORAGE_FLASH_PAGE_SIZE-1)))
-
-/**@brief Verifies the total module size requested by the application can be supported by the module. */
-#define MODULE_SIZE_CHECK(X)                                                                      \
-        if ((X) > PSTORAGE_FLASH_PAGE_SIZE)                   									  \
-        {                                                                                         \
-            return NRF_ERROR_INVALID_PARAM;                                                       \
-        }
-
-/**@} */
-
- /**@brief    Verify module's initialization status.
- *
- * @details   Verify module's initialization status. Returns NRF_ERROR_INVALID_STATE in case a
- *            module API is called without initializing the module.
- */
-#define VERIFY_MODULE_INITIALIZED()                                                               \
-        do                                                                                        \
-        {                                                                                         \
-            if (!m_module_initialized)                                                            \
-            {                                                                                     \
-                 return NRF_ERROR_INVALID_STATE;                                                  \
-            }                                                                                     \
-        } while(0)
-
-/**@brief Macro to fetch the block size registered for the module. */
-#define MODULE_BLOCK_SIZE(ID) (m_app_table[(ID)->module_id].block_size)
-
-/**@} */
-
-/**
- * @brief   Application registration information.
- *
- * @details Abstracts application specific information that application needs to maintain to be able
- *          to process requests from each one of them.
- *
- */
-typedef struct ps_module_table
-{
-    pstorage_ntf_cb_t      cb;             /**< Callback registered with the module to be notified of any error occurring in persistent memory management */
-    pstorage_block_t       base_id;        /**< Base block id assigned to the module */
-    uint16_t               block_size;     /**< Size of block for the module */
-    uint16_t               block_count;    /**< Number of block requested by application */
-    uint16_t               no_of_pages;    /**< Variable to remember how many pages have been allocated for this module. This information is used for clearing of block, so that application does not need to have knowledge of number of pages its using. */
-} pstorage_module_table_t;
-
-static pstorage_module_table_t m_app_table[PSTORAGE_NUM_OF_PAGES];        /**< Registered application information table. */
-
-static uint32_t m_next_app_instance;                                      /**< Points to the application module instance that can be allocated next */
-static uint32_t m_next_page_addr;                                         /**< Points to the flash address that can be allocated to a module next, this is needed as blocks of a module can span across flash pages. */
-
-static bool     m_module_initialized = false;                             /**< Flag for checking if module has been initialized. */
-
-
-/**
- * @brief Routine to notify application of any errors.
- *
- * @param[in] result Result of event being notified.
- */
-static __INLINE void app_notify(pstorage_handle_t    * p_handle,
-                                uint8_t              * p_addr,
-                                uint8_t                op_code,
-                                pstorage_size_t        size,
-                                uint32_t               result)
-{
-    pstorage_ntf_cb_t  ntf_cb;
-
-    ntf_cb = m_app_table[p_handle->module_id].cb;
-
-    // Indicate result to client.
-    // For PSTORAGE_CLEAR_OP_CODE no size is returned as the size field is used only internally
-    // for clients registering multiple pages.
-    ntf_cb(p_handle,
-           op_code,
-           result,
-           p_addr,
-           size);
-}
-
-
-uint32_t pstorage_init(void)
-{
-    m_next_app_instance  = 0;
-    m_next_page_addr     = PSTORAGE_DATA_START_ADDR;
-    m_module_initialized = true;
-    return NRF_SUCCESS;
-}
-
-
-uint32_t pstorage_register(pstorage_module_param_t * p_module_param,
-                           pstorage_handle_t       * p_block_id)
-{
-
-
-    VERIFY_MODULE_INITIALIZED();
-    NULL_PARAM_CHECK(p_module_param);
-    NULL_PARAM_CHECK(p_block_id);
-    NULL_PARAM_CHECK(p_module_param->cb);
-    BLOCK_SIZE_CHECK(p_module_param->block_size);
-    BLOCK_COUNT_CHECK(p_module_param->block_count, p_module_param->block_size);
-
-#ifndef SUPPORT_MODULES_LARGER_THAN_PAGE
-    MODULE_SIZE_CHECK(((uint16_t)(p_module_param->block_size)*(p_module_param->block_count)));
-#endif
-
-
-    if (m_next_app_instance == PSTORAGE_NUM_OF_PAGES)
-    {
-        return NRF_ERROR_NO_MEM;
-    }
-
-    p_block_id->module_id                        = m_next_app_instance;
-    p_block_id->block_id                         = m_next_page_addr;
-
-    m_app_table[m_next_app_instance].base_id     = p_block_id->block_id;
-    m_app_table[m_next_app_instance].cb          = p_module_param->cb;
-    m_app_table[m_next_app_instance].block_size  = p_module_param->block_size;
-    m_app_table[m_next_app_instance].block_count = p_module_param->block_count;
-
-    // Calculate number of flash pages allocated for the device.
-
-
-#ifdef SUPPORT_MODULES_LARGER_THAN_PAGE
-    uint16_t page_count = 0;
-    uint32_t total_size;
-    total_size = p_module_param->block_size * p_module_param->block_count;
-    do
-    {
-        page_count++;
-
-        if (total_size > PSTORAGE_FLASH_PAGE_SIZE)
-        {
-            total_size -= PSTORAGE_FLASH_PAGE_SIZE;
-        }
-        else
-        {
-            total_size = 0;
-        }
-
-        m_next_page_addr += PSTORAGE_FLASH_PAGE_SIZE;
-
-    } while (total_size >= PSTORAGE_FLASH_PAGE_SIZE);
-    m_app_table[m_next_app_instance].no_of_pages = page_count;
-#else
-    m_app_table[m_next_app_instance].no_of_pages = 1;
-    m_next_page_addr += PSTORAGE_FLASH_PAGE_SIZE;
-#endif
-    m_next_app_instance++;
-
-    return NRF_SUCCESS;
-}
-
-
-uint32_t pstorage_block_identifier_get(pstorage_handle_t * p_base_id,
-                                       pstorage_size_t     block_num,
-                                       pstorage_handle_t * p_block_id)
-{
-    pstorage_handle_t temp_id;
-
-    VERIFY_MODULE_INITIALIZED();
-    NULL_PARAM_CHECK(p_base_id);
-    NULL_PARAM_CHECK(p_block_id);
-    MODULE_ID_RANGE_CHECK(p_base_id);
-
-    temp_id           = (*p_base_id);
-    temp_id.block_id += (block_num * MODULE_BLOCK_SIZE(p_base_id));
-
-    BLOCK_ID_RANGE_CHECK(&temp_id);
-
-    (*p_block_id) = temp_id;
-
-    return NRF_SUCCESS;
-}
-
-
-uint32_t pstorage_store(pstorage_handle_t * p_dest,
-                        uint8_t           * p_src,
-                        pstorage_size_t     size,
-                        pstorage_size_t     offset)
-{
-    VERIFY_MODULE_INITIALIZED();
-    NULL_PARAM_CHECK(p_src);
-    NULL_PARAM_CHECK(p_dest);
-    MODULE_ID_RANGE_CHECK(p_dest);
-    BLOCK_ID_RANGE_CHECK(p_dest);
-    SIZE_CHECK(p_dest, size);
-    OFFSET_CHECK(p_dest, offset, size);
-
-    // Verify word alignment.
-    if ((!is_word_aligned(p_src)) || (!is_word_aligned((void *)(uint32_t)offset)))
-    {
-        return NRF_ERROR_INVALID_ADDR;
-    }
-
-    uint32_t storage_addr = p_dest->block_id + offset;
-
-    uint32_t retval = ble_flash_block_write((uint32_t *)storage_addr,
-                                            (uint32_t *)p_src,
-                                            (size /sizeof(uint32_t)));
-
-    app_notify(p_dest, p_src, PSTORAGE_STORE_OP_CODE, size, retval);
-    
-    return retval;
-}
-
-/** @brief Function for handling flash updates using swap page
- *
- * __________________________________________________
- * |              Page1                            |
- * |_______________________________________________|
- * | head |    body (to be updated )        | tail |
- * |______|_________________________________|______|
- *
- * ________________________________________________________________________________________
- * |              Page1                            |             Page2                    |
- * |_______________________________________________|______________________________________|
- * | head           |          body (to be updated )         | tail                       |
- * |________________|________________________________________|____________________________|
- *
- *
- * ToDo:  pointers not uint32_t for addresses
- *
- */
-
-uint32_t pstorage_update(pstorage_handle_t * p_dest,
-                        uint8_t           * p_src,
-                        pstorage_size_t     size,
-                        pstorage_size_t     offset)
-{
-
-    VERIFY_MODULE_INITIALIZED();
-    NULL_PARAM_CHECK(p_src);
-    NULL_PARAM_CHECK(p_dest);
-    MODULE_ID_RANGE_CHECK(p_dest);
-    BLOCK_ID_RANGE_CHECK(p_dest);
-    SIZE_CHECK(p_dest, size);
-    OFFSET_CHECK(p_dest, offset, size);
-
-    uint32_t *p_swap_addr = (uint32_t *)PSTORAGE_SWAP_ADDR;
-    uint32_t *p_page_addr1 =  (uint32_t *) PAGE_BASE_ADDR(p_dest->block_id + offset);
-#ifdef SUPPORT_MODULES_LARGER_THAN_PAGE
-    uint32_t *p_page_addr2 =  (uint32_t *) PAGE_BASE_ADDR(p_dest->block_id + offset + size-1);
-#endif
-    // block may not be aligned with page, so head must include all trailing blocks
-    uint16_t head_word_count =  (uint32_t)((uint32_t *)p_dest->block_id - p_page_addr1) + (offset)/sizeof(uint32_t);
-    uint16_t body_word_count =  size/sizeof(uint32_t);
-    uint16_t tail_word_count;
-    uint32_t retval;
-
-    // Verify word alignment.
-    if ((!is_word_aligned(p_src)) || (!is_word_aligned((void *)(uint32_t)offset)))
-    {
-        return NRF_ERROR_INVALID_ADDR;
-    }
-    // erase swap page
-    (void) ble_flash_page_erase(PSTORAGE_SWAP_ADDR / BLE_FLASH_PAGE_SIZE);
-#ifdef SUPPORT_MODULES_LARGER_THAN_PAGE
-    if (p_page_addr1 == p_page_addr2)
-    {
-#endif
-    	// tail is in the same page as head
-        tail_word_count = BLE_FLASH_PAGE_SIZE/sizeof(uint32_t) - head_word_count - body_word_count;
-    	// copy of the head
-        if (head_word_count)
-        {
-        	retval = ble_flash_block_write(p_swap_addr, p_page_addr1, head_word_count );
-        	if (retval != NRF_SUCCESS)
-        	{
-        		app_notify(p_dest, p_src, PSTORAGE_UPDATE_OP_CODE, size, retval);
-        		return retval;
-        	}
-        }
-        // copy of the body
-        retval = ble_flash_block_write(p_swap_addr+head_word_count, (uint32_t *)p_src, body_word_count);
-        if (retval != NRF_SUCCESS)
-        {
-          app_notify(p_dest, p_src, PSTORAGE_UPDATE_OP_CODE, size, retval);
-          return retval;
-        }
-        // copy of the tail
-        if (tail_word_count)
-        {
-        	retval = ble_flash_block_write(p_swap_addr+head_word_count+body_word_count, p_page_addr1+head_word_count+body_word_count, tail_word_count );
-        	if (retval != NRF_SUCCESS)
-        	{
-        		app_notify(p_dest, p_src, PSTORAGE_UPDATE_OP_CODE, size, retval);
-        		return retval;
-        	}
-        }
-        // erase active page
-        (void) ble_flash_page_erase((uint32_t)p_page_addr1 / BLE_FLASH_PAGE_SIZE);
-        // restore updated page
-        retval = ble_flash_block_write(p_page_addr1, p_swap_addr, BLE_FLASH_PAGE_SIZE/sizeof(uint32_t));
-#ifdef SUPPORT_MODULES_LARGER_THAN_PAGE
-    }
-    else
-    {
-    	// tail is in NOT in the same page as head - need to swap twice
-    	uint16_t body1_word_count =  BLE_FLASH_PAGE_SIZE/sizeof(uint32_t) - head_word_count;
-    	uint16_t body2_word_count =  body_word_count - body1_word_count;
-        tail_word_count = BLE_FLASH_PAGE_SIZE/sizeof(uint32_t) - body2_word_count;
-        // copy head
-        retval = ble_flash_block_write(p_swap_addr, p_page_addr1, head_word_count );
-    	if (retval != NRF_SUCCESS)
-    	{
-    		app_notify(p_dest, p_src, PSTORAGE_UPDATE_OP_CODE, size, retval);
-    		return retval;
-    	}
-        // copy body1
-        retval = ble_flash_block_write(p_swap_addr, (uint32_t *)p_src, body1_word_count );
-    	if (retval != NRF_SUCCESS)
-    	{
-    		app_notify(p_dest, p_src, PSTORAGE_UPDATE_OP_CODE, size, retval);
-    		return retval;
-    	}
-        // erase active page
-        (void) ble_flash_page_erase((uint32_t)p_page_addr1 / BLE_FLASH_PAGE_SIZE);
-        // restore updated page1
-        retval = ble_flash_block_write(p_page_addr1, p_swap_addr, BLE_FLASH_PAGE_SIZE/sizeof(uint32_t));
-    	if (retval != NRF_SUCCESS)
-    	{
-    		app_notify(p_dest, p_src, PSTORAGE_UPDATE_OP_CODE, size, retval);
-    		return retval;
-    	}
-        // erase swap page
-        (void) ble_flash_page_erase(PSTORAGE_SWAP_ADDR / BLE_FLASH_PAGE_SIZE);
-        // copy body2
-        retval = ble_flash_block_write(p_swap_addr, (uint32_t *)p_src + body1_word_count, body2_word_count );
-    	if (retval != NRF_SUCCESS)
-    	{
-    		app_notify(p_dest, p_src, PSTORAGE_UPDATE_OP_CODE, size, retval);
-    		return retval;
-    	}
-        // copy tail
-        retval = ble_flash_block_write(p_swap_addr, p_page_addr2+body2_word_count, tail_word_count );
-    	if (retval != NRF_SUCCESS)
-    	{
-    		app_notify(p_dest, p_src, PSTORAGE_UPDATE_OP_CODE, size, retval);
-    		return retval;
-    	}
-        // erase active page
-        (void) ble_flash_page_erase((uint32_t)p_page_addr2 / BLE_FLASH_PAGE_SIZE);
-        // restore updated page2
-        retval = ble_flash_block_write(p_page_addr2, p_swap_addr, BLE_FLASH_PAGE_SIZE/sizeof(uint32_t));
-    	if (retval != NRF_SUCCESS)
-    	{
-    		app_notify(p_dest, p_src, PSTORAGE_UPDATE_OP_CODE, size, retval);
-    		return retval;
-    	}
-    }
-#endif
-    app_notify(p_dest, p_src, PSTORAGE_UPDATE_OP_CODE, size, retval);
-    return retval;
-
-}
-
-uint32_t pstorage_load(uint8_t *           p_dest,
-                       pstorage_handle_t * p_src,
-                       pstorage_size_t     size,
-                       pstorage_size_t     offset)
-{
-    VERIFY_MODULE_INITIALIZED();
-    NULL_PARAM_CHECK(p_src);
-    NULL_PARAM_CHECK(p_dest);
-    MODULE_ID_RANGE_CHECK (p_src);
-    BLOCK_ID_RANGE_CHECK(p_src);
-    SIZE_CHECK(p_src,size);
-    OFFSET_CHECK(p_src,offset,size);
-
-    // Verify word alignment.
-    if ((!is_word_aligned(p_dest)) || (!is_word_aligned((void *)(uint32_t)offset)))
-    {
-        return NRF_ERROR_INVALID_ADDR;
-    }
-
-    memcpy(p_dest, (((uint8_t *)p_src->block_id) + offset), size);
-
-    app_notify(p_src, p_dest, PSTORAGE_LOAD_OP_CODE, size, NRF_SUCCESS);
-
-    return NRF_SUCCESS;
-}
-
-
-uint32_t pstorage_clear(pstorage_handle_t * p_dest, pstorage_size_t size)
-{
-    uint32_t page_addr;
-    uint32_t retval;
-    uint16_t page_count;
-
-    VERIFY_MODULE_INITIALIZED();
-    NULL_PARAM_CHECK(p_dest);
-    MODULE_ID_RANGE_CHECK(p_dest);
-
-    page_addr = p_dest->block_id / BLE_FLASH_PAGE_SIZE;
-
-    retval = NRF_SUCCESS;
-
-    for (page_count = 0; page_count < m_app_table[p_dest->module_id].no_of_pages; page_count++)
-    {
-        retval = ble_flash_page_erase(page_addr);
-        page_addr++;
-        if (retval != NRF_SUCCESS)
-        {
-            break;
-        }
-    }
-    app_notify(p_dest, NULL, PSTORAGE_CLEAR_OP_CODE, size, retval);
-    return retval;
-}
-
-void pstorage_sys_event_handler(uint32_t sys_evt)
-{
-
-}
-
-uint32_t pstorage_access_status_get(uint32_t * p_count)
-{
-    if (p_count)
-    {
-        *p_count = 0;
-    }
-    return NRF_SUCCESS;
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/a1481cb2/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/drivers_nrf/pstorage/pstorage_raw.c
----------------------------------------------------------------------
diff --git a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/drivers_nrf/pstorage/pstorage_raw.c b/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/drivers_nrf/pstorage/pstorage_raw.c
deleted file mode 100644
index ac12f7c..0000000
--- a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/drivers_nrf/pstorage/pstorage_raw.c
+++ /dev/null
@@ -1,471 +0,0 @@
-/* Copyright (c) 2015 Nordic Semiconductor. All Rights Reserved.
- *
- * The information contained herein is property of Nordic Semiconductor ASA.
- * Terms and conditions of usage are described in detail in NORDIC
- * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
- *
- * Licensees are granted free, non-transferable use of the information. NO
- * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
- * the file.
- *
- */
-
-#include "pstorage.h"
-#include <stdlib.h>
-#include <stdint.h>
-#include "nordic_common.h"
-#include "nrf_error.h"
-#include "nrf_assert.h"
-#include "nrf.h"
-#include "nrf_soc.h"
-#include "app_util.h"
-
-/** @file
- *
- * @defgroup persistent_storage_raw Persistent Storage Interface - Raw Mode Implementation
- * @{
- * @ingroup persistent_storage
- * @brief Persistent Storage Interface - Raw Mode Implementation.
- *
- * @details This file contains the source code for raw mode implementation of pstorage.
- * It is intended for special use cases where flash size is critical or the application must have
- * full control of the flash, such as DFU. The registration function in this implementation only
- * allocates a module id for the queue but does not locate any flash pages for the registrant.
- * This implementation provides no safety checking of addresses when clearing or storing data into
- * flash. The application is responsible for handling flash addresses and care must therefore be 
- * taken in application not to erase application area.
- * This implementation does not support the @ref pstorage_update function.
- */
-
-#define INVALID_OPCODE              0x00    /**< Invalid op code identifier. */
-
-#ifdef NRF51
-#define SOC_MAX_WRITE_SIZE          1024    /**< Maximum write size allowed for a single call to \ref sd_flash_write as specified in the SoC API on the nRF51. */
-#elif NRF52
-#define SOC_MAX_WRITE_SIZE          4096    /**< Maximum write size allowed for a single call to \ref sd_flash_write as specified in the SoC API on the nRF52. */
-#else
-#error No target defined
-#endif
-
-
-/**
- * @brief Application registration information.
- *
- * @details Define application specific information that application needs to maintain to be able
- *          to process requests from each one of them.
- */
-typedef struct
-{
-    pstorage_ntf_cb_t cb;   /**< Callback registered with the module to be notified of result of flash access.  */
-} pstorage_module_table_t;
-
-
-/**
- * @brief Defines command queue element.
- *
- * @details Defines command queue element. Each element encapsulates needed information to process
- *          a flash access command.
- */
-typedef struct
-{
-    uint8_t              op_code;       /**< Identifies flash access operation being queued. Element is free is op-code is INVALID_OPCODE */
-    pstorage_size_t      size;          /**< Identifies size in bytes requested for the operation. */
-    pstorage_size_t      offset;        /**< Offset requested by the application for access operation. */    
-    pstorage_handle_t    storage_addr;  /**< Address/Identifier for persistent memory. */
-    uint8_t            * p_data_addr;   /**< Address/Identifier for data memory. This is assumed to be resident memory. */    
-} cmd_queue_element_t;
-
-
-/**
- * @brief Defines command queue, an element is free is op_code field is not invalid.
- *
- * @details Defines commands enqueued for flash access. At any point of time, this queue has one or
- *          more flash access operation pending if the count field is not zero. When the queue is
- *          not empty, the rp (read pointer) field points to the flash access command in progress
- *          or to requested next. The queue implements a simple first in first out algorithm.
- *          Data addresses are assumed to be resident.
- */
-typedef struct
-{
-    uint8_t              rp;                              /**< Read pointer, pointing to flash access that is ongoing or to be requested next. */
-    uint8_t              count;                           /**< Number of elements in the queue.  */
-    bool                 flash_access;                    /**< Flag to ensure an flash event received is for an request issued by the module. */
-    cmd_queue_element_t  cmd[PSTORAGE_CMD_QUEUE_SIZE];    /**< Array to maintain flash access operation details */
-}cmd_queue_t;
-
-static cmd_queue_t             m_cmd_queue;                             /**< Flash operation request queue. */
-static pstorage_module_table_t m_app_table[PSTORAGE_NUM_OF_PAGES];      /**< Registered application information table. */
-static pstorage_size_t         m_next_app_instance;                     /**< Points to the application module instance that can be allocated next */
-static pstorage_size_t         m_round_val;                             /**< Round value for multiple round operations. For erase operations, the round value will contain current round counter which is identical to number of pages erased. For store operations, the round value contains current round of operation * SOC_MAX_WRITE_SIZE to ensure each store to the SoC Flash API is within the SoC limit. */
-
-/**
- * @brief Function for processing of commands and issuing flash access request to the SoftDevice.
- *
- * @return The return value received from SoftDevice.
- */
-static uint32_t cmd_process(void);
-
-
-/**
- * @brief Function for notifying application of any errors.
- *
- * @param[in] result Result of event being notified.
- * @param[in] p_elem Pointer to the element for which a notification should be given.
- */
-static void app_notify(uint32_t result, cmd_queue_element_t * p_elem);
-
-
-/**
- * @defgroup utility_functions Utility internal functions.
- * @{
- * @details Utility functions needed for interfacing with flash through SoC APIs.
- * SoC APIs are non blocking and provide the result of flash access through an event.
- *
- * @note Only one flash access operation is permitted at a time by SoC. Hence a queue is
- * maintained by this module.
- */
- 
-/**
- * @brief Function for initializing a command queue element.
- *
- * @param[in] index Index identifying element to be initialized.
- */
-static void cmd_queue_element_init(uint32_t index)
-{
-    // Internal function and checks on range of index can be avoided
-    m_cmd_queue.cmd[index].op_code                = INVALID_OPCODE;
-    m_cmd_queue.cmd[index].size                   = 0;
-    m_cmd_queue.cmd[index].storage_addr.module_id = PSTORAGE_NUM_OF_PAGES;
-    m_cmd_queue.cmd[index].storage_addr.block_id  = 0;
-    m_cmd_queue.cmd[index].p_data_addr            = NULL;
-    m_cmd_queue.cmd[index].offset                 = 0;
-}
-
-
-/**
- * @brief Function for initializing the command queue.
- */
-static void cmd_queue_init(void)
-{
-    uint32_t cmd_index;
-
-    m_round_val              = 0;
-    m_cmd_queue.rp           = 0;
-    m_cmd_queue.count        = 0;
-    m_cmd_queue.flash_access = false;
-
-    for(cmd_index = 0; cmd_index < PSTORAGE_CMD_QUEUE_SIZE; cmd_index++)
-    {
-        cmd_queue_element_init(cmd_index);
-    }
-}
-
-
-/**
- * @brief Function for enqueueing a flash access operation.
- *
- * @param[in] opcode         Operation code for the command to queue.
- * @param[in] p_storage_addr Pointer to the destination address.
- * @param[in] p_data_addr    Pointer to the source address containing the data.
- * @param[in] size           Size of data clear or write.
- * @param[in] offset         Offset to the address identified by the source data address.
- *
- * @retval NRF_SUCCESS      If the enqueueing succeeded.
- * @retval NRF_ERROR_NO_MEM In case the queue is full.
- * @return Any error returned by the SoftDevice flash API.
- */
-static uint32_t cmd_queue_enqueue(uint8_t             opcode,
-                                  pstorage_handle_t * p_storage_addr,
-                                  uint8_t           * p_data_addr,
-                                  pstorage_size_t     size,
-                                  pstorage_size_t     offset)
-{
-    uint32_t retval;
-
-    if (m_cmd_queue.count != PSTORAGE_CMD_QUEUE_SIZE)
-    {
-        uint8_t write_index = m_cmd_queue.rp + m_cmd_queue.count;
-
-        if (write_index >= PSTORAGE_CMD_QUEUE_SIZE)
-        {
-            write_index -= PSTORAGE_CMD_QUEUE_SIZE;
-        }
-
-        m_cmd_queue.cmd[write_index].op_code      = opcode;
-        m_cmd_queue.cmd[write_index].p_data_addr  = p_data_addr;
-        m_cmd_queue.cmd[write_index].storage_addr = (*p_storage_addr);
-        m_cmd_queue.cmd[write_index].size         = size;
-        m_cmd_queue.cmd[write_index].offset       = offset;
-        retval                                    = NRF_SUCCESS;
-        if (m_cmd_queue.flash_access == false)
-        {
-            retval = cmd_process();
-            if (retval == NRF_ERROR_BUSY)
-            {
-                // In case of busy error code, it is possible to attempt to access flash.
-                retval = NRF_SUCCESS;
-            }
-        }
-        m_cmd_queue.count++;
-    }
-    else
-    {
-        retval = NRF_ERROR_NO_MEM;
-    }
-
-    return retval;
-}
-
-
-/**
- * @brief Function for dequeueing a command element.
- *
- * @retval NRF_SUCCESS If the dequeueing succeeded and next command was processed.
- * @return Any error returned by the SoftDevice flash API.
- */
-static uint32_t cmd_queue_dequeue(void)
-{
-    uint32_t retval = NRF_SUCCESS;
-
-    // If any flash operation is enqueued, schedule
-    if ((m_cmd_queue.count > 0) && (m_cmd_queue.flash_access == false))
-    {
-        retval = cmd_process();
-        if (retval != NRF_SUCCESS)
-        {
-            // Flash could be accessed by other modules, hence a busy error is
-            // acceptable, but any other error needs to be indicated.
-            if (retval == NRF_ERROR_BUSY)
-            {
-                // In case of busy error code, it is possible to attempt to access flash.
-                retval = NRF_SUCCESS;
-            }
-        }
-    }
-    else
-    {
-        // No flash access request pending.
-    }
-
-    return retval;
-}
-
-
-/**
- * @brief Function for notifying application of any errors.
- *
- * @param[in] result Result of event being notified.
- * @param[in] p_elem Pointer to the element for which a notification should be given.
- */
-static void app_notify(uint32_t result, cmd_queue_element_t * p_elem)
-{
-    pstorage_ntf_cb_t ntf_cb;
-    uint8_t           op_code = p_elem->op_code;
-    
-    ntf_cb = m_app_table[p_elem->storage_addr.module_id].cb;
-
-    // Indicate result to client.
-    ntf_cb(&p_elem->storage_addr,
-           op_code,
-           result,
-           p_elem->p_data_addr,
-           p_elem->size);
-}
-
-
-/**
- * @brief Function for handling of system events from SoftDevice.
- *
- * @param[in] sys_evt System event received.
- */
-void pstorage_sys_event_handler(uint32_t sys_evt)
-{
-    uint32_t retval = NRF_SUCCESS;
-
-    // The event shall only be processed if requested by this module.
-    if (m_cmd_queue.flash_access == true)
-    {
-        cmd_queue_element_t * p_cmd;
-        m_cmd_queue.flash_access = false;
-        switch (sys_evt)
-        {
-            case NRF_EVT_FLASH_OPERATION_SUCCESS:
-            {
-                p_cmd = &m_cmd_queue.cmd[m_cmd_queue.rp];
-                m_round_val++;
-            
-                bool command_finished = ((m_round_val * SOC_MAX_WRITE_SIZE) >= p_cmd->size);
-
-                if (command_finished)
-                {
-                    uint8_t queue_rp = m_cmd_queue.rp;
-                    
-                    m_round_val = 0;
-                    m_cmd_queue.count--;
-                    m_cmd_queue.rp++;
-
-                    if (m_cmd_queue.rp >= PSTORAGE_CMD_QUEUE_SIZE)
-                    {
-                        m_cmd_queue.rp -= PSTORAGE_CMD_QUEUE_SIZE;
-                    }
-
-                    app_notify(retval, &m_cmd_queue.cmd[queue_rp]);
-
-                    // Initialize/free the element as it is now processed.
-                    cmd_queue_element_init(queue_rp);
-                }
-                // Schedule any queued flash access operations.
-                retval = cmd_queue_dequeue();
-                if (retval != NRF_SUCCESS)
-                {
-                    app_notify(retval, &m_cmd_queue.cmd[m_cmd_queue.rp]);
-                }
-            }
-            break;
-                
-            case NRF_EVT_FLASH_OPERATION_ERROR:
-                app_notify(NRF_ERROR_TIMEOUT, &m_cmd_queue.cmd[m_cmd_queue.rp]);
-                break;
-            
-            default:
-                // No implementation needed.
-                break;
-        }
-    }
-}
-
-
-/**
- * @brief Function for processing of commands and issuing flash access request to the SoftDevice.
- *
- * @return The return value received from SoftDevice.
- */
-static uint32_t cmd_process(void)
-{
-    uint32_t              retval;
-    uint32_t              storage_addr;
-    cmd_queue_element_t * p_cmd;
-
-    retval = NRF_ERROR_FORBIDDEN;
-
-    p_cmd = &m_cmd_queue.cmd[m_cmd_queue.rp];
-
-    storage_addr = p_cmd->storage_addr.block_id;
-
-    switch (p_cmd->op_code)
-    {
-        case PSTORAGE_STORE_OP_CODE:
-        {
-            uint32_t  size;
-            uint32_t  offset;
-            uint8_t * p_data_addr = p_cmd->p_data_addr;
-
-            offset        = (m_round_val * SOC_MAX_WRITE_SIZE);
-            size          = p_cmd->size - offset;
-            p_data_addr  += offset;
-            storage_addr += (p_cmd->offset + offset);
-
-            if (size < SOC_MAX_WRITE_SIZE)
-            {
-                retval = sd_flash_write(((uint32_t *)storage_addr),
-                                        (uint32_t *)p_data_addr,
-                                        size / sizeof(uint32_t));
-            }
-            else
-            {
-                retval = sd_flash_write(((uint32_t *)storage_addr),
-                                        (uint32_t *)p_data_addr,
-                                        SOC_MAX_WRITE_SIZE / sizeof(uint32_t));
-            }
-        }
-        break;
-        
-        case PSTORAGE_CLEAR_OP_CODE:
-        {
-            uint32_t page_number;
-
-            page_number =  ((storage_addr / PSTORAGE_FLASH_PAGE_SIZE) +
-                            m_round_val);
-
-            retval = sd_flash_page_erase(page_number);
-        }
-        break;
-    
-        default:
-            // Should never reach here.
-            break;
-    }
-    
-    if (retval == NRF_SUCCESS)
-    {
-       m_cmd_queue.flash_access = true;
-    }
-
-    return retval;
-}
-/** @} */
-
-
-uint32_t pstorage_init(void)
-{
-    cmd_queue_init();
-    
-    m_next_app_instance = 0;
-    m_round_val         = 0;
-
-    for(unsigned int index = 0; index < PSTORAGE_NUM_OF_PAGES; index++)
-    {
-        m_app_table[index].cb          = NULL;
-    }
-
-    return NRF_SUCCESS;
-}
-
-
-uint32_t pstorage_register(pstorage_module_param_t * p_module_param,
-                           pstorage_handle_t       * p_block_id)
-{
-    if (m_next_app_instance == PSTORAGE_NUM_OF_PAGES)
-    {
-        return NRF_ERROR_NO_MEM;
-    }
-
-    p_block_id->module_id                 = m_next_app_instance;
-    m_app_table[m_next_app_instance++].cb = p_module_param->cb;
-
-    return NRF_SUCCESS;
-}
-
-
-uint32_t pstorage_block_identifier_get(pstorage_handle_t * p_base_id,
-                                       pstorage_size_t     block_num,
-                                       pstorage_handle_t * p_block_id)
-{
-    return NRF_ERROR_NOT_SUPPORTED;
-}
-
-
-uint32_t pstorage_store(pstorage_handle_t * p_dest,
-                        uint8_t           * p_src,
-                        pstorage_size_t     size,
-                        pstorage_size_t     offset)
-{
-    // Verify word alignment.
-    if ((!is_word_aligned(p_src)) || (!is_word_aligned(p_src+offset)))
-    {
-        return NRF_ERROR_INVALID_ADDR;
-    }
-
-    return cmd_queue_enqueue(PSTORAGE_STORE_OP_CODE, p_dest, p_src, size, offset);
-}
-
-
-uint32_t pstorage_clear(pstorage_handle_t * p_dest, pstorage_size_t size)
-{
-    return cmd_queue_enqueue(PSTORAGE_CLEAR_OP_CODE, p_dest, NULL , size, 0);
-}
-
-
-/**
- * @}
- */

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/a1481cb2/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/drivers_nrf/pwm/nrf_drv_pwm.c
----------------------------------------------------------------------
diff --git a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/drivers_nrf/pwm/nrf_drv_pwm.c b/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/drivers_nrf/pwm/nrf_drv_pwm.c
deleted file mode 100644
index bfca607..0000000
--- a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/drivers_nrf/pwm/nrf_drv_pwm.c
+++ /dev/null
@@ -1,350 +0,0 @@
-/* Copyright (c) 2015 Nordic Semiconductor. All Rights Reserved.
- *
- * The information contained herein is property of Nordic Semiconductor ASA.
- * Terms and conditions of usage are described in detail in NORDIC
- * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
- *
- * Licensees are granted free, non-transferable use of the information. NO
- * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
- * the file.
- *
- */
-
-#include <string.h>
-#include "nrf_drv_pwm.h"
-#include "nrf_drv_common.h"
-#include "nrf_gpio.h"
-#include "app_util_platform.h"
-
-#if (PWM_COUNT == 0)
-    #error "No PWM instances enabled in the driver configuration file."
-#endif
-
-
-// Control block - driver instance local data.
-typedef struct
-{
-    nrf_drv_pwm_handler_t    handler;
-    nrf_drv_state_t volatile state;
-} pwm_control_block_t;
-static pwm_control_block_t m_cb[PWM_COUNT];
-
-static nrf_drv_pwm_config_t const m_default_config[PWM_COUNT] = {
-#if PWM0_ENABLED
-    NRF_DRV_PWM_DEFAULT_CONFIG(0),
-#endif
-#if PWM1_ENABLED
-    NRF_DRV_PWM_DEFAULT_CONFIG(1),
-#endif
-#if PWM2_ENABLED
-    NRF_DRV_PWM_DEFAULT_CONFIG(2),
-#endif
-};
-
-
-static void configure_pins(nrf_drv_pwm_t const * const p_instance,
-                           nrf_drv_pwm_config_t const * p_config)
-{
-    uint32_t out_pins[NRF_PWM_CHANNEL_COUNT];
-    uint8_t i;
-
-    for (i = 0; i < NRF_PWM_CHANNEL_COUNT; ++i)
-    {
-        uint8_t output_pin = p_config->output_pins[i];
-        if (output_pin != NRF_DRV_PWM_PIN_NOT_USED)
-        {
-            bool inverted = output_pin &  NRF_DRV_PWM_PIN_INVERTED;
-            out_pins[i]   = output_pin & ~NRF_DRV_PWM_PIN_INVERTED;
-
-            if (inverted)
-            {
-                nrf_gpio_pin_set(out_pins[i]);
-            }
-            else
-            {
-                nrf_gpio_pin_clear(out_pins[i]);
-            }
-
-            nrf_gpio_cfg_output(out_pins[i]);
-        }
-        else
-        {
-            out_pins[i] = NRF_PWM_PIN_NOT_CONNECTED;
-        }
-    }
-
-    nrf_pwm_pins_set(p_instance->p_registers, out_pins);
-}
-
-
-ret_code_t nrf_drv_pwm_init(nrf_drv_pwm_t const * const p_instance,
-                            nrf_drv_pwm_config_t const * p_config,
-                            nrf_drv_pwm_handler_t        handler)
-{
-    pwm_control_block_t * p_cb  = &m_cb[p_instance->drv_inst_idx];
-
-    if (p_cb->state != NRF_DRV_STATE_UNINITIALIZED)
-    {
-        return NRF_ERROR_INVALID_STATE;
-    }
-
-    if (p_config == NULL)
-    {
-        p_config = &m_default_config[p_instance->drv_inst_idx];
-    }
-
-    p_cb->handler = handler;
-
-    configure_pins(p_instance, p_config);
-
-    nrf_pwm_enable(p_instance->p_registers);
-    nrf_pwm_configure(p_instance->p_registers,
-        p_config->base_clock, p_config->count_mode, p_config->top_value);
-    nrf_pwm_decoder_set(p_instance->p_registers,
-        p_config->load_mode, p_config->step_mode);
-
-    nrf_pwm_shorts_set(p_instance->p_registers, 0);
-    nrf_pwm_int_set(p_instance->p_registers, 0);
-    nrf_pwm_event_clear(p_instance->p_registers, NRF_PWM_EVENT_LOOPSDONE);
-    nrf_pwm_event_clear(p_instance->p_registers, NRF_PWM_EVENT_SEQEND0);
-    nrf_pwm_event_clear(p_instance->p_registers, NRF_PWM_EVENT_SEQEND1);
-    nrf_pwm_event_clear(p_instance->p_registers, NRF_PWM_EVENT_STOPPED);
-
-    if (p_cb->handler)
-    {
-        nrf_drv_common_irq_enable(nrf_drv_get_IRQn(p_instance->p_registers),
-            p_config->irq_priority);
-    }
-
-    p_cb->state = NRF_DRV_STATE_INITIALIZED;
-
-    return NRF_SUCCESS;
-}
-
-
-void nrf_drv_pwm_uninit(nrf_drv_pwm_t const * const p_instance)
-{
-    pwm_control_block_t * p_cb  = &m_cb[p_instance->drv_inst_idx];
-    ASSERT(p_cb->state != NRF_DRV_STATE_UNINITIALIZED);
-
-    nrf_drv_common_irq_disable(nrf_drv_get_IRQn(p_instance->p_registers));
-
-    nrf_pwm_disable(p_instance->p_registers);
-
-    p_cb->state = NRF_DRV_STATE_UNINITIALIZED;
-}
-
-
-static void start_playback(nrf_drv_pwm_t const * const p_instance,
-                           pwm_control_block_t * p_cb,
-                           uint8_t               flags,
-                           nrf_pwm_task_t        starting_task)
-{
-    p_cb->state = NRF_DRV_STATE_POWERED_ON;
-
-    if (p_cb->handler)
-    {
-        // The notification about finished playback is by default enabled, but
-        // this can be suppressed. The notification that the peripheral has been
-        // stopped is always enable.
-        uint32_t int_mask = NRF_PWM_INT_LOOPSDONE_MASK |
-                            NRF_PWM_INT_STOPPED_MASK;
-
-        if (flags & NRF_DRV_PWM_FLAG_SIGNAL_END_SEQ0)
-        {
-            int_mask |= NRF_PWM_INT_SEQEND0_MASK;
-        }
-        if (flags & NRF_DRV_PWM_FLAG_SIGNAL_END_SEQ1)
-        {
-            int_mask |= NRF_PWM_INT_SEQEND1_MASK;
-        }
-        if (flags & NRF_DRV_PWM_FLAG_NO_EVT_FINISHED)
-        {
-            int_mask &= ~NRF_PWM_INT_LOOPSDONE_MASK;
-        }
-
-        nrf_pwm_int_set(p_instance->p_registers, int_mask);
-    }
-
-    nrf_pwm_event_clear(p_instance->p_registers, NRF_PWM_EVENT_STOPPED);
-
-    nrf_pwm_task_trigger(p_instance->p_registers, starting_task);
-}
-
-
-void nrf_drv_pwm_simple_playback(nrf_drv_pwm_t const * const p_instance,
-                                 nrf_pwm_sequence_t const * p_sequence,
-                                 uint16_t                   playback_count,
-                                 uint32_t                   flags)
-{
-    pwm_control_block_t * p_cb  = &m_cb[p_instance->drv_inst_idx];
-    ASSERT(p_cb->state != NRF_DRV_STATE_UNINITIALIZED);
-    ASSERT(playback_count > 0);
-    ASSERT(nrf_drv_is_in_RAM(p_sequence->values.p_raw));
-
-    // To take advantage of the looping mechanism, we need to use both sequences
-    // (single sequence can be played back only once).
-    nrf_pwm_sequence_set(p_instance->p_registers, 0, p_sequence);
-    nrf_pwm_sequence_set(p_instance->p_registers, 1, p_sequence);
-    bool odd = (playback_count & 1);
-    nrf_pwm_loop_set(p_instance->p_registers, playback_count/2 + (odd ? 1 : 0));
-
-    uint32_t shorts_mask;
-    if (flags & NRF_DRV_PWM_FLAG_STOP)
-    {
-        shorts_mask = NRF_PWM_SHORT_LOOPSDONE_STOP_MASK;
-    }
-    else if (flags & NRF_DRV_PWM_FLAG_LOOP)
-    {
-        shorts_mask = odd ? NRF_PWM_SHORT_LOOPSDONE_SEQSTART1_MASK
-                          : NRF_PWM_SHORT_LOOPSDONE_SEQSTART0_MASK;
-    }
-    else
-    {
-        shorts_mask = 0;
-    }
-    nrf_pwm_shorts_set(p_instance->p_registers, shorts_mask);
-
-    start_playback(p_instance, p_cb, flags, odd ? NRF_PWM_TASK_SEQSTART1
-                                                : NRF_PWM_TASK_SEQSTART0);
-}
-
-
-void nrf_drv_pwm_complex_playback(nrf_drv_pwm_t const * const p_instance,
-                                  nrf_pwm_sequence_t const * p_sequence_0,
-                                  nrf_pwm_sequence_t const * p_sequence_1,
-                                  uint16_t                   playback_count,
-                                  uint32_t                   flags)
-{
-    pwm_control_block_t * p_cb  = &m_cb[p_instance->drv_inst_idx];
-    ASSERT(p_cb->state != NRF_DRV_STATE_UNINITIALIZED);
-    ASSERT(playback_count > 0);
-    ASSERT(nrf_drv_is_in_RAM(p_sequence_0->values.p_raw));
-    ASSERT(nrf_drv_is_in_RAM(p_sequence_1->values.p_raw));
-
-    nrf_pwm_sequence_set(p_instance->p_registers, 0, p_sequence_0);
-    nrf_pwm_sequence_set(p_instance->p_registers, 1, p_sequence_1);
-    nrf_pwm_loop_set(p_instance->p_registers, playback_count);
-
-    uint32_t shorts_mask;
-    if (flags & NRF_DRV_PWM_FLAG_STOP)
-    {
-        shorts_mask = NRF_PWM_SHORT_LOOPSDONE_STOP_MASK;
-    }
-    else if (flags & NRF_DRV_PWM_FLAG_LOOP)
-    {
-        shorts_mask = NRF_PWM_SHORT_LOOPSDONE_SEQSTART0_MASK;
-    }
-    else
-    {
-        shorts_mask = 0;
-    }
-    nrf_pwm_shorts_set(p_instance->p_registers, shorts_mask);
-
-    start_playback(p_instance, p_cb, flags, NRF_PWM_TASK_SEQSTART0);
-}
-
-
-bool nrf_drv_pwm_stop(nrf_drv_pwm_t const * const p_instance,
-                      bool wait_until_stopped)
-{
-    ASSERT(m_cb[p_instance->drv_inst_idx].state != NRF_DRV_STATE_UNINITIALIZED);
-
-    if (nrf_drv_pwm_is_stopped(p_instance))
-    {
-        return true;
-    }
-
-    nrf_pwm_task_trigger(p_instance->p_registers, NRF_PWM_TASK_STOP);
-
-    do {
-        if (nrf_drv_pwm_is_stopped(p_instance))
-        {
-            return true;
-        }
-    } while (wait_until_stopped);
-
-    return false;
-}
-
-
-bool nrf_drv_pwm_is_stopped(nrf_drv_pwm_t const * const p_instance)
-{
-    pwm_control_block_t * p_cb  = &m_cb[p_instance->drv_inst_idx];
-    ASSERT(p_cb->state != NRF_DRV_STATE_UNINITIALIZED);
-
-    // If the event handler is used (interrupts are enabled), the state will
-    // be changed in interrupt handler when the STOPPED event occurs.
-    if (p_cb->state != NRF_DRV_STATE_POWERED_ON)
-    {
-        return true;
-    }
-    // If interrupts are disabled, we must check the STOPPED event here.
-    if (nrf_pwm_event_check(p_instance->p_registers, NRF_PWM_EVENT_STOPPED))
-    {
-        p_cb->state = NRF_DRV_STATE_INITIALIZED;
-        return true;
-    }
-
-    return false;
-}
-
-
-static void irq_handler(NRF_PWM_Type * p_pwm, pwm_control_block_t * p_cb)
-{
-    ASSERT(p_cb->handler);
-
-    // The SEQEND0 and SEQEND1 events are only handled when the user asked for
-    // it (by setting proper flags when starting the playback).
-    if (nrf_pwm_int_enable_check(p_pwm, NRF_PWM_INT_SEQEND0_MASK) &&
-        nrf_pwm_event_check(p_pwm, NRF_PWM_EVENT_SEQEND0))
-    {
-        nrf_pwm_event_clear(p_pwm, NRF_PWM_EVENT_SEQEND0);
-        p_cb->handler(NRF_DRV_PWM_EVT_END_SEQ0);
-    }
-    if (nrf_pwm_int_enable_check(p_pwm, NRF_PWM_INT_SEQEND1_MASK) &&
-        nrf_pwm_event_check(p_pwm, NRF_PWM_EVENT_SEQEND1))
-    {
-        nrf_pwm_event_clear(p_pwm, NRF_PWM_EVENT_SEQEND1);
-        p_cb->handler(NRF_DRV_PWM_EVT_END_SEQ1);
-    }
-
-    // The LOOPSDONE event is handled by default, but this can be disabled.
-    if (nrf_pwm_int_enable_check(p_pwm, NRF_PWM_INT_LOOPSDONE_MASK) &&
-        nrf_pwm_event_check(p_pwm, NRF_PWM_EVENT_LOOPSDONE))
-    {
-        nrf_pwm_event_clear(p_pwm, NRF_PWM_EVENT_LOOPSDONE);
-        p_cb->handler(NRF_DRV_PWM_EVT_FINISHED);
-    }
-
-    if (nrf_pwm_event_check(p_pwm, NRF_PWM_EVENT_STOPPED))
-    {
-        nrf_pwm_event_clear(p_pwm, NRF_PWM_EVENT_STOPPED);
-
-        p_cb->state = NRF_DRV_STATE_INITIALIZED;
-
-        p_cb->handler(NRF_DRV_PWM_EVT_STOPPED);
-    }
-}
-
-
-#if PWM0_ENABLED
-void PWM0_IRQHandler(void)
-{
-    irq_handler(NRF_PWM0, &m_cb[PWM0_INSTANCE_INDEX]);
-}
-#endif
-
-#if PWM1_ENABLED
-void PWM1_IRQHandler(void)
-{
-    irq_handler(NRF_PWM1, &m_cb[PWM1_INSTANCE_INDEX]);
-}
-#endif
-
-#if PWM2_ENABLED
-void PWM2_IRQHandler(void)
-{
-    irq_handler(NRF_PWM2, &m_cb[PWM2_INSTANCE_INDEX]);
-}
-#endif