diff --git a/csdr.c b/csdr.c
index 52de1ab..6a0c42a 100644
--- a/csdr.c
+++ b/csdr.c
@@ -163,6 +163,8 @@ int clone_(int bufsize_param)
}
}
+#define FREAD_U8 fread (input_buffer, sizeof(unsigned char), the_bufsize, stdin)
+#define FWRITE_U8 fwrite (output_buffer, sizeof(unsigned char), the_bufsize, stdout)
#define FREAD_R fread (input_buffer, sizeof(float), the_bufsize, stdin)
#define FREAD_C fread (input_buffer, sizeof(float)*2, the_bufsize, stdin)
#define FWRITE_R fwrite (output_buffer, sizeof(float), the_bufsize, stdout)
@@ -352,7 +354,7 @@ int main(int argc, char *argv[])
char** fifo_buffers = (char**)malloc(sizeof(char*)*fifo_num_buffers);
for(int i=0;i
+ { .code = 0b1010101111, .bitcount=10, .ascii=0x3f }, //?
+ { .code = 0b1010111101, .bitcount=10, .ascii=0x40 }, //@
+ { .code = 0b1111101, .bitcount=7, .ascii=0x41 }, //A
+ { .code = 0b11101011, .bitcount=8, .ascii=0x42 }, //B
+ { .code = 0b10101101, .bitcount=8, .ascii=0x43 }, //C
+ { .code = 0b10110101, .bitcount=8, .ascii=0x44 }, //D
+ { .code = 0b1110111, .bitcount=7, .ascii=0x45 }, //E
+ { .code = 0b11011011, .bitcount=8, .ascii=0x46 }, //F
+ { .code = 0b11111101, .bitcount=8, .ascii=0x47 }, //G
+ { .code = 0b101010101, .bitcount=9, .ascii=0x48 }, //H
+ { .code = 0b1111111, .bitcount=7, .ascii=0x49 }, //I
+ { .code = 0b111111101, .bitcount=9, .ascii=0x4a }, //J
+ { .code = 0b101111101, .bitcount=9, .ascii=0x4b }, //K
+ { .code = 0b11010111, .bitcount=8, .ascii=0x4c }, //L
+ { .code = 0b10111011, .bitcount=8, .ascii=0x4d }, //M
+ { .code = 0b11011101, .bitcount=8, .ascii=0x4e }, //N
+ { .code = 0b10101011, .bitcount=8, .ascii=0x4f }, //O
+ { .code = 0b11010101, .bitcount=8, .ascii=0x50 }, //P
+ { .code = 0b111011101, .bitcount=9, .ascii=0x51 }, //Q
+ { .code = 0b10101111, .bitcount=8, .ascii=0x52 }, //R
+ { .code = 0b1101111, .bitcount=7, .ascii=0x53 }, //S
+ { .code = 0b1101101, .bitcount=7, .ascii=0x54 }, //T
+ { .code = 0b101010111, .bitcount=9, .ascii=0x55 }, //U
+ { .code = 0b110110101, .bitcount=9, .ascii=0x56 }, //V
+ { .code = 0b101011101, .bitcount=9, .ascii=0x57 }, //W
+ { .code = 0b101110101, .bitcount=9, .ascii=0x58 }, //X
+ { .code = 0b101111011, .bitcount=9, .ascii=0x59 }, //Y
+ { .code = 0b1010101101, .bitcount=10, .ascii=0x5a }, //Z
+ { .code = 0b111110111, .bitcount=9, .ascii=0x5b }, //[
+ { .code = 0b111101111, .bitcount=9, .ascii=0x5c }, //\
+ { .code = 0b111111011, .bitcount=9, .ascii=0x5d }, //]
+ { .code = 0b1010111111, .bitcount=10, .ascii=0x5e }, //^
+ { .code = 0b101101101, .bitcount=9, .ascii=0x5f }, //_
+ { .code = 0b1011011111, .bitcount=10, .ascii=0x60 }, //`
+ { .code = 0b1011, .bitcount=4, .ascii=0x61 }, //a
+ { .code = 0b1011111, .bitcount=7, .ascii=0x62 }, //b
+ { .code = 0b101111, .bitcount=6, .ascii=0x63 }, //c
+ { .code = 0b101101, .bitcount=6, .ascii=0x64 }, //d
+ { .code = 0b11, .bitcount=2, .ascii=0x65 }, //e
+ { .code = 0b111101, .bitcount=6, .ascii=0x66 }, //f
+ { .code = 0b1011011, .bitcount=7, .ascii=0x67 }, //g
+ { .code = 0b101011, .bitcount=6, .ascii=0x68 }, //h
+ { .code = 0b1101, .bitcount=4, .ascii=0x69 }, //i
+ { .code = 0b111101011, .bitcount=9, .ascii=0x6a }, //j
+ { .code = 0b10111111, .bitcount=8, .ascii=0x6b }, //k
+ { .code = 0b11011, .bitcount=5, .ascii=0x6c }, //l
+ { .code = 0b111011, .bitcount=6, .ascii=0x6d }, //m
+ { .code = 0b1111, .bitcount=4, .ascii=0x6e }, //n
+ { .code = 0b111, .bitcount=3, .ascii=0x6f }, //o
+ { .code = 0b111111, .bitcount=6, .ascii=0x70 }, //p
+ { .code = 0b110111111, .bitcount=9, .ascii=0x71 }, //q
+ { .code = 0b10101, .bitcount=5, .ascii=0x72 }, //r
+ { .code = 0b10111, .bitcount=5, .ascii=0x73 }, //s
+ { .code = 0b101, .bitcount=3, .ascii=0x74 }, //t
+ { .code = 0b110111, .bitcount=6, .ascii=0x75 }, //u
+ { .code = 0b1111011, .bitcount=7, .ascii=0x76 }, //v
+ { .code = 0b1101011, .bitcount=7, .ascii=0x77 }, //w
+ { .code = 0b11011111, .bitcount=8, .ascii=0x78 }, //x
+ { .code = 0b1011101, .bitcount=7, .ascii=0x79 }, //y
+ { .code = 0b111010101, .bitcount=9, .ascii=0x7a }, //z
+ { .code = 0b1010110111, .bitcount=10, .ascii=0x7b }, //{
+ { .code = 0b110111011, .bitcount=9, .ascii=0x7c }, //|
+ { .code = 0b1010110101, .bitcount=10, .ascii=0x7d }, //}
+ { .code = 0b1011010111, .bitcount=10, .ascii=0x7e }, //~
+ { .code = 0b1110110101, .bitcount=10, .ascii=0x7f }, //DEL
+};
+
+const int n_psk31_varicode_items = sizeof(psk31_varicode_items) / sizeof(psk31_varicode_item_t);
+
+unsigned long long psk31_varicode_masklen_helper[] =
+{
+ 0b0000000000000000000000000000000000000000000000000000000000000000,
+ 0b0000000000000000000000000000000000000000000000000000000000000001,
+ 0b0000000000000000000000000000000000000000000000000000000000000011,
+ 0b0000000000000000000000000000000000000000000000000000000000000111,
+ 0b0000000000000000000000000000000000000000000000000000000000001111,
+ 0b0000000000000000000000000000000000000000000000000000000000011111,
+ 0b0000000000000000000000000000000000000000000000000000000000111111,
+ 0b0000000000000000000000000000000000000000000000000000000001111111,
+ 0b0000000000000000000000000000000000000000000000000000000011111111,
+ 0b0000000000000000000000000000000000000000000000000000000111111111,
+ 0b0000000000000000000000000000000000000000000000000000001111111111,
+ 0b0000000000000000000000000000000000000000000000000000011111111111,
+ 0b0000000000000000000000000000000000000000000000000000111111111111,
+ 0b0000000000000000000000000000000000000000000000000001111111111111,
+ 0b0000000000000000000000000000000000000000000000000011111111111111,
+ 0b0000000000000000000000000000000000000000000000000111111111111111,
+ 0b0000000000000000000000000000000000000000000000001111111111111111,
+ 0b0000000000000000000000000000000000000000000000011111111111111111,
+ 0b0000000000000000000000000000000000000000000000111111111111111111,
+ 0b0000000000000000000000000000000000000000000001111111111111111111,
+ 0b0000000000000000000000000000000000000000000011111111111111111111,
+ 0b0000000000000000000000000000000000000000000111111111111111111111,
+ 0b0000000000000000000000000000000000000000001111111111111111111111,
+ 0b0000000000000000000000000000000000000000011111111111111111111111,
+ 0b0000000000000000000000000000000000000000111111111111111111111111,
+ 0b0000000000000000000000000000000000000001111111111111111111111111,
+ 0b0000000000000000000000000000000000000011111111111111111111111111,
+ 0b0000000000000000000000000000000000000111111111111111111111111111,
+ 0b0000000000000000000000000000000000001111111111111111111111111111,
+ 0b0000000000000000000000000000000000011111111111111111111111111111,
+ 0b0000000000000000000000000000000000111111111111111111111111111111,
+ 0b0000000000000000000000000000000001111111111111111111111111111111,
+ 0b0000000000000000000000000000000011111111111111111111111111111111,
+ 0b0000000000000000000000000000000111111111111111111111111111111111,
+ 0b0000000000000000000000000000001111111111111111111111111111111111,
+ 0b0000000000000000000000000000011111111111111111111111111111111111,
+ 0b0000000000000000000000000000111111111111111111111111111111111111,
+ 0b0000000000000000000000000001111111111111111111111111111111111111,
+ 0b0000000000000000000000000011111111111111111111111111111111111111,
+ 0b0000000000000000000000000111111111111111111111111111111111111111,
+ 0b0000000000000000000000001111111111111111111111111111111111111111,
+ 0b0000000000000000000000011111111111111111111111111111111111111111,
+ 0b0000000000000000000000111111111111111111111111111111111111111111,
+ 0b0000000000000000000001111111111111111111111111111111111111111111,
+ 0b0000000000000000000011111111111111111111111111111111111111111111,
+ 0b0000000000000000000111111111111111111111111111111111111111111111,
+ 0b0000000000000000001111111111111111111111111111111111111111111111,
+ 0b0000000000000000011111111111111111111111111111111111111111111111,
+ 0b0000000000000000111111111111111111111111111111111111111111111111,
+ 0b0000000000000001111111111111111111111111111111111111111111111111,
+ 0b0000000000000011111111111111111111111111111111111111111111111111,
+ 0b0000000000000111111111111111111111111111111111111111111111111111,
+ 0b0000000000001111111111111111111111111111111111111111111111111111,
+ 0b0000000000011111111111111111111111111111111111111111111111111111,
+ 0b0000000000111111111111111111111111111111111111111111111111111111,
+ 0b0000000001111111111111111111111111111111111111111111111111111111,
+ 0b0000000011111111111111111111111111111111111111111111111111111111,
+ 0b0000000111111111111111111111111111111111111111111111111111111111,
+ 0b0000001111111111111111111111111111111111111111111111111111111111,
+ 0b0000011111111111111111111111111111111111111111111111111111111111,
+ 0b0000111111111111111111111111111111111111111111111111111111111111,
+ 0b0001111111111111111111111111111111111111111111111111111111111111,
+ 0b0011111111111111111111111111111111111111111111111111111111111111,
+ 0b0111111111111111111111111111111111111111111111111111111111111111
+};
+
+char psk31_varicode_push(unsigned long long* status_shr, unsigned char symbol)
+{
+ *status_shr=((*status_shr)<<1)|(!!symbol); //shift new bit in shift register
+ //fprintf(stderr,"*status_shr = %llx\n", *status_shr);
+ if((*status_shr)&0xFFF==0) return 0;
+ for(int i=0;i>>>>>>>> %d %x %c\n", i, psk31_varicode_items[i].ascii, psk31_varicode_items[i].ascii);*/ return psk31_varicode_items[i].ascii; }
+
+ }
+ return 0;
+}
+
+
+
+/*
+
+*/
+
+
+
+
+
/*
_____ _ _
| __ \ | | (_)
diff --git a/libcsdr.h b/libcsdr.h
index 8bcbc2a..419c064 100644
--- a/libcsdr.h
+++ b/libcsdr.h
@@ -178,3 +178,5 @@ void convert_f_i16(float* input, short* output, int input_size);
void convert_i16_f(short* input, float* output, int input_size);
int is_nan(float f);
+
+char psk31_varicode_push(unsigned long long* status_shr, unsigned char symbol);