allows incoming call to not be answered

This commit is contained in:
Brendan Haines 2016-12-02 23:14:52 -07:00
parent 0c703101a3
commit dff7c4745f

View File

@ -132,11 +132,16 @@ void loop() {
// Handle Incoming Call
if ( !digitalRead(GSM_RING) ) {
while ( digitalRead(BUT_ANS) & !digitalRead(GSM_RING) ) delay(10); // Wait for answer button or end ring/call
while ( digitalRead(BUT_ANS) & digitalRead(BUT_END) & !digitalRead(GSM_RING) ) delay(10); // Wait for answer button or end ring/call
if ( !digitalRead(BUT_ANS) ) {
fona.pickUp();
delay(100);
inCall();
} else if( !digitalRead(BUT_END) ) {
fona.hangUp();
clearPhoneNumber();
startDialtone = true;
delay(100);
}
}