Subversion Repositories FlightCtrl

Rev

Rev 1995 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1995 Rev 2000
Line 69... Line 69...
69
{
69
{
70
        Capacity.ActualCurrent = 0;
70
        Capacity.ActualCurrent = 0;
71
        Capacity.UsedCapacity = 0;
71
        Capacity.UsedCapacity = 0;
72
        Capacity.ActualPower = 0;
72
        Capacity.ActualPower = 0;
73
        Capacity.MinOfMaxPWM = 0;
73
        Capacity.MinOfMaxPWM = 0;
74
        Capacity.RemainCapacity = (EE_Parameter.UserParam1*100);
74
        //Capacity.RemainCapacity = (EE_Parameter.UserParam1*100);
75
        update_timer = SetDelay(CAPACITY_UPDATE_INTERVAL);
75
        update_timer = SetDelay(CAPACITY_UPDATE_INTERVAL);
76
}
76
}
Line 77... Line 77...
77
 
77
 
Line 137... Line 137...
137
                #define SUB_COUNTER_LIMIT (36000 / CAPACITY_UPDATE_INTERVAL)
137
                #define SUB_COUNTER_LIMIT (36000 / CAPACITY_UPDATE_INTERVAL)
138
                if(SubCounter > SUB_COUNTER_LIMIT)
138
                if(SubCounter > SUB_COUNTER_LIMIT)
139
                {
139
                {
140
                        Capacity.UsedCapacity++;                        // we have one mAh more
140
                        Capacity.UsedCapacity++;                        // we have one mAh more
141
                        SubCounter -= SUB_COUNTER_LIMIT;        // keep the remaining sub part
141
                        SubCounter -= SUB_COUNTER_LIMIT;        // keep the remaining sub part
-
 
142
                #ifdef WITH_REMAINCAPACITY      // only include functions if DEBUG is defined in main.h
-
 
143
 
-
 
144
                        #warning : "### with REMAIN CAPACITY ###"
142
                        Capacity.RemainCapacity=(EE_Parameter.UserParam1*100)-Capacity.UsedCapacity; //Added by metro
145
                        Capacity.RemainCapacity=(EE_Parameter.UserParam1*100)-Capacity.UsedCapacity; //Added by metro
143
                        if((Capacity.RemainCapacity<=0)&&(Capacity.RemainCapacity%10==0)&&(EE_Parameter.UserParam1!=0)) beeptime = 1000;
146
                        if((Capacity.RemainCapacity<=0)&&(Capacity.RemainCapacity%10==0)&&(EE_Parameter.UserParam1!=0)) beeptime = 1000;
144
                        if((Capacity.RemainCapacity<=500)&&(Capacity.RemainCapacity%100==0)&&(EE_Parameter.UserParam1!=0)) beeptime = 10000;
147
                        if((Capacity.RemainCapacity<=500)&&(Capacity.RemainCapacity%100==0)&&(EE_Parameter.UserParam1!=0)) beeptime = 10000;
-
 
148
                #endif
Line 145... Line 149...
145
                       
149
                       
Line 146... Line 150...
146
                }
150
                }