Origin commit data
------------------
Commit: 8a75efa81a
Author: vanhofen <vanhofen@gmx.de>
Date: 2017-03-19 (Sun, 19 Mar 2017)
This commit is contained in:
vanhofen
2017-03-19 01:05:31 +01:00
8 changed files with 45 additions and 22 deletions

View File

@@ -1,6 +1,13 @@
AM_CXXFLAGS = -fno-rtti -fno-exceptions -fno-strict-aliasing
AM_CPPFLAGS = \
-I$(top_builddir) \
-I$(top_srcdir) \
-I$(top_srcdir)/src \
-I$(top_srcdir)/src/zapit/include \
-I$(top_srcdir)/lib \
-I$(top_srcdir)/lib/libconfigfile \
-I$(top_srcdir)/lib/libeventserver \
@HWLIB_CFLAGS@
noinst_LIBRARIES = libhwcaps.a

View File

@@ -11,6 +11,8 @@
#include <string.h>
#include "hardware_caps.h"
#include <zapit/femanager.h>
static int initialized = 0;
static hw_caps_t caps;
@@ -19,7 +21,7 @@ hw_caps_t *get_hwcaps(void) {
return &caps;
int rev = cs_get_revision();
int chip = cs_get_chip_type();
caps.has_fan = (rev < 8);
caps.has_fan = (rev < 8 && CFEManager::getInstance()->getFE(0)->hasSat()); // only SAT-HD1 before rev 8 has fan
caps.has_HDMI = 1;
caps.has_SCART = (rev != 10);
caps.has_SCART_input = 0;
@@ -34,15 +36,23 @@ hw_caps_t *get_hwcaps(void) {
caps.can_ps_14_9 = 1;
caps.force_tuner_2G = 0;
strcpy(caps.boxvendor, "Coolstream");
strcpy(caps.boxarch, "Nevis");
switch (rev) {
case 6:
case 7: // Black Stallion Edition
strcpy(caps.boxname, "HD1");
strcpy(caps.boxarch, "Nevis");
caps.force_tuner_2G = 1;
break;
case 8: // TODO: Neo2 - Twin
case 8:
if (CFEManager::getInstance()->getFrontendCount() < 2)
{
strcpy(caps.boxname, "Neo");
}
else
{
strcpy(caps.boxname, "Neo Twin");
}
strcpy(caps.boxarch, "Nevis");
caps.force_tuner_2G = 1;
break;
case 9:
@@ -51,6 +61,7 @@ hw_caps_t *get_hwcaps(void) {
break;
case 10:
strcpy(caps.boxname, "Zee");
strcpy(caps.boxarch, "Nevis");
caps.force_tuner_2G = 1;
break;
case 11:

View File

@@ -341,6 +341,7 @@ void CLCD::setlcdparameter(int dimm, const int contrast, const int power, const
perror("[lcdd] set invert failed!");
}
#if 0
if (g_info.box_Type == CControld::TUXBOX_MAKER_PHILIPS)
{
if (ioctl(fd, LCD_IOCTL_BIAS, &bias) < 0)
@@ -348,6 +349,7 @@ void CLCD::setlcdparameter(int dimm, const int contrast, const int power, const
perror("[lcdd] set bias failed!");
}
}
#endif
close(fd);
}
#endif

View File

@@ -326,7 +326,7 @@ void CMiscMenue::showMiscSettingsMenuGeneral(CMenuWidget *ms_general)
ms_general->addItem(mc);
//fan speed
if (g_info.has_fan)
if (g_info.hw_caps->has_fan)
{
CMenuOptionNumberChooser * mn = new CMenuOptionNumberChooser(LOCALE_FAN_SPEED, &g_settings.fan_speed, true, 1, 14, fanNotifier, CRCInput::RC_nokey, NULL, 0, 0, LOCALE_OPTIONS_OFF);
mn->setHint("", LOCALE_MENU_HINT_FAN_SPEED);

View File

@@ -2377,13 +2377,9 @@ TIMER_START();
cpuFreq = new cCpuFreqManager();
cpuFreq->SetCpuFreq(g_settings.cpufreq * 1000 * 1000);
#if HAVE_COOL_HARDWARE
/* only SAT-hd1 before rev 8 has fan */
g_info.has_fan = (cs_get_revision() < 8 && CFEManager::getInstance()->getFE(0)->hasSat());
#endif
dprintf(DEBUG_NORMAL, "g_info.has_fan: %d\n", g_info.has_fan);
//fan speed
if (g_info.has_fan)
if (g_info.hw_caps->has_fan)
CFanControlNotifier::setSpeed(g_settings.fan_speed);
dvbsub_init();
@@ -3989,7 +3985,7 @@ void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode)
delete g_RCInput;
//NI my_system("/etc/init.d/rcK");
//fan speed
if (g_info.has_fan) {
if (g_info.hw_caps->has_fan) {
CFanControlNotifier::setSpeed(0);
}
//CVFD::getInstance()->ShowText(g_Locale->getText(LOCALE_MAINMENU_REBOOT));
@@ -4207,7 +4203,7 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby )
cpuFreq->SetCpuFreq(g_settings.standby_cpufreq * 1000 * 1000);
//fan speed
if (g_info.has_fan)
if (g_info.hw_caps->has_fan)
CFanControlNotifier::setSpeed(1);
frameBuffer->setActive(false);
@@ -4239,7 +4235,7 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby )
}
frameBuffer->setActive(true);
//fan speed
if (g_info.has_fan)
if (g_info.hw_caps->has_fan)
CFanControlNotifier::setSpeed(g_settings.fan_speed);
puts("[neutrino.cpp] executing " NEUTRINO_LEAVE_STANDBY_SCRIPT ".");

View File

@@ -821,7 +821,15 @@ void CControlAPI::HWInfoCGI(CyhookHandler *hh)
std::string eth_id = netadapter.getMacAddr();
std::transform(eth_id.begin(), eth_id.end(), eth_id.begin(), ::tolower);
hh->printf("%s %s (%s)\nMAC:%s\n", g_info.hw_caps->boxvendor, g_info.hw_caps->boxname, g_info.hw_caps->boxarch, eth_id.c_str());
std::string boxvendor(g_info.hw_caps->boxvendor);
/*
I don't know the current legal situation.
So better let's change the vendor's name to CST.
*/
if (boxvendor.compare("Coolstream") == 0)
boxvendor = "CST";
hh->printf("%s %s (%s)\nMAC:%s\n", boxvendor.c_str(), g_info.hw_caps->boxname, g_info.hw_caps->boxarch, eth_id.c_str());
}
//-----------------------------------------------------------------------------
void CControlAPI::ShutdownCGI(CyhookHandler *hh)

View File

@@ -851,14 +851,16 @@ std::string CNeutrinoYParser::func_get_partition_list(CyhookHandler *, std::str
std::string CNeutrinoYParser::func_get_boxtype(CyhookHandler *, std::string)
{
std::string boxvendor(g_info.hw_caps->boxvendor);
/* stay compatible with present code in Y_Blocks.txt */
/*
I don't know the current legal situation.
So better let's change the vendor's name to CST.
After change this, you'll have to align code in Y_Blocks.txt
*/
if (boxvendor.compare("Coolstream") == 0)
boxvendor = "CST";
std::string boxname(g_info.hw_caps->boxname);
/* workaround for Neo2 */
if ((boxname.compare("Neo") == 0) && (CFEManager::getInstance()->getFrontendCount() > 1))
boxname += " Twin";
return boxvendor + " " + boxname;
}

View File

@@ -999,9 +999,6 @@ const time_settings_struct_t timing_setting[SNeutrinoSettings::TIMING_SETTING_CO
struct SglobalInfo
{
unsigned char box_Type;
delivery_system_t delivery_system;
bool has_fan;
hw_caps_t *hw_caps;
};