22 lines
549 B
C++
22 lines
549 B
C++
#include <cstdio>
|
|
#include "utils.h"
|
|
void print_morse_table (const TABLE<unsigned char, 64> & tab) {
|
|
int n = 0;
|
|
printf("static const unsigned char compressed_table [] = {");
|
|
for (auto & e: tab) {
|
|
if ((n % 16) == 0) printf("\n");
|
|
printf("0x%02x,", e);
|
|
n++;
|
|
}
|
|
printf("\n};\n");
|
|
}
|
|
void print_sinus_table (const TABLE<unsigned short, 256> & tab) {
|
|
int n = 0;
|
|
printf("static const uint16_t sin_tab [] = {");
|
|
for (auto & e: tab) {
|
|
if ((n % 16) == 0) printf("\n");
|
|
printf("%5du,", e);
|
|
n++;
|
|
}
|
|
printf("\n};\n");
|
|
}
|