Logo Search packages:      
Sourcecode: odyssey version File versions

Pic16Device::Pic16Device ( char *  name  ) 

Create a new instance and read in in the configuration for the PIC device. This constructor is called from Device::load() when the device name begins with the string "PIC". This function will open the PIC device configuration file "pic.conf" and read the configuration for the device specified.

Parameters:
name The name of the PIC device.
Exceptions:
runtime_error Contains a description of the error.

Definition at line 30 of file Pic16Device.cxx.

References PicDevice::codesize, config_mask, cp_mask, cpd_mask, PicDevice::eesize, PicDevice::flags, ConfigFile::get_integer(), Device::memmap, persistent_config_mask, PIC_FEATURE_BKBUG, PIC_FEATURE_EEPROM, READ_PIC_CONFIG_ENTRY_DEFAULT, and PicDevice::wordmask.

                                   : PicDevice(name) {
      long tmp;

      /* Read configuration word bits */
      READ_PIC_CONFIG_ENTRY_DEFAULT("configmask", config_mask, this->wordmask);
      READ_PIC_CONFIG_ENTRY_DEFAULT("configsave", persistent_config_mask, 0);
      READ_PIC_CONFIG_ENTRY_DEFAULT("cp_mask", cp_mask, 0);
      READ_PIC_CONFIG_ENTRY_DEFAULT("cp_all", cp_all, 0);
      READ_PIC_CONFIG_ENTRY_DEFAULT("cp_none", cp_none, 0);
      READ_PIC_CONFIG_ENTRY_DEFAULT("cpd_mask", cpd_mask, 0);
      READ_PIC_CONFIG_ENTRY_DEFAULT("cpd_on", cpd_on, 0);
      READ_PIC_CONFIG_ENTRY_DEFAULT("cpd_off", cpd_off, 0);
      if(pic_config->get_integer(name, "bkbug_mask", &tmp))
            this->flags |= PIC_FEATURE_BKBUG;

      /* Create the memory map for this device */
      this->memmap.push_back(IntPair (0, this->codesize));
      this->memmap.push_back(IntPair (0x2000,
        (this->flags & PIC_FEATURE_BKBUG) ? 5 : 4));
      this->memmap.push_back(IntPair (0x2007, 1));
      if(this->flags & PIC_FEATURE_EEPROM)
            this->memmap.push_back(IntPair (0x2100, this->eesize));
}


Generated by  Doxygen 1.6.0   Back to index