Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

ant_hrm_evt_handler ?

Rank

Total Posts: 14

Joined 2020-07-14

PM

Dear Members,

I read this code :
static void ant_hrm_evt_handler(ant_hrm_profile_t p_profileant_hrm_evt_t event)
{
    nrf_pwr_mgmt_feed
();

    switch (
event)
    
{
        
case ANT_HRM_PAGE_0_UPDATED:
            
/* fall through */
        
case ANT_HRM_PAGE_1_UPDATED:
            
/* fall through */
        
case ANT_HRM_PAGE_2_UPDATED:
            
/* fall through */
        
case ANT_HRM_PAGE_3_UPDATED:
            
/* fall through */
        
case ANT_HRM_PAGE_4_UPDATED:
            
NRF_LOG_INFO("Page was updated");
            break;

        default:
            break;
    
}


I saw :
NRF_LOG_INFO("Heart beat count:                 %u", (unsigned int)p_page_data->beat_count);
    
NRF_LOG_INFO("Computed heart rate:              %u",
                 (
unsigned intp_page_data->computed_heart_rate);
    
NRF_LOG_INFO("Heart beat event time:            %u.us\r\n\n",
                 (
unsigned intANT_HRM_BEAT_TIME_SEC(p_page_data->beat_time),
                 (
unsigned intANT_HRM_BEAT_TIME_MSEC(p_page_data->beat_time)); 


How can I display result = 0 if there is no input from sensor ?
I can not display 0, CPU is shutdown if there's no input,

Any clues ?
Thanks