Skip to content

Commit

Permalink
Fix using timeout correctly even when switch state is already as requ…
Browse files Browse the repository at this point in the history
…ested.
  • Loading branch information
breaker27 committed Feb 23, 2014
1 parent ef16291 commit 993cee1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion firmware/shc_powerswitch/shc_powerswitch.c
Expand Up @@ -176,7 +176,7 @@ void process_message(MessageTypeEnum messagetype, uint32_t messagegroupid, uint3
// react on changed state (version for more than one switch...)
for (i = 0; i < SWITCH_COUNT; i++)
{
if ((switch_bitmask & (1 << i)) != switch_state[i]) // this switch is to be switched
if (((switch_bitmask & (1 << i)) != switch_state[i]) || (req_timeout > 0)) // this switch is to be switched
{
UART_PUTF4("Switching relais %u from %u to %u with timeout %us.\r\n", i + 1, switch_state[i], req_on, req_timeout);

Expand Down

0 comments on commit 993cee1

Please sign in to comment.