master/fsm.c
changeset 275 ba51285d4ef6
parent 269 a03be9a6fed6
child 286 f3352378b4d4
equal deleted inserted replaced
274:b397aee6e602 275:ba51285d4ef6
  1126 
  1126 
  1127     // known slave type, take type's SM information
  1127     // known slave type, take type's SM information
  1128     if (slave->type) {
  1128     if (slave->type) {
  1129         for (j = 0; slave->type->sync_managers[j] && j < EC_MAX_SYNC; j++) {
  1129         for (j = 0; slave->type->sync_managers[j] && j < EC_MAX_SYNC; j++) {
  1130             sync = slave->type->sync_managers[j];
  1130             sync = slave->type->sync_managers[j];
  1131             ec_sync_config(sync, command->data + EC_SYNC_SIZE * j);
  1131             ec_sync_config(sync, slave, command->data + EC_SYNC_SIZE * j);
  1132         }
  1132         }
  1133     }
  1133     }
  1134 
  1134 
  1135     // unknown type, but slave has mailbox
  1135     // unknown type, but slave has mailbox
  1136     else if (slave->sii_mailbox_protocols)
  1136     else if (slave->sii_mailbox_protocols)
  1245     // configure FMMUs
  1245     // configure FMMUs
  1246     ec_command_npwr(command, slave->station_address,
  1246     ec_command_npwr(command, slave->station_address,
  1247                     0x0600, EC_FMMU_SIZE * slave->base_fmmu_count);
  1247                     0x0600, EC_FMMU_SIZE * slave->base_fmmu_count);
  1248     memset(command->data, 0x00, EC_FMMU_SIZE * slave->base_fmmu_count);
  1248     memset(command->data, 0x00, EC_FMMU_SIZE * slave->base_fmmu_count);
  1249     for (j = 0; j < slave->fmmu_count; j++) {
  1249     for (j = 0; j < slave->fmmu_count; j++) {
  1250         ec_fmmu_config(&slave->fmmus[j], command->data + EC_FMMU_SIZE * j);
  1250         ec_fmmu_config(&slave->fmmus[j], slave,
       
  1251                        command->data + EC_FMMU_SIZE * j);
  1251     }
  1252     }
  1252 
  1253 
  1253     ec_master_queue_command(master, command);
  1254     ec_master_queue_command(master, command);
  1254     fsm->slave_state = ec_fsm_slave_saveop;
  1255     fsm->slave_state = ec_fsm_slave_saveop;
  1255 }
  1256 }