| 607 | } |
| 608 | |
| 609 | bool HwTools::writeLedPin(uint8_t color, uint8_t state) { |
| 610 | switch(color) { |
| 611 | case LED_INTERNAL: { |
| 612 | if(ledPin != 0xFF) { |
| 613 | digitalWrite(ledPin, state); |
| 614 | return true; |
| 615 | } else { |
| 616 | return false; |
| 617 | } |
| 618 | break; |
| 619 | } |
| 620 | case LED_RED: { |
| 621 | if(redPin != 0xFF) { |
| 622 | digitalWrite(redPin, state); |
| 623 | return true; |
| 624 | } else { |
| 625 | return false; |
| 626 | } |
| 627 | break; |
| 628 | } |
| 629 | case LED_GREEN: { |
| 630 | if(greenPin != 0xFF) { |
| 631 | digitalWrite(greenPin, state); |
| 632 | return true; |
| 633 | } else { |
| 634 | return false; |
| 635 | } |
| 636 | break; |
| 637 | } |
| 638 | case LED_BLUE: { |
| 639 | if(bluePin != 0xFF) { |
| 640 | digitalWrite(bluePin, state); |
| 641 | return true; |
| 642 | } else { |
| 643 | return false; |
| 644 | } |
| 645 | break; |
| 646 | } |
| 647 | case LED_YELLOW: { |
| 648 | if(redPin != 0xFF && greenPin != 0xFF) { |
| 649 | digitalWrite(redPin, state); |
| 650 | digitalWrite(greenPin, state); |
| 651 | return true; |
| 652 | } else { |
| 653 | return false; |
| 654 | } |
| 655 | break; |
| 656 | } |
| 657 | } |
| 658 | return false; |
| 659 | } |
| 660 | |
| 661 | bool HwTools::isVoltageOptimal(float range) { |
| 662 | if(boardType >= 1 && boardType <= 8 && maxVcc > 2.8) { // BUS-Power boards |
nothing calls this directly
no outgoing calls
no test coverage detected