master/fsm_sii.c
changeset 1995 7d748d9cf9e8
parent 1957 b481ccf21272
equal deleted inserted replaced
1994:b369f3f92eb8 1995:7d748d9cf9e8
   182     EC_WRITE_U8 (datagram->data,     0x80); // two address octets
   182     EC_WRITE_U8 (datagram->data,     0x80); // two address octets
   183     EC_WRITE_U8 (datagram->data + 1, 0x01); // request read operation
   183     EC_WRITE_U8 (datagram->data + 1, 0x01); // request read operation
   184     EC_WRITE_U16(datagram->data + 2, fsm->word_offset);
   184     EC_WRITE_U16(datagram->data + 2, fsm->word_offset);
   185 
   185 
   186 #ifdef SII_DEBUG
   186 #ifdef SII_DEBUG
   187     EC_SLAVE_DBG(slave, 0, "reading SII data:\n");
   187     EC_SLAVE_DBG(fsm->slave, 0, "reading SII data, word %u:\n",
       
   188             fsm->word_offset);
   188     ec_print_data(datagram->data, 4);
   189     ec_print_data(datagram->data, 4);
   189 #endif
   190 #endif
   190 
   191 
   191     fsm->retries = EC_FSM_RETRIES;
   192     fsm->retries = EC_FSM_RETRIES;
   192     fsm->state = ec_fsm_sii_state_read_check;
   193     fsm->state = ec_fsm_sii_state_read_check;
   275     EC_SLAVE_DBG(fsm->slave, 0, "checking SII read state:\n");
   276     EC_SLAVE_DBG(fsm->slave, 0, "checking SII read state:\n");
   276     ec_print_data(datagram->data, 10);
   277     ec_print_data(datagram->data, 10);
   277 #endif
   278 #endif
   278 
   279 
   279     if (EC_READ_U8(datagram->data + 1) & 0x20) {
   280     if (EC_READ_U8(datagram->data + 1) & 0x20) {
   280         EC_SLAVE_ERR(fsm->slave, "SII: Error on last SII command!\n");
   281         EC_SLAVE_ERR(fsm->slave, "Error on last command while"
       
   282                 " reading from SII word 0x%04x.\n", fsm->word_offset);
   281         fsm->state = ec_fsm_sii_state_error;
   283         fsm->state = ec_fsm_sii_state_error;
   282         return;
   284         return;
   283     }
   285     }
   284 
   286 
   285     // check "busy bit"
   287     // check "busy bit"