COSA
An Object-Oriented Platform for Arduino Programming
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
Keypad.cpp
Go to the documentation of this file.
1
21
#include "
Cosa/Keypad.hh
"
22
23
void
24
Keypad::Key::on_change(uint16_t value)
25
{
26
uint8_t nr = 0;
27
while
(value < (uint16_t) pgm_read_word(&m_map[nr])) nr++;
28
if
(
UNLIKELY
(nr == m_latest))
return
;
29
if
(nr != 0)
30
m_keypad->
on_key_down
(nr);
31
else
32
m_keypad->
on_key_up
(m_latest);
33
m_latest = nr;
34
}
35
36
void
37
Keypad::run
()
38
{
39
m_key
.
powerup
();
40
m_key
.
sample_request
(
Event::SAMPLE_COMPLETED_TYPE
);
41
}
Keypad::on_key_up
virtual void on_key_up(uint8_t nr)
Definition:
Keypad.hh:64
Keypad::m_key
Key m_key
Definition:
Keypad.hh:106
Keypad.hh
AnalogPin::powerup
static void powerup()
Definition:
AnalogPin.hh:113
Keypad::run
virtual void run()
Definition:
Keypad.cpp:37
Keypad::on_key_down
virtual void on_key_down(uint8_t nr)
Definition:
Keypad.hh:53
Event::SAMPLE_COMPLETED_TYPE
Definition:
Event.hh:61
UNLIKELY
#define UNLIKELY(x)
Definition:
Types.h:153
AnalogPin::sample_request
bool sample_request(uint8_t event=Event::NULL_TYPE)
Definition:
AnalogPin.hh:171
cores
cosa
Cosa
Keypad.cpp
Generated on Thu Aug 31 2017 17:02:02 for COSA by
1.8.11