📄 led_flash.c
字号:
/*---------------------------------------------------------------*-
LED_Flash.C(v1.00)
Author:06_Digital_Media
All Right Reserved
-----------------------------------------------------------------
Simple 'Flash LED 'test function
-*--------------------------------------------------------------*/
#include "Main.H"
#include "Port.H"
#include "LED_Flash.H"
//------------Private variable definitions ----------------------
static bit LED_state_G;
/*--------------------------------------------------------------*-
LED_FLASH_Init()
Prepare for LED_Change_State()function - see below
-*-----------------------------------------------------------*/
void LED_FLASH_Init(void){
LED_state_G = 0 ;
}
/*------------------------------------------------------------*-
LED_FLASH_Change_State()
Changes the state of an LED (or pulses a buzzer ,etc) on a specific
port pin
Must call at twice the required flash rate:thus ,for 1HZ flash (on for
0.5 seconds,off for 0.5 seconds) must call every 0.5 seconds
-*-----------------------------------------------------------*/
void LED_FLASH_Change_State(void){
//Change the LED from OFF to ON (or vice versa)
if (LED_state_G == 1){
LED_state_G = 0;
LED_pin = 0;
}
else
{
LED_state_G = 1;
LED_pin = 1;
}
}
/*----------------------------------------------------------*-
-------END OF FILE-------------------------------------------
-*----------------------------------------------------------*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -