mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-10 15:18:28 +02:00
Merge branch 'master' into pu/mp
Conflicts:
src/gui/miscsettings_menu.cpp
src/neutrino.cpp
src/system/settings.h
Origin commit data
------------------
Commit: b12624d1fa
Author: vanhofen <vanhofen@gmx.de>
Date: 2017-03-20 (Mon, 20 Mar 2017)
This commit is contained in:
@@ -1,6 +1,13 @@
|
|||||||
AM_CXXFLAGS = -fno-rtti -fno-exceptions -fno-strict-aliasing
|
AM_CXXFLAGS = -fno-rtti -fno-exceptions -fno-strict-aliasing
|
||||||
|
|
||||||
AM_CPPFLAGS = \
|
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@
|
@HWLIB_CFLAGS@
|
||||||
|
|
||||||
noinst_LIBRARIES = libhwcaps.a
|
noinst_LIBRARIES = libhwcaps.a
|
||||||
|
@@ -11,6 +11,8 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "hardware_caps.h"
|
#include "hardware_caps.h"
|
||||||
|
|
||||||
|
#include <zapit/femanager.h>
|
||||||
|
|
||||||
static int initialized = 0;
|
static int initialized = 0;
|
||||||
static hw_caps_t caps;
|
static hw_caps_t caps;
|
||||||
|
|
||||||
@@ -19,7 +21,7 @@ hw_caps_t *get_hwcaps(void) {
|
|||||||
return ∩︀
|
return ∩︀
|
||||||
int rev = cs_get_revision();
|
int rev = cs_get_revision();
|
||||||
int chip = cs_get_chip_type();
|
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_HDMI = 1;
|
||||||
caps.has_SCART = (rev != 10);
|
caps.has_SCART = (rev != 10);
|
||||||
caps.has_SCART_input = 0;
|
caps.has_SCART_input = 0;
|
||||||
@@ -34,15 +36,23 @@ hw_caps_t *get_hwcaps(void) {
|
|||||||
caps.can_ps_14_9 = 1;
|
caps.can_ps_14_9 = 1;
|
||||||
caps.force_tuner_2G = 0;
|
caps.force_tuner_2G = 0;
|
||||||
strcpy(caps.boxvendor, "Coolstream");
|
strcpy(caps.boxvendor, "Coolstream");
|
||||||
strcpy(caps.boxarch, "Nevis");
|
|
||||||
switch (rev) {
|
switch (rev) {
|
||||||
case 6:
|
case 6:
|
||||||
case 7: // Black Stallion Edition
|
case 7: // Black Stallion Edition
|
||||||
strcpy(caps.boxname, "HD1");
|
strcpy(caps.boxname, "HD1");
|
||||||
|
strcpy(caps.boxarch, "Nevis");
|
||||||
caps.force_tuner_2G = 1;
|
caps.force_tuner_2G = 1;
|
||||||
break;
|
break;
|
||||||
case 8: // TODO: Neo2 - Twin
|
case 8:
|
||||||
strcpy(caps.boxname, "Neo");
|
if (CFEManager::getInstance()->getFrontendCount() < 2)
|
||||||
|
{
|
||||||
|
strcpy(caps.boxname, "Neo");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
strcpy(caps.boxname, "Neo Twin");
|
||||||
|
}
|
||||||
|
strcpy(caps.boxarch, "Nevis");
|
||||||
caps.force_tuner_2G = 1;
|
caps.force_tuner_2G = 1;
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
@@ -51,6 +61,7 @@ hw_caps_t *get_hwcaps(void) {
|
|||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
strcpy(caps.boxname, "Zee");
|
strcpy(caps.boxname, "Zee");
|
||||||
|
strcpy(caps.boxarch, "Nevis");
|
||||||
caps.force_tuner_2G = 1;
|
caps.force_tuner_2G = 1;
|
||||||
break;
|
break;
|
||||||
case 11:
|
case 11:
|
||||||
|
@@ -358,6 +358,7 @@ void CLCD::setlcdparameter(int dimm, const int contrast, const int power, const
|
|||||||
perror("[lcdd] set invert failed!");
|
perror("[lcdd] set invert failed!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
if (g_info.box_Type == CControld::TUXBOX_MAKER_PHILIPS)
|
if (g_info.box_Type == CControld::TUXBOX_MAKER_PHILIPS)
|
||||||
{
|
{
|
||||||
if (ioctl(fd, LCD_IOCTL_BIAS, &bias) < 0)
|
if (ioctl(fd, LCD_IOCTL_BIAS, &bias) < 0)
|
||||||
@@ -365,6 +366,7 @@ void CLCD::setlcdparameter(int dimm, const int contrast, const int power, const
|
|||||||
perror("[lcdd] set bias failed!");
|
perror("[lcdd] set bias failed!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
close(fd);
|
close(fd);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@@ -269,10 +269,12 @@ int CNeutrinoFonts::getDynFontSize(int dx, int dy, std::string text, int style)
|
|||||||
if (text.empty()) tmpText = "x";
|
if (text.empty()) tmpText = "x";
|
||||||
_width = dynFont->getRenderWidth(tmpText);
|
_width = dynFont->getRenderWidth(tmpText);
|
||||||
if ((_height > dy) || (_width > dx)) {
|
if ((_height > dy) || (_width > dx)) {
|
||||||
if (dynFlag)
|
if (dynFlag){
|
||||||
dynSize--;
|
dynSize--;
|
||||||
else
|
}else{
|
||||||
printf("##### [%s] Specified size (dx=%d, dy=%d) too small, use minimal font size.\n", __FUNCTION__, dx, dy);
|
if (debug)
|
||||||
|
printf("##### [%s] Specified size (dx=%d, dy=%d) too small, use minimal font size.\n", __FUNCTION__, dx, dy);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if ((_height < dy) || (_width < dx)) {
|
else if ((_height < dy) || (_width < dx)) {
|
||||||
|
@@ -333,7 +333,7 @@ void CMiscMenue::showMiscSettingsMenuGeneral(CMenuWidget *ms_general)
|
|||||||
ms_general->addItem(mc);
|
ms_general->addItem(mc);
|
||||||
|
|
||||||
//fan speed
|
//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);
|
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);
|
mn->setHint("", LOCALE_MENU_HINT_FAN_SPEED);
|
||||||
|
@@ -197,6 +197,7 @@ int CColorChooser::exec(CMenuTarget* parent, const std::string &)
|
|||||||
val += 2;
|
val += 2;
|
||||||
else
|
else
|
||||||
val = 100;
|
val = 100;
|
||||||
|
(*value[selected]) = (uint8_t)val;
|
||||||
|
|
||||||
paintSlider(x + 10, y + hheight + mheight * selected, value[selected], colorchooser_names[selected], iconnames[selected], true);
|
paintSlider(x + 10, y + hheight + mheight * selected, value[selected], colorchooser_names[selected], iconnames[selected], true);
|
||||||
setColor();
|
setColor();
|
||||||
@@ -211,6 +212,7 @@ int CColorChooser::exec(CMenuTarget* parent, const std::string &)
|
|||||||
val -= 2;
|
val -= 2;
|
||||||
else
|
else
|
||||||
val = 0;
|
val = 0;
|
||||||
|
(*value[selected]) = (uint8_t)val;
|
||||||
|
|
||||||
paintSlider(x + 10, y + hheight + mheight * selected, value[selected], colorchooser_names[selected], iconnames[selected], true);
|
paintSlider(x + 10, y + hheight + mheight * selected, value[selected], colorchooser_names[selected], iconnames[selected], true);
|
||||||
setColor();
|
setColor();
|
||||||
|
251
src/neutrino.cpp
251
src/neutrino.cpp
@@ -217,9 +217,6 @@ CNeutrinoFonts * neutrinoFonts = NULL;
|
|||||||
bool parentallocked = false;
|
bool parentallocked = false;
|
||||||
static char **global_argv;
|
static char **global_argv;
|
||||||
|
|
||||||
/* hack until we have real platform abstraction... */
|
|
||||||
static bool can_deepstandby = false;
|
|
||||||
|
|
||||||
extern const char * locale_real_names[]; /* #include <system/locals_intern.h> */
|
extern const char * locale_real_names[]; /* #include <system/locals_intern.h> */
|
||||||
|
|
||||||
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
@@ -479,12 +476,14 @@ int CNeutrinoApp::loadSetup(const char * fname)
|
|||||||
g_settings.hdd_noise = configfile.getInt32( "hdd_noise", 254);
|
g_settings.hdd_noise = configfile.getInt32( "hdd_noise", 254);
|
||||||
g_settings.hdd_statfs_mode = configfile.getInt32( "hdd_statfs_mode", SNeutrinoSettings::HDD_STATFS_RECORDING);
|
g_settings.hdd_statfs_mode = configfile.getInt32( "hdd_statfs_mode", SNeutrinoSettings::HDD_STATFS_RECORDING);
|
||||||
|
|
||||||
g_settings.shutdown_real = configfile.getBool("shutdown_real" , false );
|
g_settings.shutdown_real = false;
|
||||||
|
if (g_info.hw_caps->can_shutdown)
|
||||||
|
g_settings.shutdown_real = configfile.getBool("shutdown_real" , false );
|
||||||
g_settings.shutdown_real_rcdelay = configfile.getBool("shutdown_real_rcdelay", false );
|
g_settings.shutdown_real_rcdelay = configfile.getBool("shutdown_real_rcdelay", false );
|
||||||
g_settings.shutdown_count = configfile.getInt32("shutdown_count", 0);
|
g_settings.shutdown_count = configfile.getInt32("shutdown_count", 0);
|
||||||
|
|
||||||
g_settings.shutdown_min = 0;
|
g_settings.shutdown_min = 0;
|
||||||
if (can_deepstandby || cs_get_revision() == 1)
|
if (g_info.hw_caps->can_shutdown || cs_get_revision() == 1)
|
||||||
g_settings.shutdown_min = configfile.getInt32("shutdown_min", 180);
|
g_settings.shutdown_min = configfile.getInt32("shutdown_min", 180);
|
||||||
g_settings.sleeptimer_min = configfile.getInt32("sleeptimer_min", 0);
|
g_settings.sleeptimer_min = configfile.getInt32("sleeptimer_min", 0);
|
||||||
|
|
||||||
@@ -2088,8 +2087,6 @@ TIMER_START();
|
|||||||
cs_register_messenger(CSSendMessage);
|
cs_register_messenger(CSSendMessage);
|
||||||
|
|
||||||
g_info.hw_caps = get_hwcaps();
|
g_info.hw_caps = get_hwcaps();
|
||||||
can_deepstandby = g_info.hw_caps->can_shutdown;
|
|
||||||
g_info.has_fan = g_info.hw_caps->has_fan;
|
|
||||||
|
|
||||||
g_Locale = new CLocaleManager;
|
g_Locale = new CLocaleManager;
|
||||||
|
|
||||||
@@ -2204,13 +2201,9 @@ TIMER_START();
|
|||||||
|
|
||||||
cpuFreq = new cCpuFreqManager();
|
cpuFreq = new cCpuFreqManager();
|
||||||
cpuFreq->SetCpuFreq(g_settings.cpufreq * 1000 * 1000);
|
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
|
//fan speed
|
||||||
if (g_info.has_fan)
|
if (g_info.hw_caps->has_fan)
|
||||||
CFanControlNotifier::setSpeed(g_settings.fan_speed);
|
CFanControlNotifier::setSpeed(g_settings.fan_speed);
|
||||||
|
|
||||||
dvbsub_init();
|
dvbsub_init();
|
||||||
@@ -2328,7 +2321,7 @@ TIMER_STOP("################################## after all #######################
|
|||||||
}
|
}
|
||||||
RealRun();
|
RealRun();
|
||||||
|
|
||||||
ExitRun(true, can_deepstandby);
|
ExitRun(g_info.hw_caps->can_shutdown);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -3389,7 +3382,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data)
|
|||||||
return messages_return::handled;
|
return messages_return::handled;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (g_settings.shutdown_real && can_deepstandby)
|
if (g_settings.shutdown_real)
|
||||||
g_RCInput->postMsg(NeutrinoMessages::SHUTDOWN, 0);
|
g_RCInput->postMsg(NeutrinoMessages::SHUTDOWN, 0);
|
||||||
else
|
else
|
||||||
g_RCInput->postMsg(NeutrinoMessages::STANDBY_ON, 0);
|
g_RCInput->postMsg(NeutrinoMessages::STANDBY_ON, 0);
|
||||||
@@ -3434,7 +3427,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data)
|
|||||||
}
|
}
|
||||||
else if( msg == NeutrinoMessages::SHUTDOWN ) {
|
else if( msg == NeutrinoMessages::SHUTDOWN ) {
|
||||||
if(!skipShutdownTimer) {
|
if(!skipShutdownTimer) {
|
||||||
ExitRun(true, can_deepstandby);
|
ExitRun(g_info.hw_caps->can_shutdown);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
skipShutdownTimer=false;
|
skipShutdownTimer=false;
|
||||||
@@ -3444,7 +3437,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data)
|
|||||||
else if( msg == NeutrinoMessages::REBOOT ) {
|
else if( msg == NeutrinoMessages::REBOOT ) {
|
||||||
FILE *f = fopen("/tmp/.reboot", "w");
|
FILE *f = fopen("/tmp/.reboot", "w");
|
||||||
fclose(f);
|
fclose(f);
|
||||||
ExitRun(true);
|
ExitRun();
|
||||||
}
|
}
|
||||||
else if (msg == NeutrinoMessages::EVT_POPUP || msg == NeutrinoMessages::EVT_EXTMSG) {
|
else if (msg == NeutrinoMessages::EVT_POPUP || msg == NeutrinoMessages::EVT_EXTMSG) {
|
||||||
if (mode != mode_scart && mode != mode_standby) {
|
if (mode != mode_scart && mode != mode_standby) {
|
||||||
@@ -3607,131 +3600,140 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data)
|
|||||||
extern time_t timer_minutes;//timermanager.cpp
|
extern time_t timer_minutes;//timermanager.cpp
|
||||||
extern bool timer_is_rec;//timermanager.cpp
|
extern bool timer_is_rec;//timermanager.cpp
|
||||||
|
|
||||||
void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode)
|
void CNeutrinoApp::ExitRun(int can_shutdown)
|
||||||
{
|
{
|
||||||
printf("[neutrino] %s retcode: %d can_deep: %d\n", __func__, retcode, can_deepstandby);
|
printf("[neutrino] %s can_shutdown: %d\n", __func__, can_shutdown);
|
||||||
bool do_shutdown = true;
|
|
||||||
|
|
||||||
|
bool do_shutdown = true;
|
||||||
CRecordManager::getInstance()->StopAutoRecord();
|
CRecordManager::getInstance()->StopAutoRecord();
|
||||||
if(CRecordManager::getInstance()->RecordingStatus() || cYTCache::getInstance()->isActive()) {
|
if(CRecordManager::getInstance()->RecordingStatus() || cYTCache::getInstance()->isActive())
|
||||||
|
{
|
||||||
do_shutdown =
|
do_shutdown =
|
||||||
(ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_SHUTDOWN_RECORDING_QUERY, CMsgBox::mbrNo,
|
(ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_SHUTDOWN_RECORDING_QUERY, CMsgBox::mbrNo,
|
||||||
CMsgBox::mbYes | CMsgBox::mbNo, NULL, 450, DEFAULT_TIMEOUT, true) == CMsgBox::mbrYes);
|
CMsgBox::mbYes | CMsgBox::mbNo, NULL, 450, DEFAULT_TIMEOUT, true) == CMsgBox::mbrYes);
|
||||||
}
|
}
|
||||||
|
if (!do_shutdown)
|
||||||
|
return;
|
||||||
|
|
||||||
if(do_shutdown) {
|
if(SDTreloadChannels)
|
||||||
if(SDTreloadChannels){
|
SDT_ReloadChannels();
|
||||||
SDT_ReloadChannels();
|
|
||||||
//SDTreloadChannels = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
dprintf(DEBUG_INFO, "exit\n");
|
||||||
|
StopSubtitles();
|
||||||
|
stopPlayBack();
|
||||||
|
|
||||||
dprintf(DEBUG_INFO, "exit\n");
|
frameBuffer->paintBackground();
|
||||||
StopSubtitles();
|
frameBuffer->showFrame("shutdown.jpg");
|
||||||
stopPlayBack();
|
|
||||||
|
|
||||||
frameBuffer->paintBackground();
|
delete cHddStat::getInstance();
|
||||||
frameBuffer->showFrame("shutdown.jpg");
|
delete CRecordManager::getInstance();
|
||||||
|
|
||||||
delete cHddStat::getInstance();
|
CEpgScan::getInstance()->Stop();
|
||||||
delete CRecordManager::getInstance();
|
if(g_settings.epg_save /* && timeset && g_Sectionsd->getIsTimeSet ()*/)
|
||||||
|
{
|
||||||
|
g_Sectionsd->setPauseScanning(true);
|
||||||
|
saveEpg(true);// true CVFD::MODE_SHUTDOWN
|
||||||
|
}
|
||||||
|
|
||||||
CEpgScan::getInstance()->Stop();
|
/* on shutdown force load new fst */
|
||||||
if(g_settings.epg_save /* && timeset && g_Sectionsd->getIsTimeSet ()*/) {
|
if (can_shutdown)
|
||||||
g_Sectionsd->setPauseScanning(true);
|
CheckFastScan(true, false);
|
||||||
saveEpg(true);// true CVFD::MODE_SHUTDOWN
|
|
||||||
}
|
|
||||||
|
|
||||||
/* on shutdown force load new fst */
|
CVFD::getInstance()->setMode(CVFD::MODE_SHUTDOWN);
|
||||||
if (retcode)
|
|
||||||
CheckFastScan(true, false);
|
|
||||||
|
|
||||||
CVFD::getInstance()->setMode(CVFD::MODE_SHUTDOWN);
|
stop_daemons(true /*can_shoutdown*/); //need here for timer_is_rec before saveSetup
|
||||||
|
g_settings.shutdown_timer_record_type = timer_is_rec;
|
||||||
stop_daemons(true /*retcode*/);//need here for timer_is_rec before saveSetup
|
saveSetup(NEUTRINO_SETTINGS_FILE);
|
||||||
g_settings.shutdown_timer_record_type = timer_is_rec;
|
|
||||||
saveSetup(NEUTRINO_SETTINGS_FILE);
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
if(retcode) {
|
if (can_shutdown)
|
||||||
|
{
|
||||||
#endif
|
#endif
|
||||||
puts("[neutrino.cpp] executing " NEUTRINO_ENTER_DEEPSTANDBY_SCRIPT ".");
|
puts("[neutrino.cpp] executing " NEUTRINO_ENTER_DEEPSTANDBY_SCRIPT ".");
|
||||||
if (my_system(NEUTRINO_ENTER_DEEPSTANDBY_SCRIPT) != 0)
|
if (my_system(NEUTRINO_ENTER_DEEPSTANDBY_SCRIPT) != 0)
|
||||||
perror(NEUTRINO_ENTER_DEEPSTANDBY_SCRIPT " failed");
|
perror(NEUTRINO_ENTER_DEEPSTANDBY_SCRIPT " failed");
|
||||||
|
|
||||||
printf("entering off state\n");
|
printf("entering off state\n");
|
||||||
printf("timer_minutes: %ld\n", timer_minutes);
|
printf("timer_minutes: %ld\n", timer_minutes);
|
||||||
mode = mode_off;
|
mode = mode_off;
|
||||||
//CVFD::getInstance()->ShowText(g_Locale->getText(LOCALE_MAINMENU_SHUTDOWN));
|
//CVFD::getInstance()->ShowText(g_Locale->getText(LOCALE_MAINMENU_SHUTDOWN));
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
fp_standby_data_t standby;
|
||||||
|
time_t mtime = time(NULL);
|
||||||
|
struct tm *tmtime = localtime(&mtime);
|
||||||
|
time_t fp_timer = 0;
|
||||||
|
|
||||||
|
if (timer_minutes)
|
||||||
|
{
|
||||||
|
fp_timer = timer_minutes - mtime/60;
|
||||||
|
if (fp_timer < 1)
|
||||||
|
fp_timer = 1;
|
||||||
|
}
|
||||||
|
printf("now: %ld, timer %ld, FP timer %ldmin\n", mtime/60, timer_minutes, fp_timer);fflush(stdout);
|
||||||
|
int leds = 0x40;
|
||||||
|
switch (g_settings.led_deep_mode)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
leds = 0x0; //off leds
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
leds = 0x60; //on led1 & 2
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
leds = 0x20; //led1 on , 2 off
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
leds = 0x40; //led2 off, 2 on
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (leds && g_settings.led_blink && fp_timer)
|
||||||
|
leds |= 0x80;
|
||||||
|
|
||||||
|
standby.brightness = cs_get_revision() == 10 ? 0 : g_settings.lcd_setting[SNeutrinoSettings::LCD_DEEPSTANDBY_BRIGHTNESS];
|
||||||
|
standby.flags = leds;
|
||||||
|
standby.current_hour = tmtime->tm_hour;
|
||||||
|
standby.current_minute = tmtime->tm_min;
|
||||||
|
standby.timer_minutes_hi = fp_timer >> 8;;
|
||||||
|
standby.timer_minutes_lo = fp_timer & 0xFF;
|
||||||
|
|
||||||
|
my_system("/etc/init.d/rcK");
|
||||||
|
sync();
|
||||||
|
CFSMounter::umount(); // unreachable NFS server
|
||||||
|
my_system(2,"/bin/umount", "-a");
|
||||||
|
sleep(1);
|
||||||
|
|
||||||
|
stop_video();
|
||||||
|
|
||||||
|
int fd = open("/dev/display", O_RDONLY);
|
||||||
|
if (fd < 0)
|
||||||
|
{
|
||||||
|
perror("/dev/display");
|
||||||
|
reboot(LINUX_REBOOT_CMD_RESTART);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (ioctl(fd, IOC_FP_STANDBY, (fp_standby_data_t *) &standby))
|
||||||
{
|
{
|
||||||
fp_standby_data_t standby;
|
perror("IOC_FP_STANDBY");
|
||||||
time_t mtime = time(NULL);
|
reboot(LINUX_REBOOT_CMD_RESTART);
|
||||||
struct tm *tmtime = localtime(&mtime);
|
|
||||||
time_t fp_timer = 0;
|
|
||||||
|
|
||||||
if(timer_minutes) {
|
|
||||||
fp_timer = timer_minutes - mtime/60;
|
|
||||||
if(fp_timer < 1)
|
|
||||||
fp_timer = 1;
|
|
||||||
}
|
|
||||||
printf("now: %ld, timer %ld, FP timer %ldmin\n", mtime/60, timer_minutes, fp_timer);fflush(stdout);
|
|
||||||
int leds = 0x40;
|
|
||||||
switch(g_settings.led_deep_mode){
|
|
||||||
case 0:
|
|
||||||
leds = 0x0;//off leds
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
leds = 0x60;//on led1 & 2
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
leds = 0x20;//led1 on , 2 off
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
leds = 0x40;//led2 off, 2 on
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if(leds && g_settings.led_blink && fp_timer)
|
|
||||||
leds |= 0x80;
|
|
||||||
|
|
||||||
standby.brightness = cs_get_revision() == 10 ? 0 : g_settings.lcd_setting[SNeutrinoSettings::LCD_DEEPSTANDBY_BRIGHTNESS];
|
|
||||||
standby.flags = leds;
|
|
||||||
standby.current_hour = tmtime->tm_hour;
|
|
||||||
standby.current_minute = tmtime->tm_min;
|
|
||||||
standby.timer_minutes_hi = fp_timer >> 8;;
|
|
||||||
standby.timer_minutes_lo = fp_timer & 0xFF;
|
|
||||||
|
|
||||||
my_system("/etc/init.d/rcK");
|
|
||||||
sync();
|
|
||||||
CFSMounter::umount(); // unreachable NFS server
|
|
||||||
my_system(2,"/bin/umount", "-a");
|
|
||||||
sleep(1);
|
|
||||||
|
|
||||||
stop_video();
|
|
||||||
|
|
||||||
int fd = open("/dev/display", O_RDONLY);
|
|
||||||
if (fd < 0) {
|
|
||||||
perror("/dev/display");
|
|
||||||
reboot(LINUX_REBOOT_CMD_RESTART);
|
|
||||||
} else {
|
|
||||||
|
|
||||||
if (ioctl(fd, IOC_FP_STANDBY, (fp_standby_data_t *) &standby)) {
|
|
||||||
perror("IOC_FP_STANDBY");
|
|
||||||
reboot(LINUX_REBOOT_CMD_RESTART);
|
|
||||||
} else {
|
|
||||||
while(true) sleep(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
else
|
||||||
|
{
|
||||||
|
while (true)
|
||||||
|
sleep(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
#endif
|
#endif
|
||||||
int leds = 0;
|
int leds = 0;
|
||||||
int bright = 0;
|
int bright = 0;
|
||||||
#if HAVE_COOL_HARDWARE
|
#if HAVE_COOL_HARDWARE
|
||||||
if (retcode) {
|
if (can_shutdown) {
|
||||||
leds = 0x40;
|
leds = 0x40;
|
||||||
switch (g_settings.led_deep_mode){
|
switch (g_settings.led_deep_mode){
|
||||||
case 0:
|
case 0:
|
||||||
@@ -3773,7 +3775,7 @@ void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode)
|
|||||||
delete g_RCInput;
|
delete g_RCInput;
|
||||||
g_RCInput = NULL;
|
g_RCInput = NULL;
|
||||||
//fan speed
|
//fan speed
|
||||||
if (g_info.has_fan) {
|
if (g_info.hw_caps->has_fan) {
|
||||||
CFanControlNotifier::setSpeed(0);
|
CFanControlNotifier::setSpeed(0);
|
||||||
}
|
}
|
||||||
//CVFD::getInstance()->ShowText(g_Locale->getText(LOCALE_MAINMENU_REBOOT));
|
//CVFD::getInstance()->ShowText(g_Locale->getText(LOCALE_MAINMENU_REBOOT));
|
||||||
@@ -3781,18 +3783,17 @@ void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode)
|
|||||||
delete SHTDCNT::getInstance();
|
delete SHTDCNT::getInstance();
|
||||||
stop_video();
|
stop_video();
|
||||||
|
|
||||||
printf("[neutrino] This is the end. exiting with code %d\n", retcode);
|
printf("[neutrino] This is the end. exiting with code %d\n", can_shutdown);
|
||||||
Cleanup();
|
Cleanup();
|
||||||
#ifdef __sh__
|
#ifdef __sh__
|
||||||
/* the sh4 gcc seems to dislike someting about openthreads... */
|
/* the sh4 gcc seems to dislike someting about openthreads... */
|
||||||
_exit(retcode);
|
_exit(can_shutdown);
|
||||||
#else
|
#else
|
||||||
exit(retcode);
|
exit(can_shutdown);
|
||||||
#endif
|
#endif
|
||||||
#if 0
|
#if 0
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void CNeutrinoApp::saveEpg(bool cvfd_mode)
|
void CNeutrinoApp::saveEpg(bool cvfd_mode)
|
||||||
@@ -4001,7 +4002,7 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby )
|
|||||||
cpuFreq->SetCpuFreq(g_settings.standby_cpufreq * 1000 * 1000);
|
cpuFreq->SetCpuFreq(g_settings.standby_cpufreq * 1000 * 1000);
|
||||||
|
|
||||||
//fan speed
|
//fan speed
|
||||||
if (g_info.has_fan)
|
if (g_info.hw_caps->has_fan)
|
||||||
CFanControlNotifier::setSpeed(1);
|
CFanControlNotifier::setSpeed(1);
|
||||||
|
|
||||||
frameBuffer->setActive(false);
|
frameBuffer->setActive(false);
|
||||||
@@ -4034,7 +4035,7 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby )
|
|||||||
}
|
}
|
||||||
frameBuffer->setActive(true);
|
frameBuffer->setActive(true);
|
||||||
//fan speed
|
//fan speed
|
||||||
if (g_info.has_fan)
|
if (g_info.hw_caps->has_fan)
|
||||||
CFanControlNotifier::setSpeed(g_settings.fan_speed);
|
CFanControlNotifier::setSpeed(g_settings.fan_speed);
|
||||||
|
|
||||||
puts("[neutrino.cpp] executing " NEUTRINO_LEAVE_STANDBY_SCRIPT ".");
|
puts("[neutrino.cpp] executing " NEUTRINO_LEAVE_STANDBY_SCRIPT ".");
|
||||||
@@ -4173,13 +4174,13 @@ int CNeutrinoApp::exec(CMenuTarget* parent, const std::string & actionKey)
|
|||||||
ShowMsg(LOCALE_SETTINGS_HELP, LOCALE_RECORDINGMENU_HELP, CMsgBox::mbrBack, CMsgBox::mbBack);
|
ShowMsg(LOCALE_SETTINGS_HELP, LOCALE_RECORDINGMENU_HELP, CMsgBox::mbrBack, CMsgBox::mbBack);
|
||||||
}
|
}
|
||||||
else if(actionKey=="shutdown") {
|
else if(actionKey=="shutdown") {
|
||||||
ExitRun(true, 1);
|
ExitRun(1);
|
||||||
}
|
}
|
||||||
else if(actionKey=="reboot")
|
else if(actionKey=="reboot")
|
||||||
{
|
{
|
||||||
FILE *f = fopen("/tmp/.reboot", "w");
|
FILE *f = fopen("/tmp/.reboot", "w");
|
||||||
fclose(f);
|
fclose(f);
|
||||||
ExitRun(true);
|
ExitRun();
|
||||||
unlink("/tmp/.reboot");
|
unlink("/tmp/.reboot");
|
||||||
returnval = menu_return::RETURN_NONE;
|
returnval = menu_return::RETURN_NONE;
|
||||||
}
|
}
|
||||||
|
@@ -119,7 +119,7 @@ private:
|
|||||||
void standbyMode( bool bOnOff, bool fromDeepStandby = false );
|
void standbyMode( bool bOnOff, bool fromDeepStandby = false );
|
||||||
void getAnnounceEpgName(CTimerd::RecordingInfo * eventinfo, std::string &name);
|
void getAnnounceEpgName(CTimerd::RecordingInfo * eventinfo, std::string &name);
|
||||||
|
|
||||||
void ExitRun(const bool write_si = true, int retcode = 0);
|
void ExitRun(int can_shutdown = 0);
|
||||||
void RealRun();
|
void RealRun();
|
||||||
void InitZapper();
|
void InitZapper();
|
||||||
void InitTimerdClient();
|
void InitTimerdClient();
|
||||||
|
@@ -812,7 +812,15 @@ void CControlAPI::HWInfoCGI(CyhookHandler *hh)
|
|||||||
std::string eth_id = netadapter.getMacAddr();
|
std::string eth_id = netadapter.getMacAddr();
|
||||||
std::transform(eth_id.begin(), eth_id.end(), eth_id.begin(), ::tolower);
|
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)
|
void CControlAPI::ShutdownCGI(CyhookHandler *hh)
|
||||||
|
@@ -839,14 +839,16 @@ std::string CNeutrinoYParser::func_get_partition_list(CyhookHandler *, std::str
|
|||||||
std::string CNeutrinoYParser::func_get_boxtype(CyhookHandler *, std::string)
|
std::string CNeutrinoYParser::func_get_boxtype(CyhookHandler *, std::string)
|
||||||
{
|
{
|
||||||
std::string boxvendor(g_info.hw_caps->boxvendor);
|
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)
|
if (boxvendor.compare("Coolstream") == 0)
|
||||||
boxvendor = "CST";
|
boxvendor = "CST";
|
||||||
|
|
||||||
std::string boxname(g_info.hw_caps->boxname);
|
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;
|
return boxvendor + " " + boxname;
|
||||||
}
|
}
|
||||||
|
@@ -927,8 +927,6 @@ const time_settings_struct_t timing_setting[SNeutrinoSettings::TIMING_SETTING_CO
|
|||||||
|
|
||||||
struct SglobalInfo
|
struct SglobalInfo
|
||||||
{
|
{
|
||||||
unsigned char box_Type;
|
|
||||||
bool has_fan;
|
|
||||||
hw_caps_t *hw_caps;
|
hw_caps_t *hw_caps;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user