* Just switch the IR sending LED off to send an IR space * A space is "no output", so the PWM output is disabled. * This function may affect the state of feedback LED. */
| 1414 | * This function may affect the state of feedback LED. |
| 1415 | */ |
| 1416 | void IRsend::IRLedOff() { |
| 1417 | #if defined(SEND_PWM_BY_TIMER) |
| 1418 | disableSendPWMByTimer(); // Disable PWM output |
| 1419 | #elif defined(USE_NO_SEND_PWM) |
| 1420 | # if defined(USE_OPEN_DRAIN_OUTPUT_FOR_SEND_PIN) && !defined(OUTPUT_OPEN_DRAIN) |
| 1421 | digitalWriteFast(sendPin, LOW); // prepare for all next active states. |
| 1422 | pinModeFast(sendPin, INPUT);// inactive state for open drain |
| 1423 | # elif defined(USE_ACTIVE_HIGH_OUTPUT_FOR_NO_SEND_PWM) || defined(USE_ACTIVE_HIGH_OUTPUT_FOR_SEND_PIN) // USE_ACTIVE_HIGH_OUTPUT_FOR_SEND_PIN is old and deprecated |
| 1424 | digitalWriteFast(sendPin, LOW); // Set output to inactive low. |
| 1425 | # else |
| 1426 | digitalWriteFast(sendPin, HIGH); // Set output to inactive high. |
| 1427 | # endif |
| 1428 | #else |
| 1429 | # if defined(USE_OPEN_DRAIN_OUTPUT_FOR_SEND_PIN) || defined(USE_ACTIVE_LOW_OUTPUT_FOR_SEND_PIN) |
| 1430 | # if defined(USE_ACTIVE_LOW_OUTPUT_FOR_SEND_PIN) || defined(OUTPUT_OPEN_DRAIN) |
| 1431 | if (__builtin_constant_p(sendPin)) { |
| 1432 | digitalWriteFast(sendPin, HIGH); // set output to inactive high. |
| 1433 | } else { |
| 1434 | digitalWrite(sendPin, HIGH); |
| 1435 | } |
| 1436 | # else |
| 1437 | pinModeFast(sendPin, INPUT); // inactive state to mimic open drain |
| 1438 | # endif |
| 1439 | # else |
| 1440 | if (__builtin_constant_p(sendPin)) { |
| 1441 | digitalWriteFast(sendPin, LOW); // set output to active low. |
| 1442 | } else { |
| 1443 | digitalWrite(sendPin, LOW); |
| 1444 | } |
| 1445 | # endif |
| 1446 | #endif |
| 1447 | |
| 1448 | #if defined(LED_SEND_FEEDBACK_CODE) |
| 1449 | setFeedbackLED(false); |
| 1450 | #endif |
| 1451 | } |
| 1452 | |
| 1453 | /** |
| 1454 | * Sends an IR space for the specified number of microseconds. |
nothing calls this directly
no test coverage detected