Advertisement
enhering

Untitled

Sep 17th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. bool COM::BuildModuleCapacityMatrix() {
  2. for (volatile uint8_t nSlot = 1; nSlot <= NUM_SLOTS; nSlot++) {
  3. m_anCapacitiesPerSlot[nSlot] = m_cSPIProtocol.ReadLongViaSPI(B00_MODULE_CAPACITIES, nSlot);
  4. }
  5. for (volatile uint32_t nSlot = 1; nSlot <= NUM_SLOTS; nSlot++) { // nSlot must be uint32 too for the code to work
  6. for (uint32_t nCapacityBit = 0; nCapacityBit < TOTAL_CAPACITIES; nCapacityBit++) {
  7. if (m_anCapacitiesPerSlot[nSlot] & (1UL << nCapacityBit)) {
  8. m_anSlotListPerCapacity[nCapacityBit] |= (1UL << nSlot);
  9. }
  10. }
  11. }
  12. m_bIdentifyModulesAgain = false;
  13. return true;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement