diff options
Diffstat (limited to 'src/testapp1/morse.c')
-rw-r--r-- | src/testapp1/morse.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/testapp1/morse.c b/src/testapp1/morse.c index cb06b4a..65b27cd 100644 --- a/src/testapp1/morse.c +++ b/src/testapp1/morse.c @@ -6,7 +6,7 @@ #include "delay.h" #include "morse.h" -const uint8_t morse_mapping[60] PROGMEM = +const uint16_t morse_mapping[60] PROGMEM = { // Read bits from right to left @@ -28,10 +28,12 @@ const uint8_t morse_mapping[60] PROGMEM = 0b111000, 0b110000, // 9, ASCII 57 + // the colon stands in as error + 0b111111111, // : + // The following are mostly invalid, but // required to fill the gap in ASCII between // numerals and capital letters - 0b10, // : 0b10, // ; 0b10, // < 0b10, // = @@ -90,9 +92,6 @@ void morse_symbol(uint8_t sym) delay_ms(4*DIT_DURATION); } -// Transmit a string in morse code. Supported range: -// All ASCII between '+' and '\', which includes -// numerals and capital letters. void morse(char* text) { char* sym = text; @@ -102,3 +101,7 @@ void morse(char* text) } while (*sym != '\0'); } +void morse_char(char letter) +{ + morse_symbol(letter - '+'); +} |