runtime :)

This commit is contained in:
Kuba 2023-10-30 19:43:54 +00:00
parent 15436369c4
commit cf7565472e
3 changed files with 9 additions and 0 deletions

View File

@ -139,6 +139,12 @@ ResultAndArg poll_control_pipe() {
set_rds_rt(arg); set_rds_rt(arg);
printf("RT B set to: \"%s\"\n", arg); printf("RT B set to: \"%s\"\n", arg);
resarg.res = CONTROL_PIPE_RT_SET; resarg.res = CONTROL_PIPE_RT_SET;
} else if(fifo[0] == 'R' && fifo[1] == 'D' && fifo[2] == 'S') {
int rds = ( strcmp(arg, "ON") == 1 );
printf("Set RDS to ");
if(rds) printf("ON\n"); else printf("OFF\n");
resarg.res = CONTROL_PIPE_RDS_SET;
resarg.arg = rds;
} }
} }
return resarg; return resarg;

View File

@ -14,6 +14,7 @@
#define CONTROL_PIPE_AB_SET 7 #define CONTROL_PIPE_AB_SET 7
#define CONTROL_PIPE_PI_SET 8 #define CONTROL_PIPE_PI_SET 8
#define CONTROL_PIPE_PWR_SET 9 #define CONTROL_PIPE_PWR_SET 9
#define CONTROL_PIPE_RDS_SET 10
typedef struct { typedef struct {
int res; int res;

View File

@ -187,6 +187,8 @@ int tx(uint32_t carrier_freq, char *audio_file, uint16_t pi, char *ps, char *rt,
ResultAndArg pollResult = poll_control_pipe(); ResultAndArg pollResult = poll_control_pipe();
if(pollResult.res == CONTROL_PIPE_PS_SET) { if(pollResult.res == CONTROL_PIPE_PS_SET) {
varying_ps = 0; varying_ps = 0;
} else if(pollResult.res == CONTROL_PIPE_RDS_SET) {
drds = pollResult.arg;
} }
} }