Exemple #1
0
/**
 * @brief Routine to notify application of any errors.
 */
static void app_notify (uint32_t result)
{
    pstorage_ntf_cb_t  ntf_cb;
    uint8_t            op_code = m_cmd_queue.cmd[m_cmd_queue.rp].op_code;
#ifdef PSTORAGE_RAW_MODE_ENABLE
    if(m_cmd_queue.cmd[m_cmd_queue.rp].storage_addr.module_id == (PSTORAGE_MAX_APPLICATIONS + 1))
    {
        ntf_cb = m_raw_app_table.cb;
    }
    else
#endif // PSTORAGE_RAW_MODE_ENABLE
    {
        ntf_cb = m_app_table[m_cmd_queue.cmd[m_cmd_queue.rp].storage_addr.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(&m_cmd_queue.cmd[m_cmd_queue.rp].storage_addr,
           op_code,
           result,
           m_cmd_queue.cmd[m_cmd_queue.rp].p_data_addr,
           op_code == PSTORAGE_CLEAR_OP_CODE ? 0 : m_cmd_queue.cmd[m_cmd_queue.rp].size);
}
Exemple #2
0
/**
 * @brief Routine to notify application of any errors.
 *
 * @param[in] result Result of event being notified.
 * @param[in] p_elem Pointer to the element for which this result was received. 
 */
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;

#ifdef PSTORAGE_RAW_MODE_ENABLE
    if (p_elem->storage_addr.module_id == RAW_MODE_APP_ID)
    {
        ntf_cb = m_raw_app_table.cb;
    }
    else
#endif // PSTORAGE_RAW_MODE_ENABLE
    {
        ntf_cb = m_app_table[p_elem->storage_addr.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_elem->storage_addr,
           op_code,
           result,
           p_elem->p_data_addr,
           p_elem->size);
}
Exemple #3
0
/**
 * @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);
}
Exemple #4
0
/**
 * @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);
}