Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool COM::BuildModuleCapacityMatrix() {
- for (volatile uint8_t nSlot = 1; nSlot <= NUM_SLOTS; nSlot++) {
- m_anCapacitiesPerSlot[nSlot] = m_cSPIProtocol.ReadLongViaSPI(B00_MODULE_CAPACITIES, nSlot);
- }
- for (volatile uint32_t nSlot = 1; nSlot <= NUM_SLOTS; nSlot++) { // nSlot must be uint32 too for the code to work
- for (uint32_t nCapacityBit = 0; nCapacityBit < TOTAL_CAPACITIES; nCapacityBit++) {
- if (m_anCapacitiesPerSlot[nSlot] & (1UL << nCapacityBit)) {
- m_anSlotListPerCapacity[nCapacityBit] |= (1UL << nSlot);
- }
- }
- }
- m_bIdentifyModulesAgain = false;
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement