aboutsummaryrefslogtreecommitdiffstats
path: root/src/fsm/cw.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fsm/cw.c')
-rw-r--r--src/fsm/cw.c66
1 files changed, 64 insertions, 2 deletions
diff --git a/src/fsm/cw.c b/src/fsm/cw.c
index 96c510a..ee0ba77 100644
--- a/src/fsm/cw.c
+++ b/src/fsm/cw.c
@@ -47,6 +47,69 @@
#define ON_BUFFER_SIZE 1024
+const uint8_t cw_mapping[60] = { // {{{
+ // Read bits from right to left
+
+ 0b110101, //+ ASCII 43
+ 0b110101, //, ASCII 44
+ 0b1011110, //- ASCII 45
+
+ 0b1010101, //., ASCII 46
+ 0b110110, // / ASCII 47
+
+ 0b100000, // 0, ASCII 48
+ 0b100001, // 1
+ 0b100011,
+ 0b100111,
+ 0b101111,
+ 0b111111,
+ 0b111110,
+ 0b111100,
+ 0b111000,
+ 0b110000, // 9, ASCII 57
+
+ // The following are mostly invalid, but
+ // required to fill the gap in ASCII between
+ // numerals and capital letters
+ 0b10, // :
+ 0b10, // ;
+ 0b10, // <
+ 0b10, // =
+ 0b10, // >
+ 0b1110011, // ?
+ 0b1101001, //@
+
+ 0b101, // A ASCII 65
+ 0b11110,
+ 0b11010,
+ 0b1110,
+ 0b11,
+ 0b11011,
+ 0b1100,
+ 0b11111,
+ 0b111,
+ 0b10001,
+ 0b1010,
+ 0b11101,
+ 0b100, //M
+ 0b110,
+ 0b1000,
+ 0b11001,
+ 0b10100,
+ 0b1101,
+ 0b1111,
+ 0b10,
+ 0b1011,
+ 0b10111,
+ 0b1001,
+ 0b10110,
+ 0b10010,
+ 0b11100, // Z
+
+ 0b101010, //Start, ASCII [
+ 0b1010111, // SK , ASCII '\'
+}; //}}}
+
struct cw_out_message_s {
// Contains a sequence of ones and zeros corresponding to
// TX on/TX off CW data to be sent
@@ -173,10 +236,9 @@ size_t cw_fill_buffer(int16_t *buf, size_t bufsize)
}
static int16_t cw_audio_buf[AUDIO_BUF_LEN];
+static struct cw_out_message_s cw_fill_msg_current;
static void cw_task(void *pvParameters)
{
- struct cw_out_message_s cw_fill_msg_current;
-
float nco_phase = 0.0f;
float ampl = 0.0f;