fix: active poll instead of wait for interupt
This commit is contained in:
parent
8554f7a8ad
commit
f57ecd19aa
4 changed files with 51 additions and 36 deletions
|
|
@ -14,10 +14,10 @@ in
|
|||
description = "GPIO pin number to monitor.";
|
||||
};
|
||||
|
||||
debounceSecs = lib.mkOption {
|
||||
debounceMs = lib.mkOption {
|
||||
type = lib.types.ints.positive;
|
||||
default = 5;
|
||||
description = "Debounce delay in seconds.";
|
||||
default = 50;
|
||||
description = "Debounce delay in milliseconds.";
|
||||
};
|
||||
|
||||
port = lib.mkOption {
|
||||
|
|
@ -88,12 +88,15 @@ in
|
|||
systemd.services.noisebell = {
|
||||
description = "Noisebell GPIO door monitor";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = [ "network-online.target" "tailscaled.service" ];
|
||||
after = [
|
||||
"network-online.target"
|
||||
"tailscaled.service"
|
||||
];
|
||||
wants = [ "network-online.target" ];
|
||||
|
||||
environment = {
|
||||
NOISEBELL_GPIO_PIN = toString cfg.gpioPin;
|
||||
NOISEBELL_DEBOUNCE_SECS = toString cfg.debounceSecs;
|
||||
NOISEBELL_DEBOUNCE_MS = toString cfg.debounceMs;
|
||||
NOISEBELL_PORT = toString cfg.port;
|
||||
NOISEBELL_RETRY_ATTEMPTS = toString cfg.retryAttempts;
|
||||
NOISEBELL_RETRY_BASE_DELAY_SECS = toString cfg.retryBaseDelaySecs;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue