手环APP源码


手环APP很详细的资料
资源截图
代码片段和文件信息
/* Copyright (c) 2012 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 “app_button.h“
#include 
#include “nordic_common.h“
#include “app_util.h“
#include “app_gpiote.h“
#include “app_timer.h“
#include “app_error.h“


static app_button_cfg_t *             mp_buttons = NULL;           /**< Button configuration. */
static uint8_t                        m_button_count;              /**< Number of configured buttons. */
static uint32_t                       m_active_low_states_mask;    /**< Mask representing buttons which are active low. */
static uint32_t                       m_active_high_states_mask;   /**< Mask representing buttons which are active high. */
static uint32_t                       m_detection_delay;           /**< Delay before a button is reported as pushed. */
static app_button_evt_schedule_func_t m_evt_schedule_func;         /**< Pointer to function for propagating button events to the scheduler. */
static app_gpiote_user_id_t           m_gpiote_user_id;            /**< GPIOTE user id for buttons module. */
static app_timer_id_t                 m_detection_delay_timer_id;  /**< Polling timer id. */


/**@brief Function for executing the application button handler for specified button.
 *
 * @param[in]  p_btn   Button that has been pushed.
 */
static void button_handler_execute(app_button_cfg_t * p_btn)
{
    if (m_evt_schedule_func != NULL)
    {
        uint32_t err_code = m_evt_schedule_func(p_btn->button_handler p_btn->pin_no);
        APP_ERROR_CHECK(err_code);
    }
    else
    {
        p_btn->button_handler(p_btn->pin_no);
    }
}


/**@brief Function for handling the timeout that delays reporting buttons as pushed.
 *
 * @details    The detection_delay_timeout_handler(...) is a call-back issued from the app_timer
 *             module. It is called with the p_context parameter. The p_context parameter is
 *             provided to the app_timer module when a timer is started using the call
 *             @ref app_timer_start. On @ref app_timer_start the p_context will be holding the
 *             currently pressed buttons.
 *
 * @param[in]  p_context   Pointer used for passing information app_start_timer() was called.
 *                         In the app_button module the p_context holds information on pressed
 *                         buttons.
 */
static void detection_delay_timeout_handler(void * p_context)
{
    uint32_t err_code;
    uint32_t event_pins_mask;
    uint32_t current_state_pins;
    uint32_t active_pins         = 0;

    // Get state of pins when timer was started.
    event_pins_mask = (uint32_t)p_context;
    
    // 

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2014-09-16 03:53  duband-master
     文件     1063249  2014-09-16 03:53  duband-masterBaiduWristbandTester-v1.apk
     文件       11324  2014-09-16 03:53  duband-masterLICENSE
     文件         240  2014-09-16 03:53  duband-masterREADME.md
     文件     5463591  2014-09-16 03:53  duband-masterWearable.apk
     目录           0  2014-09-16 03:53  duband-masterootloader
     目录           0  2014-09-16 03:53  duband-masterootloaderSource
     目录           0  2014-09-16 03:53  duband-masterootloaderSourceinc
     文件        1865  2014-09-16 03:53  duband-masterootloaderSourceincootloader.h
     文件        1571  2014-09-16 03:53  duband-masterootloaderSourceincootloader_types.h
     文件        1123  2014-09-16 03:53  duband-masterootloaderSourceincootloader_util.h
     文件        2095  2014-09-16 03:53  duband-masterootloaderSourceincdfu.h
     文件         979  2014-09-16 03:53  duband-masterootloaderSourceincdfu_transport.h
     文件        6847  2014-09-16 03:53  duband-masterootloaderSourceincdfu_types.h
     目录           0  2014-09-16 03:53  duband-masterootloaderSourcesrc
     文件        7609  2014-09-16 03:53  duband-masterootloaderSourcesrcarm_startup_nrf51.s
     文件        6108  2014-09-16 03:53  duband-masterootloaderSourcesrcootloader.c
     文件        2961  2014-09-16 03:53  duband-masterootloaderSourcesrcootloader_util_arm.c
     文件       15813  2014-09-16 03:53  duband-masterootloaderSourcesrcdfu_dual_bank.c
     文件        9915  2014-09-16 03:53  duband-masterootloaderSourcesrcdfu_single_bank.c
     文件       33910  2014-09-16 03:53  duband-masterootloaderSourcesrcdfu_transport_ble.c
     文件        9484  2014-09-16 03:53  duband-masterootloaderSourcesrcdfu_transport_serial.c
     文件        2625  2014-09-16 03:53  duband-masterootloaderSourcesrchci_transport_config.h
     文件        7359  2014-09-16 03:53  duband-masterootloaderSourcesrcmain.c
     目录           0  2014-09-16 03:53  duband-masterootloader
rf51822
     目录           0  2014-09-16 03:53  duband-masterootloader
rf51822Include
     目录           0  2014-09-16 03:53  duband-masterootloader
rf51822Includeapp_common
     文件        8076  2014-09-16 03:53  duband-masterootloader
rf51822Includeapp_commonapp_button.h
     文件        2931  2014-09-16 03:53  duband-masterootloader
rf51822Includeapp_commonapp_error.h
     文件        3277  2014-09-16 03:53  duband-masterootloader
rf51822Includeapp_commonapp_fifo.h
     文件        7989  2014-09-16 03:53  duband-masterootloader
rf51822Includeapp_commonapp_gpiote.h
............此处省略561个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)