⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 heartbeat.c

📁 IT projecotr reference design.
💻 C
字号:
/****************************************************************************/
/*             TEXAS INSTRUMENTS PROPRIETARY INFORMATION                    */
/*                                                                          */
/*  (c) Copyright, Texas Instruments Incorporated, 2006.                    */
/*      All Rights Reserved.                                                */
/*                                                                          */
/*  Property of Texas Instruments Incorporated. Restricted Rights -         */
/*  Use, duplication, or disclosure is subject to restrictions set          */
/*  forth in TI's program license agreement and associated documentation.   */
/****************************************************************************/

/****************************************************************************/
/* heartbeat.c                                                              */
/*                                                                          */
/* System heartbeat indicator.                                              */
/****************************************************************************/

#include "common.h"
#include "gpio.h"

#include "iox.h"
#include "gpioFunction.h"
#include "heartbeat.h"

static uint16 counter;                      /* LSB defines indicator on/off */



/****************************************************************************/
/* Periodic polling callback function.                                      */
/****************************************************************************/

int16 heartbeat_poll( uint16 tick )
{
    iox_pinSet( HEARTBEAT_LED, (BOOL)( ++counter & 1 ));

    return HEARTBEAT_PERIOD / RTOS_MS_PER_TICK;
}



/****************************************************************************/
/* Module reset function.                                                   */
/****************************************************************************/

EXEC_CC_ENUM heartbeat_init( void )
{
    iox_cfgSet( IOX_PINCFG( HEARTBEAT_LED, IOX_OUT, IOX_FALSE ));
        
    return EXEC_CC_PASS;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -