master/sync.c
branchstable-1.5
changeset 2123 4c335a1d4db0
parent 1921 d9cf40facbc4
child 2522 ec403cf308eb
equal deleted inserted replaced
2122:23414e7559de 2123:4c335a1d4db0
    94 void ec_sync_page(
    94 void ec_sync_page(
    95         const ec_sync_t *sync, /**< Sync manager. */
    95         const ec_sync_t *sync, /**< Sync manager. */
    96         uint8_t sync_index, /**< Index of the sync manager. */
    96         uint8_t sync_index, /**< Index of the sync manager. */
    97         uint16_t data_size, /**< Data size. */
    97         uint16_t data_size, /**< Data size. */
    98         const ec_sync_config_t *sync_config, /**< Configuration. */
    98         const ec_sync_config_t *sync_config, /**< Configuration. */
       
    99         uint8_t pdo_xfer, /**< Non-zero, if PDOs will be transferred via this
       
   100                             sync manager. */
    99         uint8_t *data /**> Configuration memory. */
   101         uint8_t *data /**> Configuration memory. */
   100         )
   102         )
   101 {
   103 {
   102     // enable only if SII enable is set and size is > 0 and SM is not virtual
   104     // enable only if (SII enable is set or PDO xfer)
   103     uint16_t enable = (sync->enable & 0x01)
   105     // and size is > 0 and SM is not virtual
       
   106     uint16_t enable = ((sync->enable & 0x01) || pdo_xfer)
   104                         && data_size
   107                         && data_size
   105                         && ((sync->enable & 0x04) == 0);
   108                         && ((sync->enable & 0x04) == 0);
   106     uint8_t control = sync->control_register;
   109     uint8_t control = sync->control_register;
   107 
   110 
   108     if (sync_config) {
   111     if (sync_config) {