diff --git a/src/pifmrds/pi_fm_rds.cpp b/src/pifmrds/pi_fm_rds.cpp index 40e5997..6995266 100644 --- a/src/pifmrds/pi_fm_rds.cpp +++ b/src/pifmrds/pi_fm_rds.cpp @@ -200,15 +200,15 @@ int tx(uint32_t carrier_freq, char *audio_file, uint16_t pi, char *ps, char *rt, if(pollResult.res == CONTROL_PIPE_PS_SET) { varying_ps = 0; } else if(pollResult.res == CONTROL_PIPE_RDS_SET) { - drds = (int)pollResult.arg; + drds = std::stoi(pollResult.arg); } else if(pollResult.res == CONTROL_PIPE_PWR_SET) { - pad_reg[GPIO_PAD_0_27] = 0x5a000018 + (int)pollResult.arg; - pad_reg[GPIO_PAD_28_45] = 0x5a000018 + (int)pollResult.arg; + pad_reg[GPIO_PAD_0_27] = 0x5a000018 + std::stoi(pollResult.arg); + pad_reg[GPIO_PAD_28_45] = 0x5a000018 + std::stoi(pollResult.arg); } else if(pollResult.res == CONTROL_PIPE_DEVIATION_SET) { deviation = atoi(pollResult.arg); deviation_scale_factor= 0.1 * (deviation ); } else if(pollResult.res == CONTROL_PIPE_STEREO_SET) { - disablestereo = (int)pollResult.arg; + disablestereo = std::stoi(pollResult.arg); } else if(pollResult.res == CONTROL_PIPE_GAIN_SET) { gaim = std::stof(pollResult.arg); } else if(pollResult.res == CONTROL_PIPE_COMPRESSORDECAY_SET) { @@ -216,7 +216,7 @@ int tx(uint32_t carrier_freq, char *audio_file, uint16_t pi, char *ps, char *rt, } else if(pollResult.res == CONTROL_PIPE_COMPRESSORATTACK_SET) { compressor_attack = std::stof(pollResult.arg); } else if(pollResult.res == CONTROL_PIPE_CT_SET) { - rds_ct_enabled = (int)pollResult.arg; + rds_ct_enabled = std::stoi(pollResult.arg); } else if(pollResult.res == CONTROL_PIPE_RDSVOL_SET) { rds_volume = std::stof(pollResult.arg); }