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

📄 testauto.bak

📁 这是一个基于nec78f8024的led驱动程序
💻 BAK
字号:
/*
*******************************************************************************
**  COPYRIGHT (C) NEC Electronics Corporation 2008
**  NEC ELECTRONICS CONFIDENTIAL AND PROPRIETARY
**  All rights reserved by NEC Electronics Corporation.
**  Use of copyright notice does not evidence publication.
**
**  Filename :	AUTO.c
**  Abstract :	This file implements the control function of time for 
**                                                         variable dimming.
**
**  Device :	uPD78F8024
**
**  Compiler :	NEC/CC78K0
**
*******************************************************************************
*/
#pragma interrupt	INTTM000	interval_interrupt
/*
*******************************************************************************
**  Include files
*******************************************************************************
*/
#include "macrodriver.h"
#include "AUTO.h"

/*
*******************************************************************************
**  Function Prototypes
*******************************************************************************
*/
__interrupt void  interval_interrupt( void );

/*
*******************************************************************************
**  External Variable Difinition
*******************************************************************************
*/
short g_shTimeRemain[4];					/* to store the remainder time until changing brightness */
short g_shListReadPoint[4];					/* to store element number that brightness setting list  */
unsigned char	g_ucCyclic;					/* to store presence of cyclic lighting setting  */
unsigned char	g_ucListEnable[4] = {TRUE, TRUE, TRUE, TRUE};		/* to store effective/invalidity of brightness setting list */
unsigned char 	g_ucChangeTrigger[4] = {FALSE, FALSE, FALSE, FALSE};	/* to presence of necessity for reading from brightness setting list */

/*
**-----------------------------------------------------------------------------
**
**  function name:
**  	interval_interrupt
**
**  Parameters:
**  	None
**
**  Returns:
**  	None
**
**-----------------------------------------------------------------------------
*/ 
__interrupt void  interval_interrupt( void )
{
	/*****************************************************/
	/*** This interrupt hundler is called of each 10ms ***/
	/*****************************************************/

	unsigned char ucLoopCount; /* for loop control */

	for (ucLoopCount=0; ucLoopCount<4; ucLoopCount++) {
		/* decrease the remainder time to changing brightness */
		g_shTimeRemain[ucLoopCount]--;
		/* when the remainder time to changing brightness disappears */
		if(g_shTimeRemain[ucLoopCount] == 0) {
			/* increase the element number that brightness setting list */
			g_shListReadPoint[ucLoopCount]++;
			/* It is necessary to read from the brightness setting list  */
			g_ucChangeTrigger[ucLoopCount] = TRUE;
		}
	}
}

⌨️ 快捷键说明

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