@@ -106,8 +106,9 @@ OneButton menuButton(A10, true);
106
106
// / Setup a seek button
107
107
OneButton seekButton (A11, true );
108
108
109
- char rdsServiceName[10 ];
110
- char rdsText[64 + 2 ];
109
+ char rdsServiceName[8 + 2 ]; // /< String with the actual RDS Service name. Some senders put rotating text in here too.
110
+ char rdsText[64 + 2 ]; // /< String with the actual RDS text.
111
+ char rdsTime[6 ]; // /< String with the actual time from RDS as hh:mm.
111
112
112
113
// / The radio object has to be defined by using the class corresponding to the used chip.
113
114
// / by uncommenting the right (one only) radio object definition.
@@ -670,10 +671,8 @@ void loopWebServer(unsigned long now) {
670
671
} else if (webstate == PROCESS_POST) {
671
672
// get data posted by a html form
672
673
673
- // DEBUGVAR("uri", _httpURI);
674
674
int len;
675
675
len = _client.read ((uint8_t *)_readBuffer, BUFSIZ);
676
- // DEBUGVAR("len", len);
677
676
678
677
if ((len > 0 ) && (len < sizeof (_readBuffer))) {
679
678
_httpContentLen -= len;
@@ -777,7 +776,7 @@ void DisplayFrequency()
777
776
// / and will be stored for the web interface.
778
777
void DisplayServiceName (char *name)
779
778
{
780
- Serial. print (" RDS: " ); Serial. println ( name);
779
+ DEBUGVAR (" RDS" , name);
781
780
strncpy (rdsServiceName, name, sizeof (rdsServiceName));
782
781
783
782
if (rot_state == STATE_FREQ) {
@@ -792,20 +791,21 @@ void DisplayServiceName(char *name)
792
791
// / and will be stored for the web interface.
793
792
void DisplayText (char *text)
794
793
{
795
- Serial. print ( " TEXT: " ); Serial. println ( text);
794
+ DEBUGVAR ( " RDS-text " , text);
796
795
strncpy (rdsText, text, sizeof (rdsText));
797
796
} // DisplayText()
798
797
799
798
800
799
// / This function will be called by the RDS module when a rds time message was received.
801
800
// / The time will not displayed on the LCD but written to the serial port.
802
801
void DisplayTime (uint8_t hour, uint8_t minute) {
803
- Serial.print (" RDS-Time:" );
804
- if (hour < 10 ) Serial.print (' 0' );
805
- Serial.print (hour);
806
- Serial.print (' :' );
807
- if (minute < 10 ) Serial.print (' 0' );
808
- Serial.println (minute);
802
+ rdsTime[0 ] = ' 0' + (hour / 10 );
803
+ rdsTime[1 ] = ' 0' + (hour % 10 );
804
+ rdsTime[2 ] = ' :' ;
805
+ rdsTime[3 ] = ' 0' + (minute / 10 );
806
+ rdsTime[4 ] = ' 0' + (minute % 10 );
807
+ rdsTime[5 ] = NUL;
808
+ DEBUGVAR (" RDS-time" , rdsTime);
809
809
} // DisplayTime()
810
810
811
811
@@ -833,7 +833,7 @@ void DisplayMono(uint8_t v)
833
833
// / Display the current soft mute switch.
834
834
void DisplaySoftMute (uint8_t v)
835
835
{
836
- Serial. print ( " SMUTE: " ); Serial. println ( v);
836
+ DEBUGFUNC1 ( " DisplaySoftMute " , v);
837
837
lcd.setCursor (0 , 1 );
838
838
lcd.print (" SMUTE: " ); lcd.print (v);
839
839
} // DisplaySoftMute()
@@ -1087,7 +1087,6 @@ void loopSerial(unsigned long now) {
1087
1087
void runRadioSerialCommand (char cmd, int16_t value)
1088
1088
{
1089
1089
if (cmd == ' ?' ) {
1090
- Serial.println ();
1091
1090
Serial.println (" ? Help" );
1092
1091
Serial.println (" fnnnnn: direct frequency input (n: freq*100)" );
1093
1092
Serial.println (" vnn: direct volume input (n: 0...15)" );
@@ -1102,7 +1101,7 @@ void runRadioSerialCommand(char cmd, int16_t value)
1102
1101
Serial.println (" b bass boost" );
1103
1102
Serial.println (" m mute/unmute" );
1104
1103
Serial.println (" u soft mute/unmute" );
1105
- }
1104
+ } // runRadioSerialCommand()
1106
1105
1107
1106
// ----- control the volume and audio output -----
1108
1107
@@ -1151,22 +1150,14 @@ void runRadioSerialCommand(char cmd, int16_t value)
1151
1150
} else if (cmd == ' i' ) {
1152
1151
char s[12 ];
1153
1152
radio.formatFrequency (s, sizeof (s));
1154
- Serial. print (" Station: " ); Serial. println ( s);
1153
+ DEBUGVAR (" Station" , s);
1155
1154
Serial.print (" Radio:" ); radio.debugRadioInfo ();
1156
1155
Serial.print (" Audio:" ); radio.debugAudioInfo ();
1157
1156
1158
1157
RADIO_INFO ri;
1159
1158
radio.getRadioInfo (&ri);
1160
-
1161
-
1162
- // Serial.print(" RSSI: ");
1163
- // Serial.print(info.rssi);
1164
- //
1165
- // for (uint8_t i = 0; i < info.rssi - 15; i+=2) { Serial.write('*'); } // Empfangspegel ab 15. Zeichen
1166
- // Serial.println();
1167
- delay (3000 );
1168
-
1169
1159
} // info
1160
+
1170
1161
// else if (cmd == 'n') { radio.debugScan(); }
1171
1162
else if (cmd == ' x' ) { radio.debugStatus (); }
1172
1163
@@ -1187,7 +1178,6 @@ void loopButtons(unsigned long now) {
1187
1178
// check for the rotary encoder
1188
1179
newPos = encoder.getPosition ();
1189
1180
if (newPos != encoderLastPos) {
1190
- Serial.println (" B1" );
1191
1181
if (rot_state == STATE_FREQ) {
1192
1182
RADIO_FREQ f = radio.getMinFrequency () + (newPos * radio.getFrequencyStep ());
1193
1183
radio.setFrequency (f);
0 commit comments