mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-27 23:42:58 +02:00
system/setting_helpers.cpp: add static CFanControlNotifier::setSpeed,
to call it direct
This commit is contained in:
@@ -494,24 +494,26 @@ int CDataResetNotifier::exec(CMenuTarget* /*parent*/, const std::string& actionK
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CFanControlNotifier::changeNotify(const neutrino_locale_t, void * data)
|
void CFanControlNotifier::setSpeed(unsigned int speed)
|
||||||
{
|
{
|
||||||
int cfd, ret;
|
int cfd;
|
||||||
//unsigned char speed = (unsigned char) g_settings.fan_speed;
|
|
||||||
unsigned int speed = * (int *) data;
|
|
||||||
|
|
||||||
printf("FAN Speed %d\n", speed);
|
printf("FAN Speed %d\n", speed);
|
||||||
cfd = open("/dev/cs_control", O_RDONLY);
|
cfd = open("/dev/cs_control", O_RDONLY);
|
||||||
if(cfd < 0) {
|
if(cfd < 0) {
|
||||||
perror("Cannot open /dev/cs_control");
|
perror("Cannot open /dev/cs_control");
|
||||||
return false;
|
return;
|
||||||
}
|
}
|
||||||
ret = ioctl(cfd, IOC_CONTROL_PWM_SPEED, speed);
|
if (ioctl(cfd, IOC_CONTROL_PWM_SPEED, speed) < 0)
|
||||||
close(cfd);
|
|
||||||
if(ret < 0) {
|
|
||||||
perror("IOC_CONTROL_PWM_SPEED");
|
perror("IOC_CONTROL_PWM_SPEED");
|
||||||
return false;
|
|
||||||
}
|
close(cfd);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CFanControlNotifier::changeNotify(const neutrino_locale_t, void * data)
|
||||||
|
{
|
||||||
|
unsigned int speed = * (int *) data;
|
||||||
|
setSpeed(speed);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -155,6 +155,7 @@ class CFanControlNotifier : public CChangeObserver
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
bool changeNotify(const neutrino_locale_t, void * data);
|
bool changeNotify(const neutrino_locale_t, void * data);
|
||||||
|
static void setSpeed(unsigned int speed);
|
||||||
};
|
};
|
||||||
|
|
||||||
class CCpuFreqNotifier : public CChangeObserver
|
class CCpuFreqNotifier : public CChangeObserver
|
||||||
|
Reference in New Issue
Block a user