pick mipsbox code from DDT, TangoCash and max10

Origin commit data
------------------
Branch: ni/coolstream
Commit: f3f0bdaddb
Author: vanhofen <vanhofen@gmx.de>
Date: 2019-05-03 (Fri, 03 May 2019)

Origin message was:
------------------
- pick mipsbox code from DDT, TangoCash and max10

------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
vanhofen
2019-05-03 22:50:45 +02:00
parent 1ec8ae33b1
commit 27b45a838a
25 changed files with 103 additions and 54 deletions

View File

@@ -64,6 +64,13 @@ static bool usb_icon = false;
static bool timer_icon = false;
#endif
#if HAVE_MIPS_HARDWARE
#define DISPLAY_DEV "/dev/dbox/oled0"
#include <zapit/zapit.h>
static bool usb_icon = false;
static bool timer_icon = false;
#endif
static char volume = 0;
//static char percent = 0;
static bool power = true;
@@ -239,7 +246,7 @@ void CLCD::showServicename(std::string name, bool)
strncpy(display_text, servicename.c_str(), sizeof(display_text) - 1);
display_text[sizeof(display_text) - 1] = '\0';
upd_display = true;
#if HAVE_ARM_HARDWARE
#if HAVE_ARM_HARDWARE || HAVE_MIPS_HARDWARE
wake_up();
#endif
}
@@ -323,7 +330,7 @@ void CLCD::showTime(bool force)
if (force || last_display || (switch_name_time_cnt == 0 && ((hour != t->tm_hour) || (minute != t->tm_min)))) {
hour = t->tm_hour;
minute = t->tm_min;
#if !HAVE_SPARK_HARDWARE && !HAVE_ARM_HARDWARE
#if !HAVE_SPARK_HARDWARE && !HAVE_ARM_HARDWARE && !HAVE_MIPS_HARDWARE
int ret = -1;
#endif
#if HAVE_SPARK_HARDWARE
@@ -334,7 +341,7 @@ void CLCD::showTime(bool force)
#endif
if ((g_info.hw_caps->display_type == HW_DISPLAY_LINE_TEXT) || (g_info.hw_caps->display_type == HW_DISPLAY_LED_NUM))
{
#if HAVE_ARM_HARDWARE
#if HAVE_ARM_HARDWARE || HAVE_MIPS_HARDWARE
if (mode == MODE_STANDBY || (g_settings.lcd_info_line && mode == MODE_TVRADIO))
#else
if (ret < 0 && servicename.empty())
@@ -414,12 +421,12 @@ void CLCD::showVolume(const char vol, const bool update)
SetIcons(SPARK_MUTE, 0);
sprintf(s, vol_fmt[type], volume);
}
#if HAVE_ARM_HARDWARE
#if HAVE_ARM_HARDWARE || HAVE_MIPS_HARDWARE
if (g_info.hw_caps->display_type == HW_DISPLAY_LINE_TEXT)
sprintf(s,"%.*s", volume*g_info.hw_caps->display_xres/100, "================");
#endif
ShowText(s);
#if HAVE_ARM_HARDWARE
#if HAVE_ARM_HARDWARE || HAVE_MIPS_HARDWARE
wake_up();
#endif
vol_active = true;
@@ -436,7 +443,7 @@ void CLCD::showMenuText(const int, const char *text, const int, const bool)
std::string tmp = text;
replace_umlauts(tmp);
ShowText(tmp.c_str());
#if HAVE_ARM_HARDWARE
#if HAVE_ARM_HARDWARE || HAVE_MIPS_HARDWARE
wake_up();
#endif
}
@@ -448,7 +455,7 @@ void CLCD::showAudioTrack(const std::string &, const std::string & title, const
std::string tmp = title;
replace_umlauts(tmp);
ShowText(tmp.c_str());
#if HAVE_ARM_HARDWARE
#if HAVE_ARM_HARDWARE || HAVE_MIPS_HARDWARE
wake_up();
#endif
}
@@ -506,7 +513,7 @@ void CLCD::setMode(const MODES m, const char * const title)
showclock = true;
showTime();
}
#if HAVE_ARM_HARDWARE
#if HAVE_ARM_HARDWARE || HAVE_MIPS_HARDWARE
wake_up();
#endif
}
@@ -553,6 +560,9 @@ void CLCD::setBrightness(int dimm)
#elif HAVE_ARM_HARDWARE
std::string value = to_string(255/15*dimm);
proc_put("/proc/stb/lcd/oled_brightness", value.c_str(), value.length());
#elif HAVE_MIPS_HARDWARE
std::string value = to_string(255/15*dimm);
proc_put("/proc/stb/fp/oled_brightness", value.c_str(), value.length());
#else
(void)dimm; // avoid compiler warning
#endif
@@ -755,7 +765,7 @@ void CLCD::SetIcons(int, bool)
void CLCD::ShowDiskLevel()
{
#if !HAVE_GENERIC_HARDWARE && !HAVE_ARM_HARDWARE
#if !HAVE_GENERIC_HARDWARE && !HAVE_ARM_HARDWARE && !HAVE_MIPS_HARDWARE
int hdd_icons[9] ={24, 23, 21, 20, 19, 18, 17, 16, 22};
int percent, digits, i, j;
uint64_t t, u;
@@ -794,7 +804,7 @@ void CLCD::UpdateIcons()
ShowDiskLevel();
SetIcons(SPARK_USB, usb_icon);
#endif
#if HAVE_SPARK_HARDWARE || HAVE_ARM_HARDWARE
#if HAVE_SPARK_HARDWARE || HAVE_ARM_HARDWARE || HAVE_MIPS_HARDWARE
CZapitChannel * chan = CZapit::getInstance()->GetCurrentChannel();
if (chan)
{