lib/domain.c
changeset 1313 ed15eef57d5c
parent 1287 cc7b679c74e9
child 1326 ef907b0b5125
equal deleted inserted replaced
1312:74853e018898 1313:ed15eef57d5c
    57     int ret;
    57     int ret;
    58     
    58     
    59     for (reg = regs; reg->index; reg++) {
    59     for (reg = regs; reg->index; reg++) {
    60         if (!(sc = ecrt_master_slave_config(domain->master, reg->alias,
    60         if (!(sc = ecrt_master_slave_config(domain->master, reg->alias,
    61                         reg->position, reg->vendor_id, reg->product_code)))
    61                         reg->position, reg->vendor_id, reg->product_code)))
    62             return -1;
    62             return -1; // FIXME
    63 
    63 
    64         if ((ret = ecrt_slave_config_reg_pdo_entry(sc, reg->index,
    64         if ((ret = ecrt_slave_config_reg_pdo_entry(sc, reg->index,
    65                         reg->subindex, domain, reg->bit_position)) < 0)
    65                         reg->subindex, domain, reg->bit_position)) < 0)
    66             return -1;
    66             return -1; // FIXME
    67 
    67 
    68         *reg->offset = ret;
    68         *reg->offset = ret;
    69     }
    69     }
    70 
    70 
    71     return 0;
    71     return 0;
    96 
    96 
    97 void ecrt_domain_process(ec_domain_t *domain)
    97 void ecrt_domain_process(ec_domain_t *domain)
    98 {
    98 {
    99     if (ioctl(domain->master->fd, EC_IOCTL_DOMAIN_PROCESS,
    99     if (ioctl(domain->master->fd, EC_IOCTL_DOMAIN_PROCESS,
   100                 domain->index) == -1) {
   100                 domain->index) == -1) {
   101         fprintf(stderr, "Failed to process domain offset: %s\n",
   101         fprintf(stderr, "Failed to process domain: %s\n", strerror(errno));
   102                 strerror(errno));
       
   103     }
   102     }
   104 }
   103 }
   105 
   104 
   106 /*****************************************************************************/
   105 /*****************************************************************************/
   107 
   106 
   108 void ecrt_domain_queue(ec_domain_t *domain)
   107 void ecrt_domain_queue(ec_domain_t *domain)
   109 {
   108 {
   110     if (ioctl(domain->master->fd, EC_IOCTL_DOMAIN_QUEUE,
   109     if (ioctl(domain->master->fd, EC_IOCTL_DOMAIN_QUEUE,
   111                 domain->index) == -1) {
   110                 domain->index) == -1) {
   112         fprintf(stderr, "Failed to queue domain offset: %s\n",
   111         fprintf(stderr, "Failed to queue domain: %s\n", strerror(errno));
   113                 strerror(errno));
       
   114     }
   112     }
   115 }
   113 }
   116 
   114 
   117 /*****************************************************************************/
   115 /*****************************************************************************/
   118 
   116