summaryrefslogtreecommitdiffstats
path: root/src/target/firmware/apps
diff options
context:
space:
mode:
authorAndreas.Eversberg2010-07-18 14:56:48 +0200
committerAndreas.Eversberg2010-07-18 14:56:48 +0200
commit8d2ed53b45bf0f344d5f6f78cd165772e8a15dee (patch)
treeed4538370bfc84ecc8f9544730f2a5816284e860 /src/target/firmware/apps
parent[layer23] Option "no location-updating" to disabled location updating (diff)
downloadosmocom-8d2ed53b45bf0f344d5f6f78cd165772e8a15dee.tar.gz
osmocom-8d2ed53b45bf0f344d5f6f78cd165772e8a15dee.tar.xz
osmocom-8d2ed53b45bf0f344d5f6f78cd165772e8a15dee.zip
[calypso] Rework of keypad interrupt handler.
The keys are correctly detected and debounced. There is no delay_ms in the interrupt handler anymore. When a key is pressed, the columns of the keypad are polled and debounced via timer interrupt. If no key is pressed, the timer interrupt is ignored again.
Diffstat (limited to 'src/target/firmware/apps')
-rw-r--r--src/target/firmware/apps/hello_world/main.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/target/firmware/apps/hello_world/main.c b/src/target/firmware/apps/hello_world/main.c
index 846bc55..ba3dae5 100644
--- a/src/target/firmware/apps/hello_world/main.c
+++ b/src/target/firmware/apps/hello_world/main.c
@@ -113,10 +113,33 @@ int main(void)
void key_handler(enum key_codes code, enum key_states state)
{
+ char test[16];
+
if (state != PRESSED)
return;
switch (code) {
+ case KEY_0:
+ case KEY_1:
+ case KEY_2:
+ case KEY_3:
+ case KEY_4:
+ case KEY_5:
+ case KEY_6:
+ case KEY_7:
+ case KEY_8:
+ case KEY_9:
+ sprintf(test, "%d", code - KEY_0);
+ display_puts(test);
+ break;
+ case KEY_STAR:
+ sprintf(test, "*", 0);
+ display_puts(test);
+ break;
+ case KEY_HASH:
+ sprintf(test, "#", 0);
+ display_puts(test);
+ break;
default:
break;
}