Rev 1523 | Rev 1529 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1523 | Rev 1526 | ||
---|---|---|---|
Line 52... | Line 52... | ||
52 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
52 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
53 | #include "capacity.h" |
53 | #include "capacity.h" |
54 | #include "twimaster.h" |
54 | #include "twimaster.h" |
55 | #include "main.h" |
55 | #include "main.h" |
56 | #include "timer0.h" |
56 | #include "timer0.h" |
- | 57 | #include "analog.h" |
|
Line 57... | Line 58... | ||
57 | 58 | ||
58 | #define CAPACITY_UPDATE_INTERVAL 10 // 10 ms |
59 | #define CAPACITY_UPDATE_INTERVAL 10 // 10 ms |
59 | #define FC_OFFSET_CURRENT 5 // calculate with a current of 0.5A |
60 | #define FC_OFFSET_CURRENT 5 // calculate with a current of 0.5A |
Line 116... | Line 117... | ||
116 | Current += FC_OFFSET_CURRENT + NumOfMotors * BL_OFFSET_CURRENT; |
117 | Current += FC_OFFSET_CURRENT + NumOfMotors * BL_OFFSET_CURRENT; |
117 | } |
118 | } |
Line 118... | Line 119... | ||
118 | 119 | ||
119 | // update actual Current |
120 | // update actual Current |
- | 121 | Capacity.ActualCurrent = Current; |
|
- | 122 | // update actual Power |
|
Line 120... | Line 123... | ||
120 | Capacity.ActualCurrent = Current; |
123 | Capacity.ActualPower = (UBat * Current) / 10; // in 0.1W |
121 | 124 | ||
Line 122... | Line 125... | ||
122 | // update used capacity |
125 | // update used capacity |