Skip to content

Commit

Permalink
DigitalPin send cycle: Send every 7 min. in cycle mode. Send immediat…
Browse files Browse the repository at this point in the history
…ely in "OnChange" mode and after 28 min.
  • Loading branch information
breaker27 committed May 11, 2014
1 parent 06dd930 commit 3548b1d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion firmware/shc_envsensor/shc_envsensor.c
Expand Up @@ -130,7 +130,9 @@ void init_di_sensor(void)
di[i].mode = mode;
di[i].meas.cnt = 0;
di[i].meas.val = 0;
di[i].meas.avgThr = AVERAGE_COUNT;

// Send every 7 min. in cycle mode. Send immediately in "OnChange" mode and after 28 min.
di[i].meas.avgThr = mode == DIGITALINPUTMODE_ONCHANGE ? AVERAGE_COUNT * 4 : AVERAGE_COUNT;

UART_PUTF3("Using port %u pin %u as digital input pin %u ", di[i].port, di[i].pin, i);
UART_PUTF2("in mode %u with pull-up %s\r\n", mode, pull_up ? "ON" : "OFF");
Expand Down

0 comments on commit 3548b1d

Please sign in to comment.