diff --git a/src/gui/miscsettings_menu.cpp b/src/gui/miscsettings_menu.cpp index 9e5c073b8..162b16374 100644 --- a/src/gui/miscsettings_menu.cpp +++ b/src/gui/miscsettings_menu.cpp @@ -213,7 +213,6 @@ const CMenuOptionChooser::keyval CHANNELLIST_NEW_ZAP_MODE_OPTIONS[CHANNELLIST_NE { 2, LOCALE_CHANNELLIST_NEW_ZAP_MODE_ACTIVE } }; -#ifdef CPU_FREQ #define CPU_FREQ_OPTION_COUNT 13 const CMenuOptionChooser::keyval_ext CPU_FREQ_OPTIONS[CPU_FREQ_OPTION_COUNT] = { @@ -231,7 +230,6 @@ const CMenuOptionChooser::keyval_ext CPU_FREQ_OPTIONS[CPU_FREQ_OPTION_COUNT] = { 550, NONEXISTANT_LOCALE, "550 Mhz"}, { 600, NONEXISTANT_LOCALE, "600 Mhz"} }; -#endif /*CPU_FREQ*/ const CMenuOptionChooser::keyval EPG_SCAN_OPTIONS[] = { @@ -345,12 +343,13 @@ int CMiscMenue::showMiscSettingsMenu() mf->setHint("", LOCALE_MENU_HINT_MISC_ONLINESERVICES); misc_menue.addItem(mf); -#ifdef CPU_FREQ //CPU - CMenuWidget misc_menue_cpu("CPU", NEUTRINO_ICON_SETTINGS, width); - showMiscSettingsMenuCPUFreq(&misc_menue_cpu); - misc_menue.addItem( new CMenuForwarder("CPU", true, NULL, &misc_menue_cpu, NULL, CRCInput::convertDigitToKey(shortcut++))); -#endif /*CPU_FREQ*/ + if (g_info.hw_caps->can_cpufreq) + { + CMenuWidget misc_menue_cpu("CPU", NEUTRINO_ICON_SETTINGS, width); + showMiscSettingsMenuCPUFreq(&misc_menue_cpu); + misc_menue.addItem( new CMenuForwarder("CPU", true, NULL, &misc_menue_cpu, NULL, CRCInput::convertDigitToKey(shortcut++))); + } int res = misc_menue.exec(NULL, ""); @@ -773,7 +772,6 @@ int CMiscMenue::showMiscSettingsSelectWeatherLocation() return res; } -#ifdef CPU_FREQ //CPU void CMiscMenue::showMiscSettingsMenuCPUFreq(CMenuWidget *ms_cpu) { @@ -783,7 +781,6 @@ void CMiscMenue::showMiscSettingsMenuCPUFreq(CMenuWidget *ms_cpu) ms_cpu->addItem(new CMenuOptionChooser(LOCALE_CPU_FREQ_NORMAL, &g_settings.cpufreq, CPU_FREQ_OPTIONS, CPU_FREQ_OPTION_COUNT, true, cpuNotifier)); ms_cpu->addItem(new CMenuOptionChooser(LOCALE_CPU_FREQ_STANDBY, &g_settings.standby_cpufreq, CPU_FREQ_OPTIONS, CPU_FREQ_OPTION_COUNT, true)); } -#endif /*CPU_FREQ*/ bool CMiscMenue::changeNotify(const neutrino_locale_t OptionName, void * /*data*/) { diff --git a/src/gui/miscsettings_menu.h b/src/gui/miscsettings_menu.h index 376d136d8..d1aa44434 100644 --- a/src/gui/miscsettings_menu.h +++ b/src/gui/miscsettings_menu.h @@ -33,8 +33,6 @@ #include -//#define CPU_FREQ - class CMiscMenue : public CMenuTarget, CChangeObserver { private: @@ -79,9 +77,7 @@ class CMiscMenue : public CMenuTarget, CChangeObserver int showMiscSettingsMenuOnlineServices(); int showMiscSettingsSelectWeatherLocation(); int showMiscSettingsMenuPlugins(); -#ifdef CPU_FREQ void showMiscSettingsMenuCPUFreq(CMenuWidget *ms_cpu); -#endif /*CPU_FREQ*/ public: CMiscMenue(); ~CMiscMenue(); diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 094a52f55..5bcf518ea 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -486,13 +486,8 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.zappingmode = configfile.getInt32( "zappingmode", 0); #endif -#ifdef CPU_FREQ - g_settings.cpufreq = configfile.getInt32("cpufreq", 0); - g_settings.standby_cpufreq = configfile.getInt32("standby_cpufreq", 100); -#else - g_settings.cpufreq = 0; - g_settings.standby_cpufreq = 50; -#endif + g_settings.cpufreq = g_info.hw_caps->can_cpufreq ? configfile.getInt32("cpufreq", 0) : 0; + g_settings.standby_cpufreq = g_info.hw_caps->can_cpufreq ? configfile.getInt32("standby_cpufreq", 100) : 50; // ci-settings g_settings.ci_standby_reset = configfile.getInt32("ci_standby_reset", 0); @@ -2833,8 +2828,9 @@ TIMER_START(); powerManager = new cPowerManager; powerManager->Open(); - cpuFreq = new cCpuFreqManager(); - cpuFreq->SetCpuFreq(g_settings.cpufreq * 1000 * 1000); + cpuFreq = g_info.hw_caps->can_cpufreq ? new cCpuFreqManager() : NULL; + if (cpuFreq) + cpuFreq->SetCpuFreq(g_settings.cpufreq * 1000 * 1000); //fan speed if (g_info.hw_caps->has_fan) @@ -3564,7 +3560,8 @@ bool CNeutrinoApp::wakeupFromStandby(void) CStreamManager::getInstance()->StreamStatus(); if ((mode == NeutrinoModes::mode_standby) && !alive) { - cpuFreq->SetCpuFreq(g_settings.cpufreq * 1000 * 1000); + if (cpuFreq) + cpuFreq->SetCpuFreq(g_settings.cpufreq * 1000 * 1000); if(g_settings.ci_standby_reset) { g_CamHandler->exec(NULL, "ca_ci_reset0"); g_CamHandler->exec(NULL, "ca_ci_reset1"); @@ -3591,7 +3588,8 @@ void CNeutrinoApp::standbyToStandby(void) } g_Zapit->setStandby(true); g_Sectionsd->setPauseScanning(true); - cpuFreq->SetCpuFreq(g_settings.standby_cpufreq * 1000 * 1000); + if (cpuFreq) + cpuFreq->SetCpuFreq(g_settings.standby_cpufreq * 1000 * 1000); } } @@ -4755,9 +4753,8 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby ) exec_controlscript(NEUTRINO_ENTER_STANDBY_SCRIPT); CEpgScan::getInstance()->Start(true); - bool alive = recordingstatus || CEpgScan::getInstance()->Running() || - CStreamManager::getInstance()->StreamStatus(); - if(!alive) + bool alive = recordingstatus || CEpgScan::getInstance()->Running() || CStreamManager::getInstance()->StreamStatus(); + if (!alive && cpuFreq) cpuFreq->SetCpuFreq(g_settings.standby_cpufreq * 1000 * 1000); //fan speed @@ -4778,8 +4775,9 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby ) // Active standby off powerManager->SetStandby(false, false); CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO); - CVFD::getInstance()->ShowText("resume... "); - cpuFreq->SetCpuFreq(g_settings.cpufreq * 1000 * 1000); + CVFD::getInstance()->ShowText("Resume ..."); + if (cpuFreq) + cpuFreq->SetCpuFreq(g_settings.cpufreq * 1000 * 1000); videoDecoder->Standby(false); CEpgScan::getInstance()->Stop(); CSectionsdClient::CurrentNextInfo dummy; diff --git a/src/system/setting_helpers.cpp b/src/system/setting_helpers.cpp index 1be194fc4..7c7dc652d 100644 --- a/src/system/setting_helpers.cpp +++ b/src/system/setting_helpers.cpp @@ -631,7 +631,8 @@ extern cCpuFreqManager * cpuFreq; printf("CCpuFreqNotifier: %d Mhz\n", freq); freq *= 1000*1000; - cpuFreq->SetCpuFreq(freq); + if (cpuFreq) + cpuFreq->SetCpuFreq(freq); return false; }