mirror of
https://github.com/thelsing/knx.git
synced 2025-04-19 01:15:27 +02:00
Progbutton interrupt (#35)
* corrected float with DPT9 * Switch Programming-LED also via Bus/ETS * Again: Prog-LED switchable from bus/ETS * DPT16 (to bus) implemented * - Allows ProgButton interrupts on FALLING signal
This commit is contained in:
parent
6c3bbfe5a5
commit
4a0b46e062
@ -110,6 +110,24 @@ template <class P, class B> class KnxFacade : private SaveRestore
|
||||
_ledPin = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* returns RISING if interrupt is created in a rising signal, FALLING otherwise
|
||||
*/
|
||||
uint32_t buttonPinInterruptOn()
|
||||
{
|
||||
return _buttonPinInterruptOn;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets if the programming button creates a RISING or a FALLING signal.
|
||||
*
|
||||
* Set to RISING for GPIO--BUTTON--VDD or to FALLING for GPIO--BUTTON--GND
|
||||
*/
|
||||
void buttonPinInterruptOn(uint32_t value)
|
||||
{
|
||||
_buttonPinInterruptOn = value;
|
||||
}
|
||||
|
||||
uint32_t buttonPin()
|
||||
{
|
||||
return _buttonPin;
|
||||
@ -192,7 +210,7 @@ template <class P, class B> class KnxFacade : private SaveRestore
|
||||
|
||||
pinMode(_buttonPin, INPUT_PULLUP);
|
||||
|
||||
attachInterrupt(_buttonPin, buttonUp, RISING);
|
||||
attachInterrupt(_buttonPin, buttonUp, _buttonPinInterruptOn);
|
||||
enabled(true);
|
||||
}
|
||||
|
||||
@ -252,8 +270,9 @@ template <class P, class B> class KnxFacade : private SaveRestore
|
||||
P* _platformPtr = 0;
|
||||
B* _bauPtr = 0;
|
||||
B& _bau;
|
||||
uint32_t _ledPinActiveOn = LOW;
|
||||
uint32_t _ledPinActiveOn = LOW;
|
||||
uint32_t _ledPin = LED_BUILTIN;
|
||||
uint32_t _buttonPinInterruptOn = RISING;
|
||||
uint32_t _buttonPin = 0;
|
||||
saveRestoreCallback _saveCallback = 0;
|
||||
saveRestoreCallback _restoreCallback = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user