Regarding Xadow.getChrgState()

Arduino, Seeeduino Serials and mutants. Share your problems and experence on arduino compatible board such as seeeduino/stalker, etc.

Moderators: lily.li, violet, salmanfarisvp

Post Reply
mayfair
Pre-kindergarten
Pre-kindergarten
Posts: 2
Joined: Sun Aug 17, 2014 8:09 am

Regarding Xadow.getChrgState()

Post by mayfair » Sun Aug 17, 2014 8:28 am

Hi,

I have a question regarding Xadow.getChrgState().

In xadow.cpp, xadow::getChrgState() is implemented as follows.

Code: Select all

unsigned char xadow::getChrgState()
{
    unsigned char Temp = CHRGpin & CHRGbit;
    
    if(!Temp)
    {
        return NOCHARGE;
    }
    Temp = DONEpin & DONEbit;
    if(!Temp)
    {
        return CHARGDONE;
    }
    return NOCHARGE;
}
But if I understand correctly, that should be as follows. Otherwise, the function never returns CHARGING. Moreover, /CHRG means charging, instead of no charge. Is this correct?

Code: Select all

unsigned char xadow::getChrgState()
{
    unsigned char Temp = CHRGpin & CHRGbit;

    if(!Temp)
    {
        return CHARGING;
    }
    Temp = DONEpin & DONEbit;
    if(!Temp)
    {
        return CHARGDONE;
    }
    return NOCHARGE;
}
I'm sorry if this is a false alarm.

Post Reply