Skip to content

Commit

Permalink
PJONSlave force addressing if PJON_NOT_ASSIGNED and PJON_ID_LIST rece…
Browse files Browse the repository at this point in the history
…ived (#152)
  • Loading branch information
gioblu committed Dec 7, 2017
1 parent 8b7d9d5 commit 3846276
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions PJONSlave.h
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ class PJONSlave : public PJON<Strategy> {
) acquire_id();

if(this->data[overhead - CRC_overhead] == PJON_ID_LIST)
if(this->_device_id != PJON_NOT_ASSIGNED)
if(this->_device_id != PJON_NOT_ASSIGNED) {
if(
(uint32_t)(PJON_MICROS() - _last_request_time) >
(PJON_ADDRESSING_TIMEOUT * 1.125)
Expand All @@ -310,7 +310,13 @@ class PJONSlave : public PJON<Strategy> {
this->config | PJON_ACK_REQ_BIT | required_config
);
}

} else if(
(uint32_t)(PJON_MICROS() - _last_request_time) >
(PJON_ADDRESSING_TIMEOUT * 1.125)
) {
_last_request_time = PJON_MICROS();
acquire_id();
}
return true;
}
return false;
Expand Down

0 comments on commit 3846276

Please sign in to comment.