From efdea646b7290cc125cb37efba204a27e6d02929 Mon Sep 17 00:00:00 2001 From: Armel FAUVEAU Date: Tue, 13 Aug 2024 04:37:44 +0200 Subject: [PATCH] Save 16 bytes --- app/dtmf.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/app/dtmf.c b/app/dtmf.c index c7635c0..7376b96 100644 --- a/app/dtmf.c +++ b/app/dtmf.c @@ -171,18 +171,11 @@ bool DTMF_FindContact(const char *pContact, char *pResult) char DTMF_GetCharacter(const unsigned int code) { + if (code <= KEY_9) + return '0' + code; + switch (code) { - case KEY_0: return '0'; - case KEY_1: return '1'; - case KEY_2: return '2'; - case KEY_3: return '3'; - case KEY_4: return '4'; - case KEY_5: return '5'; - case KEY_6: return '6'; - case KEY_7: return '7'; - case KEY_8: return '8'; - case KEY_9: return '9'; case KEY_MENU: return 'A'; case KEY_UP: return 'B'; case KEY_DOWN: return 'C';