0
1
mirror of https://github.com/radio95-rnt/rds95.git synced 2026-02-26 20:33:53 +01:00

fix the saving

This commit is contained in:
2025-03-15 09:04:19 +01:00
parent 07641507ae
commit 021cf9537d

View File

@@ -365,7 +365,7 @@ static bool process_command_table(const command_handler_t *table, int table_size
void process_ascii_cmd(RDSModulator* enc, unsigned char *str) {
unsigned char *cmd, *arg;
uint16_t cmd_len = _strnlen((const char*)str, CTL_BUFFER_SIZE);
uint8_t to_save;
uint8_t to_save, cmd_reached = 0;
if (str[0] == '*') {
to_save = 1;
@@ -376,87 +376,87 @@ void process_ascii_cmd(RDSModulator* enc, unsigned char *str) {
cmd = str;
cmd[1] = 0;
arg = str + 2;
cmd_reached = 1;
if (process_command_table(commands_eq2,
sizeof(commands_eq2) / sizeof(command_handler_t),
cmd, arg, enc)) {
return;
}
}
// Process commands with = delimiter at position 3 (format: XX=y...)
if (cmd_len > 2 && str[2] == '=') {
if (cmd_len > 2 && str[2] == '=' && !cmd_reached) {
cmd = str;
cmd[2] = 0;
arg = str + 3;
cmd_reached = 1;
if (process_command_table(commands_eq3,
sizeof(commands_eq3) / sizeof(command_handler_t),
cmd, arg, enc)) {
return;
}
}
// Process commands with = delimiter at position 4 (format: XXX=y...)
if (cmd_len > 3 && str[3] == '=') {
if (cmd_len > 3 && str[3] == '=' && !cmd_reached) {
cmd = str;
cmd[3] = 0;
arg = str + 4;
cmd_reached = 1;
if (process_command_table(commands_eq4,
sizeof(commands_eq4) / sizeof(command_handler_t),
cmd, arg, enc)) {
return;
}
}
// Process commands with = delimiter at position 5 (format: XXXX=y...)
if (cmd_len > 4 && str[4] == '=') {
if (cmd_len > 4 && str[4] == '=' && !cmd_reached) {
cmd = str;
cmd[4] = 0;
arg = str + 5;
cmd_reached = 1;
if (process_command_table(commands_eq5,
sizeof(commands_eq5) / sizeof(command_handler_t),
cmd, arg, enc)) {
return;
}
}
// Process commands with = delimiter at position 6 (format: XXXXX=y...)
if (cmd_len > 5 && str[5] == '=') {
if (cmd_len > 5 && str[5] == '=' && !cmd_reached) {
cmd = str;
cmd[5] = 0;
arg = str + 6;
cmd_reached = 1;
if (process_command_table(commands_eq6,
sizeof(commands_eq6) / sizeof(command_handler_t),
cmd, arg, enc)) {
return;
}
}
if (cmd_len > 6 && str[6] == '=') {
if (cmd_len > 6 && str[6] == '=' && !cmd_reached) {
cmd = str;
cmd[6] = 0;
arg = str + 7;
cmd_reached = 1;
if (process_command_table(commands_eq7,
sizeof(commands_eq7) / sizeof(command_handler_t),
cmd, arg, enc)) {
return;
}
}
if (cmd_len > 7 && str[7] == '=') {
if (cmd_len > 7 && str[7] == '=' && !cmd_reached) {
cmd = str;
cmd[7] = 0;
arg = str + 8;
cmd_reached = 1;
if (process_command_table(commands_eq8,
sizeof(commands_eq8) / sizeof(command_handler_t),
cmd, arg, enc)) {
return;
}
}