0
1
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:
2025-03-25 13:26:32 +01:00
parent dfc29e2b55
commit ecbca33efe
4 changed files with 10 additions and 11 deletions

View File

@@ -1,5 +1,5 @@
{
"port": 13452,
"time": 1742842630343,
"time": 1742904021409,
"version": "0.0.3"
}

View File

@@ -18,25 +18,25 @@ typedef struct {
static void handle_ptyn(char *arg, RDSModulator* mod, char* output) {
arg[PTYN_LENGTH] = 0;
set_rds_ptyn(mod->enc, xlat(arg));
set_rds_ptyn(mod->enc, convert_to_rds_charset(arg));
strcpy(output, "+\0");
}
static void handle_tps(char *arg, RDSModulator* mod, char* output) {
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");
}
static void handle_rt1(char *arg, RDSModulator* mod, char* output) {
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");
}
static void handle_rt2(char *arg, RDSModulator* mod, char* output) {
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");
}
@@ -69,7 +69,7 @@ static void handle_lps(char *arg, RDSModulator* mod, char* output) {
static void handle_ps(char *arg, RDSModulator* mod, char* output) {
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");
}

View File

@@ -86,12 +86,11 @@ uint8_t add_rds_af(RDSAFs *af_list, float freq) {
return 0;
}
#define XLATSTRLEN 255
char *xlat(char *str) {
static char new_str[XLATSTRLEN];
char *convert_to_rds_charset(char *str) {
static char new_str[255];
uint8_t i = 0;
while (*str != 0 && i < XLATSTRLEN) {
while (*str != 0 && i < 255) {
switch (*str) {
case 0xc2:
str++;

View File

@@ -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 uint8_t add_rds_af(RDSAFs *af_list, float freq);
extern char *xlat(char *str);
extern char *convert_to_rds_charset(char *str);