diff --git a/src/HamShield.cpp b/src/HamShield.cpp index cb06864..a1e9049 100644 --- a/src/HamShield.cpp +++ b/src/HamShield.cpp @@ -681,25 +681,24 @@ uint16_t HamShield::getPABiasVoltage(){ // Subaudio settings -// recommended function for placing CTCSS tone on channel -- schedule remainder for deprecation - +// recommended function for placing CTCSS tone on channel // ctcss freq encoder void HamShield::setCtcssEncoder(float freq) { - int dfreq = freq * 100; // Convert float into whole number (ctcss freq * 100) - setCtcssFreq(dfreq); // program CTCSS frequency buffer - HSwriteBitW(devAddr, A1846S_CTCSS_FREQ_PRG, 10, 1); // program CTCSS frequency buffer into CTCSS encoder (step 1) - HSwriteBitW(devAddr, A1846S_CTCSS_FREQ_PRG, 9, 1); // program CTCSS frequency buffer into CTCSS encoder (step 2) + int dfreq = freq * 100; // Convert float into whole number (ctcss freq * 100) + setCtcssFreq(dfreq); // program CTCSS frequency buffer + HSwriteBitW(devAddr, A1846S_CTCSS_FREQ_PRG, 10, 1); // program CTCSS frequency buffer into CTCSS encoder (step 1) + HSwriteBitW(devAddr, A1846S_CTCSS_FREQ_PRG, 9, 1); // program CTCSS frequency buffer into CTCSS encoder (step 2) } // recommended function for detecting (and requiring) CTCSS to be on channel before audio is unmuted -- schedule remainder for deprecation // ctcss freq decoder void HamShield::setCtcssDecoder(float freq) { - int dfreq = freq * 100; // Convert float into whole number (ctcss freq * 100) - setCtcssFreq(dfreq); // program CTCSS frequency buffer - HSwriteBitW(devAddr, A1846S_CTCSS_FREQ_PRG, 10, 1); // program CTCSS frequency buffer into CTCSS encoder (step 1) - HSwriteBitW(devAddr, A1846S_CTCSS_FREQ_PRG, 9, 1); // program CTCSS frequency buffer into CTCSS encoder (step 2) + int dfreq = freq * 100; // Convert float into whole number (ctcss freq * 100) + setCtcssFreq(dfreq); // program CTCSS frequency buffer + HSwriteBitW(devAddr, A1846S_CTCSS_FREQ_PRG, 10, 1); // program CTCSS frequency buffer into CTCSS encoder (step 1) + HSwriteBitW(devAddr, A1846S_CTCSS_FREQ_PRG, 9, 1); // program CTCSS frequency buffer into CTCSS encoder (step 2) } diff --git a/src/HamShield.h b/src/HamShield.h index 6145e66..0b1766f 100644 --- a/src/HamShield.h +++ b/src/HamShield.h @@ -91,7 +91,7 @@ //#define A1846S_BAND_SEL_BIT 7 // band_sel<1:0> //#define A1846S_BAND_SEL_LENGTH 2 -// Bitfields for RDA1864_GPIO_MODE_REG +// Bitfields for A1846_GPIO_MODE_REG #define RDA1864_GPIO7_MODE_BIT 15 // <1:0> 00=hi-z,01=vox,10=low,11=hi #define RDA1864_GPIO7_MODE_LENGTH 2 #define RDA1864_GPIO6_MODE_BIT 13 // <1:0> 00=hi-z,01=sq or =sq&ctcss/cdcss when sq_out_sel=1,10=low,11=hi @@ -283,11 +283,11 @@ class HamShield { // Subaudio settings - // Recommended user function for setting and receiving CTCSS does + // Recommended user function for setting and receiving CTCSS does // TODO: set others to private and/or deprecate - void setCtcssEncoder(float freq); // generate sub audio tone on channel when transmitting - void setCtcssDecoder(float freq); // unmute audio on tone present when receiving channel + void setCtcssEncoder(float freq); // generate sub audio tone on channel when transmitting + void setCtcssDecoder(float freq); // unmute audio on tone present when receiving channel