mirror of
https://github.com/radio95-rnt/rds95.git
synced 2026-02-26 20:33:53 +01:00
source code formatting
This commit is contained in:
2
.vscode/.server-controller-port.log
vendored
2
.vscode/.server-controller-port.log
vendored
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"port": 13452,
|
"port": 13452,
|
||||||
"time": 1742842630343,
|
"time": 1742904021409,
|
||||||
"version": "0.0.3"
|
"version": "0.0.3"
|
||||||
}
|
}
|
||||||
@@ -18,25 +18,25 @@ typedef struct {
|
|||||||
|
|
||||||
static void handle_ptyn(char *arg, RDSModulator* mod, char* output) {
|
static void handle_ptyn(char *arg, RDSModulator* mod, char* output) {
|
||||||
arg[PTYN_LENGTH] = 0;
|
arg[PTYN_LENGTH] = 0;
|
||||||
set_rds_ptyn(mod->enc, xlat(arg));
|
set_rds_ptyn(mod->enc, convert_to_rds_charset(arg));
|
||||||
strcpy(output, "+\0");
|
strcpy(output, "+\0");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void handle_tps(char *arg, RDSModulator* mod, char* output) {
|
static void handle_tps(char *arg, RDSModulator* mod, char* output) {
|
||||||
arg[PS_LENGTH * 2] = 0;
|
arg[PS_LENGTH * 2] = 0;
|
||||||
set_rds_tps(mod->enc, xlat(arg));
|
set_rds_tps(mod->enc, convert_to_rds_charset(arg));
|
||||||
strcpy(output, "+\0");
|
strcpy(output, "+\0");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void handle_rt1(char *arg, RDSModulator* mod, char* output) {
|
static void handle_rt1(char *arg, RDSModulator* mod, char* output) {
|
||||||
arg[RT_LENGTH * 2] = 0;
|
arg[RT_LENGTH * 2] = 0;
|
||||||
set_rds_rt1(mod->enc, xlat(arg));
|
set_rds_rt1(mod->enc, convert_to_rds_charset(arg));
|
||||||
strcpy(output, "+\0");
|
strcpy(output, "+\0");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void handle_rt2(char *arg, RDSModulator* mod, char* output) {
|
static void handle_rt2(char *arg, RDSModulator* mod, char* output) {
|
||||||
arg[RT_LENGTH * 2] = 0;
|
arg[RT_LENGTH * 2] = 0;
|
||||||
set_rds_rt2(mod->enc, xlat(arg));
|
set_rds_rt2(mod->enc, convert_to_rds_charset(arg));
|
||||||
strcpy(output, "+\0");
|
strcpy(output, "+\0");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,7 +69,7 @@ static void handle_lps(char *arg, RDSModulator* mod, char* output) {
|
|||||||
|
|
||||||
static void handle_ps(char *arg, RDSModulator* mod, char* output) {
|
static void handle_ps(char *arg, RDSModulator* mod, char* output) {
|
||||||
arg[PS_LENGTH * 2] = 0;
|
arg[PS_LENGTH * 2] = 0;
|
||||||
set_rds_ps(mod->enc, xlat(arg));
|
set_rds_ps(mod->enc, convert_to_rds_charset(arg));
|
||||||
strcpy(output, "+\0");
|
strcpy(output, "+\0");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -86,12 +86,11 @@ uint8_t add_rds_af(RDSAFs *af_list, float freq) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define XLATSTRLEN 255
|
char *convert_to_rds_charset(char *str) {
|
||||||
char *xlat(char *str) {
|
static char new_str[255];
|
||||||
static char new_str[XLATSTRLEN];
|
|
||||||
uint8_t i = 0;
|
uint8_t i = 0;
|
||||||
|
|
||||||
while (*str != 0 && i < XLATSTRLEN) {
|
while (*str != 0 && i < 255) {
|
||||||
switch (*str) {
|
switch (*str) {
|
||||||
case 0xc2:
|
case 0xc2:
|
||||||
str++;
|
str++;
|
||||||
|
|||||||
@@ -4,4 +4,4 @@ extern int _strnlen(const char *s, int maxlen);
|
|||||||
|
|
||||||
extern void add_checkwords(uint16_t *blocks, uint8_t *bits, uint8_t stream);
|
extern void add_checkwords(uint16_t *blocks, uint8_t *bits, uint8_t stream);
|
||||||
extern uint8_t add_rds_af(RDSAFs *af_list, float freq);
|
extern uint8_t add_rds_af(RDSAFs *af_list, float freq);
|
||||||
extern char *xlat(char *str);
|
extern char *convert_to_rds_charset(char *str);
|
||||||
Reference in New Issue
Block a user