当前位置: 首页>>代码示例>>C++>>正文


C++ dfu_bank_func_t::cleared方法代码示例

本文整理汇总了C++中dfu_bank_func_t::cleared方法的典型用法代码示例。如果您正苦于以下问题:C++ dfu_bank_func_t::cleared方法的具体用法?C++ dfu_bank_func_t::cleared怎么用?C++ dfu_bank_func_t::cleared使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在dfu_bank_func_t的用法示例。


在下文中一共展示了dfu_bank_func_t::cleared方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: pstorage_callback_handler

/**@brief Function for handling callbacks from pstorage module.
 *
 * @details Handles pstorage results for clear and storage operation. For detailed description of
 *          the parameters provided with the callback, please refer to \ref pstorage_ntf_cb_t.
 */
static void pstorage_callback_handler(pstorage_handle_t * p_handle,
                                      uint8_t             op_code,
                                      uint32_t            result,
                                      uint8_t           * p_data,
                                      uint32_t            data_len)
{
    switch (op_code)
    {
        case PSTORAGE_STORE_OP_CODE:
            if ((m_dfu_state == DFU_STATE_RX_DATA_PKT) && (m_data_pkt_cb != NULL))
            {
                m_data_pkt_cb(DATA_PACKET, result, p_data);
            }
            break;

        case PSTORAGE_CLEAR_OP_CODE:
            if (m_dfu_state == DFU_STATE_PREPARING)
            {
                m_functions.cleared();
                m_dfu_state = DFU_STATE_RDY;
                if (m_data_pkt_cb != NULL)
                {
                    m_data_pkt_cb(START_PACKET, result, p_data);
                }
            }
            break;

        default:
            break;
    }
    APP_ERROR_CHECK(result);
}
开发者ID:BLEHexapod,项目名称:nrf_sdk,代码行数:37,代码来源:dfu_single_bank.c

示例2: dfu_prepare_func_app_erase

/**@brief   Function for preparing of flash before receiving SoftDevice image.
 *
 * @details This function will erase current application area to ensure sufficient amount of
 *          storage for the SoftDevice image. Upon erase complete a callback will be done.
 *          See \ref dfu_bank_prepare_t for further details.
 */
static void dfu_prepare_func_app_erase(uint32_t image_size)
{

    if(m_start_packet.sd_image_size != 0)
    {
        mp_storage_handle_active = m_storage_handle_sd;    
    }
    else
    {
        mp_storage_handle_active = m_storage_handle_app;     
    }

    // Doing a SoftDevice update thus current application must be cleared to ensure enough space
    // for new SoftDevice.
    m_dfu_state = DFU_STATE_PREPARING;
    nrf_flash_erase(mp_storage_handle_active, m_image_size);
    
    m_functions.cleared();
    m_dfu_state = DFU_STATE_RDY;
}
开发者ID:NordicSemiconductor,项目名称:nrf51-dfu-spi-slave,代码行数:26,代码来源:dfu_single_bank.c


注:本文中的dfu_bank_func_t::cleared方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。