Ticket #2135: diseqc-powerup-delay.patch
File diseqc-powerup-delay.patch, 1.8 KB (added by , 19 years ago) |
---|
-
libs/libmythtv/diseqc.cpp
29 29 // DiSEqC sleep intervals per eutelsat spec 30 30 #define DISEQC_SHORT_WAIT (15 * 1000) 31 31 #define DISEQC_LONG_WAIT (100 * 1000) 32 #define DISEQC_POWER_OFF_WAIT (1000 * 1000) 33 #define DISEQC_POWER_ON_WAIT (500 * 1000) 32 34 33 35 // Number of times to retry ioctls after receiving ETIMEDOUT before giving up 34 36 #define TIMEOUT_RETRIES 10 … … 641 643 { 642 644 Reset(); 643 645 644 VERBOSE(VB_CHANNEL, LOC + "Resetting DiSEqC Bus"); 646 // power cycle the bus if requested 647 // tests show that the wait times required can be very long (~1sec) 648 if (hard_reset) 649 { 650 VERBOSE(VB_CHANNEL, LOC + "Power-cycling DiSEqC Bus"); 645 651 652 SetVoltage(SEC_VOLTAGE_OFF); 653 usleep(DISEQC_POWER_OFF_WAIT); 654 } 655 656 // make sure the bus is powered 657 SetVoltage(SEC_VOLTAGE_18); 658 usleep(DISEQC_POWER_ON_WAIT); 659 646 660 // issue a global reset command 661 VERBOSE(VB_CHANNEL, LOC + "Resetting DiSEqC Bus"); 647 662 if (!SendCommand(DISEQC_ADR_ALL, DISEQC_CMD_RESET)) 648 663 { 649 664 VERBOSE(VB_IMPORTANT, LOC_ERR + … … 653 668 654 669 usleep(DISEQC_LONG_WAIT); 655 670 656 // power cycle the bus if requested657 if (hard_reset)658 {659 VERBOSE(VB_CHANNEL, LOC + "Power-cycling DiSEqC Bus");660 671 661 SetVoltage(SEC_VOLTAGE_OFF);662 usleep(DISEQC_LONG_WAIT);663 664 SetVoltage(SEC_VOLTAGE_18);665 usleep(DISEQC_LONG_WAIT);666 }667 668 672 return true; 669 673 } 670 674 671 675 void DiSEqCDevTree::Open(int fd_frontend) 672 676 { 673 677 m_fd_frontend = fd_frontend; 674 ResetDiseqc(true); 678 679 // issue reset command 680 ResetDiseqc(false); 675 681 } 676 682 677 683 bool DiSEqCDevTree::SetVoltage(uint voltage)