Skip to content

Commit

Permalink
swiotrefactor/faults: Fixed index out of range bug.
Browse files Browse the repository at this point in the history
Signed-off-by: andrei.danila <[email protected]>
  • Loading branch information
andreidanila1 committed May 7, 2024
1 parent 86b4ec3 commit 98dff77
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ private Q_SLOTS:

uint32_t m_faultNumeric = 0;
QVector<uint32_t> m_registers;
QVector<uint32_t> m_registerValues;
QMap<int, uint32_t> m_registerValues;
QVector<Command *> m_deviceConfigCmds;
QVector<Command *> m_functionConfigCmds;
};
Expand Down
2 changes: 1 addition & 1 deletion plugins/swiotrefactor/src/faults/faultsdevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ void FaultsDevice::onFaultRegisterRead(int iReg, uint32_t value)
if(m_registerValues.size() == m_registers.size()) {
uint32_t faultRegisterValue = 0;
for(int i = 0; i < m_registerValues.size(); i++) {
faultRegisterValue |= (m_registerValues.at(i) << (i * 8));
faultRegisterValue |= (m_registerValues[i] << (i * 8));
}
m_faultNumeric = faultRegisterValue;
Q_EMIT faultNumericUpdated();
Expand Down

0 comments on commit 98dff77

Please sign in to comment.