#include <GLOBAL.h>
#include <stdlib.h>
#include <stdbool.h>
#include <msp430x21x2.h>
#define RunLedOut P3DIR |= BIT1
#define RunLedHig P3OUT |= BIT1
#define RunLedLow P3OUT &=~ BIT1
#define PwrLedOut P3DIR |= BIT2
#define PwrLedHig P3OUT |= BIT2
#define PwrLedLow P3OUT &=~ BIT2
#define ComLedOut P3DIR |= BIT3
#define ComLedHig P3OUT |= BIT3
#define ComLedLow P3OUT &=~ BIT3
//-----***-void LedConn(bool TimeEn,unsigned char TimeSliceSt,unsigned int TimesliceFg)-***-----//
//---功能描述:片隔间管理
//---输入条件:TimeSliceSt->
//---输出项目:RetData
void LedConn(unsigned int *DataDptr,unsigned int TimesliceFg)
{
unsigned int i;
i=~TimesliceFg;
if(*DataDptr&TimesliceFg)
{
*DataDptr&=i;
LedFlsh++;
}
if(ChkVoltage<1500)
{
RunLedOut;
RunLedLow;;
}
else
{
if(LedFlsh==20)
{
RunLedOut;
RunLedLow;
}
if(LedFlsh==40)
{
RunLedHig;
}
if(LedFlsh>60)
{
LedFlsh=0;
}
}
}
|