Skip to content

User data is not saved #6

@riwalker

Description

@riwalker

I had to make 2 changes:

    • add the passed user data 'reset_type'
      CApplicationMonitor::CApplicationMonitor(int nBaseAddress, int nMaxEntries)
      : c_nBaseAddress(nBaseAddress), c_nMaxEntries(nMaxEntries)
      {
      m_CrashReport.m_uData = reset_type;
      }
  1. Write the userdata with memcpy
    void CApplicationMonitor::WatchdogInterruptHandler(uint8_t *puProgramAddress)
    {
    CApplicationMonitorHeader Header;

LoadHeader(Header);
memcpy(m_CrashReport.m_auAddress, puProgramAddress, PROGRAM_COUNTER_SIZE);
//RIW fix to write the user data
memcpy(m_CrashReport.m_auAddress+PROGRAM_COUNTER_SIZE, &reset_type, PROGRAM_COUNTER_SIZE);
SaveCurrentReport(Header.m_uNextReport);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions