decreases dialtone volume to be reasonable

This commit is contained in:
Brendan Haines 2016-11-01 22:25:46 -06:00
parent 6dbe51952d
commit 8e4ea9618c

View File

@ -123,6 +123,10 @@ void beginCall() {
#endif #endif
} }
void resumeDialtone() {
fona.sendCheckReply( F("AT+STTONE=1,20,500" ), F("OK") ); // Start dialtone
}
////////////////////////////////// //////////////////////////////////
///// ARDUINO CORE FUNCTIONS ///// ///// ARDUINO CORE FUNCTIONS /////
////////////////////////////////// //////////////////////////////////
@ -156,6 +160,8 @@ void setup() {
#endif #endif
startDialtone = true; startDialtone = true;
lastActiveTime = millis(); lastActiveTime = millis();
fona.sendCheckReply( F("AT+CLVL=20"), F("OK") ); // set dialtone volume
} }
void loop() { void loop() {
@ -169,7 +175,7 @@ void loop() {
} }
if ( startDialtone ) { if ( startDialtone ) {
fona.sendCheckReply( F("AT+STTONE=1,20,500" ), F("OK") ); // Start tone resumeDialtone();
startDialtone = false; startDialtone = false;
} }
@ -178,7 +184,9 @@ void loop() {
if ( key != NO_KEY ) { if ( key != NO_KEY ) {
phoneNumber[ phoneNumberLength ] = key; phoneNumber[ phoneNumberLength ] = key;
phoneNumberLength = phoneNumberLength + 1; phoneNumberLength = phoneNumberLength + 1;
fona.playDTMF( key ); // Play DTMF tone fona.playDTMF( key ); // Play DTMF tone
lastActiveTime = millis(); lastActiveTime = millis();
#ifdef USB_DEBUG #ifdef USB_DEBUG
int i; int i;
@ -194,6 +202,7 @@ void loop() {
} }
} }
// Clear stored phone number on press of end button // Clear stored phone number on press of end button
if ( !digitalRead(BUT_END) ) { if ( !digitalRead(BUT_END) ) {
for ( int j = 0; j < phoneNumberLength; j++) { for ( int j = 0; j < phoneNumberLength; j++) {
@ -203,6 +212,7 @@ void loop() {
#ifdef USB_DEBUG #ifdef USB_DEBUG
Serial.println( phoneNumberLength ); Serial.println( phoneNumberLength );
#endif #endif
resumeDialtone();
} }
#ifdef SLEEP #ifdef SLEEP