master/domain.c
changeset 1907 dd276ae226b4
parent 1798 e7733f825982
child 1921 d9cf40facbc4
child 1981 c14b6bb14fdf
equal deleted inserted replaced
1906:96805a6eae3d 1907:dd276ae226b4
   224     datagram_offset = 0;
   224     datagram_offset = 0;
   225     datagram_size = 0;
   225     datagram_size = 0;
   226     datagram_count = 0;
   226     datagram_count = 0;
   227     datagram_used[EC_DIR_OUTPUT] = 0;
   227     datagram_used[EC_DIR_OUTPUT] = 0;
   228     datagram_used[EC_DIR_INPUT] = 0;
   228     datagram_used[EC_DIR_INPUT] = 0;
       
   229 
   229     list_for_each_entry(fmmu_temp, &domain->fmmu_configs, list) {
   230     list_for_each_entry(fmmu_temp, &domain->fmmu_configs, list) {
   230        ec_slave_config_t *sc = (ec_slave_config_t *)fmmu_temp->sc; // we have to remove the constness, sorry
   231         // we have to remove the constness, sorry FIXME
   231        sc->used_for_fmmu_datagram[fmmu_temp->dir] = 0;
   232         ec_slave_config_t *sc = (ec_slave_config_t *) fmmu_temp->sc;
   232     }
   233         sc->used_for_fmmu_datagram[fmmu_temp->dir] = 0;
       
   234     }
       
   235 
   233     list_for_each_entry(fmmu, &domain->fmmu_configs, list) {
   236     list_for_each_entry(fmmu, &domain->fmmu_configs, list) {
   234         // Correct logical FMMU address
   237         // Correct logical FMMU address
   235         fmmu->logical_start_address += base_address;
   238         fmmu->logical_start_address += base_address;
   236 
   239 
   237         // Increment Input/Output counter to determine datagram types
   240         // Increment Input/Output counter to determine datagram types
   239         if (fmmu->sc->used_for_fmmu_datagram[fmmu->dir] == 0) {
   242         if (fmmu->sc->used_for_fmmu_datagram[fmmu->dir] == 0) {
   240             ec_slave_config_t *sc = (ec_slave_config_t *)fmmu->sc;
   243             ec_slave_config_t *sc = (ec_slave_config_t *)fmmu->sc;
   241             datagram_used[fmmu->dir]++;
   244             datagram_used[fmmu->dir]++;
   242             sc->used_for_fmmu_datagram[fmmu->dir] = 1;
   245             sc->used_for_fmmu_datagram[fmmu->dir] = 1;
   243         }
   246         }
       
   247 
   244         // If the current FMMU's data do not fit in the current datagram,
   248         // If the current FMMU's data do not fit in the current datagram,
   245         // allocate a new one.
   249         // allocate a new one.
   246         if (datagram_size + fmmu->data_size > EC_MAX_DATA_SIZE) {
   250         if (datagram_size + fmmu->data_size > EC_MAX_DATA_SIZE) {
   247             ret = ec_domain_add_datagram(domain,
   251             ret = ec_domain_add_datagram(domain,
   248                     domain->logical_base_address + datagram_offset,
   252                     domain->logical_base_address + datagram_offset,