Logo Search packages:      
Sourcecode: odyssey version File versions

void Pic18Device::read ( DataBuffer buf,
bool  verify = false 
) [virtual]

Read the contents of a device into the DataBuffer.

Parameters:
buf The DataBuffer to store the read data.
verify If this flag is true, don't store the data in the DataBuffer but verify the contents of it.
Precondition:
set_iodevice() must have been called with a valid IO object.
Exceptions:
runtime_error Contains a textual description of the error.

Implements Device.

Definition at line 114 of file Pic18Device.cxx.

References PicDevice::codesize, PicDevice::eesize, PicDevice::flags, PIC_FEATURE_EEPROM, PicDevice::pic_off(), Device::progress_count, Device::progress_total, read_config_memory(), read_data_memory(), read_memory(), and PicDevice::set_program_mode().

                                                   {
      this->progress_total = this->codesize + 4 + 7 + this->eesize - 1;
      this->progress_count = 0;

      try {
            set_program_mode();

            read_memory(buf, 0, this->codesize, verify);    /* Program memory */
            read_memory(buf, 0x200000, 4, verify);                /* ID memory */
            read_config_memory(buf, 0x300000, 7, verify);   /* Config words */
            if(flags & PIC_FEATURE_EEPROM);
                  read_data_memory(buf, 0xf00000, verify);

            pic_off();
      } catch(std::exception& e) {
            pic_off();
            throw;
      }
}


Generated by  Doxygen 1.6.0   Back to index