Wombat Environmental Node 1.0
An environmental node for SDI-12 and digital sensors.
Loading...
Searching...
No Matches
peripherals.h
Go to the documentation of this file.
1#ifndef WOMBAT_PERIPHERALS_H
2#define WOMBAT_PERIPHERALS_H
3
4#include <Arduino.h>
5#include <freertos/FreeRTOS.h>
6
7//==============================================
8// Programmable button ISR with debounce.
9//==============================================
10#define PROG_BTN GPIO_NUM_34
11
12volatile bool progBtnPressed = false;
13static unsigned long lastTriggered = 0;
14
15void IRAM_ATTR progBtnISR(void) {
16 unsigned long now = millis();
17 if (lastTriggered != 0) {
18 if (now - lastTriggered < 250) {
19 return;
20 }
21 }
22
23 lastTriggered = now;
24 progBtnPressed = true;
25}
26
27
28
29#endif //WOMBAT_PERIPHERALS_H
volatile bool progBtnPressed
Definition: peripherals.h:12
static unsigned long lastTriggered
Definition: peripherals.h:13
void IRAM_ATTR progBtnISR(void)
Definition: peripherals.h:15