- Registriert
- 24 März 2008
- Beiträge
- 2.952
Hallo,
ich weiss, dass ich mit dem S12 (noch) alleine dastehe, aber Aufgrund der Ähnlichkeit zum S10(e) hoffe ich doch auf Eure Unterstützung...
Zugegeben, ich bin kein NHC- und Script-Profi, aber ich habe es wenigstens geschafft, dass NHC ein geändertes S10(e) bzw. N500 Profil anzeigt.
Es stammt aus dem eeepcnews.de Forum.
Nur kommt leider die Meldung "ERROR - ACPI Control System problem detected."

Das Profil wird nicht umgesetzt: Der Lüfter startet bei 45Grad und schaltet sich nicht mehr ab (=Werkseinstellung).
Die CPU-Temperatur liegt dann bei laufenden Lüfter zwischen 39 und 44Grad, die HD bei 35Grad.
Kann jemand von Euch einen Fehler entdecken?
Lenovo.xml:
S12.cs:
NHC legt auch eine 10,0 KB grosse S12.dll im acpi-Ordner ab.
Wo liegt der Hund begraben?
Vielen Dank, Martin
ich weiss, dass ich mit dem S12 (noch) alleine dastehe, aber Aufgrund der Ähnlichkeit zum S10(e) hoffe ich doch auf Eure Unterstützung...
Zugegeben, ich bin kein NHC- und Script-Profi, aber ich habe es wenigstens geschafft, dass NHC ein geändertes S10(e) bzw. N500 Profil anzeigt.
Es stammt aus dem eeepcnews.de Forum.
Nur kommt leider die Meldung "ERROR - ACPI Control System problem detected."

Das Profil wird nicht umgesetzt: Der Lüfter startet bei 45Grad und schaltet sich nicht mehr ab (=Werkseinstellung).
Die CPU-Temperatur liegt dann bei laufenden Lüfter zwischen 39 und 44Grad, die HD bei 35Grad.
Kann jemand von Euch einen Fehler entdecken?
Lenovo.xml:
Code:
<?xml version="1.0"?>
<Lenovo>
<Model name="20021,2959" location="SYSTEM" class="S12" file="S12.cs" />
</Lenovo>
Code:
//
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// N o t e b o o k H a r d w a r e C o n t r o l A C P I D L L
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Example class only
//
// It is recommended to use a c# editor which supports c# syntax highlighting
// and supports the directive #region and #endregion. With these directives
// the source code is much more readable and it is easy to hide or show block
// of code (for example you can use the c# editor "SharpDevelop 2.0").
//
public static class LENOVO
{
#region Computer model : class S12
//
public static class S12
{
public static class FAN
{
// Info
public const string description = "Notebook FAN Control";
public const bool default_enable = false;
public const int icon = 2;
// Condition variables (optional)
public static bool initialisation = false;
public static bool enable = false;
#region Value class for QUIET_FAN_CONTROL : class QUIET_FAN_CONTROL
//
public static class QUIET_FAN_CONTROL
{
// Properties of the value class
public const string description = "Quiet fan control";
public const bool nhc_visible = true; // true -> value is visible in NHC
// Value
public static int quiet_fan_control = 0; // It must have the same name as the class
// (case are ignored)
public const string unit = ""; // unit of value
// With this class it is possible to change the value in NHC on runtime
public static class NHC_WRITE
{
public const bool nhc_write = true; // true -> it is possible to change the
// value in NHC
public const int nhc_minimum_value = 0; // the minimum value
public const int nhc_maximum_value = 1; // the maximum value
public const int nhc_default_value = 1; // the default value
}
}
//
#endregion
#region Value class for CPU_FAN_ON_TEMP : class CPU_FAN_ON_TEMP
//
public static class CPU_FAN_ON_TEMP
{
// Properties of the value class
public const string description = "CPU FAN ON Temperature";
public const bool nhc_visible = true; // true -> value is visible in NHC
// Value
public static int cpu_fan_on_temp = 0; // It must have the same name as the class
// (case are ignored)
public const string unit = "°C"; // unit of value
// With this class it is possible to change the value in NHC on runtime
public static class NHC_WRITE
{
public const bool nhc_write = true; // true -> it is possible to change the
// value in NHC
public const int nhc_minimum_value = 40; // the minimum value
public const int nhc_maximum_value = 65; // the maximum value
public const int nhc_default_value = 55; // the default value
}
}
//
#endregion
#region Value class for CPU_FAN_OFF_TEMP : class CPU_FAN_OFF_TEMP
//
public static class CPU_FAN_OFF_TEMP
{
// Properties of the value class
public const string description = "CPU FAN OFF Temperature";
public const bool nhc_visible = true; // true -> value is visible in NHC
// Value
public static int cpu_fan_off_temp = 0; // It must have the same name as the class
// (case are ignored)
public const string unit = "°C"; // unit of value
// With this class it is possible to change the value in NHC on runtime
public static class NHC_WRITE
{
public const bool nhc_write = true; // true -> it is possible to change the
// value in NHC
public const int nhc_minimum_value = 20; // the minimum value
public const int nhc_maximum_value = 60; // the maximum value
public const int nhc_default_value = 45; // the default value
}
}
//
#endregion
#region Public definition: CPU temperatures
//
public static int cpu_temperature = 0;
//
#endregion
#region FAN Control highspeed refresh function : highspeed_refresh()
private const int TEMP_HYSTERESIS = 5; // If the temperature is equal or higher
// as (FAN_ON_TEMP.fan_on_temp +
// TEMP_HYSTERESIS) then the FAN Control
// is given back to the system
private const int TEMP_HYSTERESIS_QUIET_FAN = 8; // Temperature hysteresis for quiet fan control
private const int TEMP_CPU_FAN_LOW_SPEED = 52; // Temperature for low speed FAN operation
private const int TEMP_CPU_FAN_OFF = 35; // Temperature for FAN off
private static bool nhc_fan_control_disabled = true; // NHC fan control disabled (FAN is controlled by BIOS because high temperature)
private static bool nhc_fan_on = false; // Actual state of the FAN
private static bool quiet_fan_state = false; // For quiet fan control
private static bool quiet_fan_running = false;
private static bool quiet_fan_control_active = false; // Quiet control active flag
private static int quiet_fan_control_read_temp_counter = 0;
private static int temp_cpu = 0;
private static int written_temp_cpu = 0;
private static bool cpu_temperature_updated = false;
public const int highspeed_refresh_interval = 50;
public static bool highspeed_refresh()
{
// 1. Get CPU temperatures
if (!quiet_fan_control_active || (quiet_fan_control_read_temp_counter == 0))
{
// If quiet control active do not read temperatures on every refresh to save CPU cycles
if (ACPI.FIELD.ReadByOffset("_SB.PCI0.LPCB.EC0.ERAM", ref temp_cpu, 0x51, 8) == false) { return false; }
}
// 2. Save the CPU temperatures (only if the CPU temperature is not the same
// as the last written CPU temperature)
if (quiet_fan_control_active)
{
// Wait for both CPU temperatures
if (quiet_fan_control_read_temp_counter == 0)
{
if (temp_cpu != written_temp_cpu)
{
cpu_temperature = temp_cpu;
cpu_temperature_updated = true;
}
if (cpu_temperature_updated)
{
quiet_fan_control_read_temp_counter = 20; // 20 * 50 ms = 2000 ms read temperatures period in quiet fan control
}
}
else
{
cpu_temperature_updated = false;
}
}
else
{
if (temp_cpu != written_temp_cpu)
{
cpu_temperature = temp_cpu;
}
}
quiet_fan_control_active = false;
// Check high temperatures
if (nhc_fan_control_disabled || (cpu_temperature > CPU_FAN_ON_TEMP.cpu_fan_on_temp + TEMP_HYSTERESIS))
{
// Too high temperature, disable NHC fan control and allow the BIOS firmware to do the dirty colling work
if (cpu_temperature <= CPU_FAN_OFF_TEMP.cpu_fan_off_temp)
{
// Colled (thanks BIOS :-)), NHC controls FAN
nhc_fan_control_disabled = false;
}
else
{
nhc_fan_control_disabled = true;
}
return true;
}
// Check normal temperature operation range
if (nhc_fan_on)
{
if (cpu_temperature <= CPU_FAN_OFF_TEMP.cpu_fan_off_temp)
{
// Colled, switch off fan
nhc_fan_on = false;
}
}
else
{
if (cpu_temperature >= CPU_FAN_ON_TEMP.cpu_fan_on_temp)
{
// Too high temperature, switch on fan
nhc_fan_on = true;
}
}
// FAN hardware control
if (nhc_fan_on)
{
// Run FAN at low speed
if (temp_cpu != TEMP_CPU_FAN_LOW_SPEED)
{
if (ACPI.FIELD.WriteByOffset("_SB.PCI0.LPCB.EC0.ERAM", TEMP_CPU_FAN_LOW_SPEED, 0x51, 8) == false) { return false; }
written_temp_cpu = TEMP_CPU_FAN_LOW_SPEED;
}
}
else
{
// QUIET fan control
if (cpu_temperature >= CPU_FAN_OFF_TEMP.cpu_fan_off_temp)
{
quiet_fan_running = true;
}
if (cpu_temperature <= CPU_FAN_OFF_TEMP.cpu_fan_off_temp - 3)
{
quiet_fan_running = false;
}
if ((QUIET_FAN_CONTROL.quiet_fan_control == 1) && quiet_fan_running)
{
// Change periodically ON/OFF states of the fan. It causes low speed fan operation
quiet_fan_control_active = true;
if (!quiet_fan_state)
{
quiet_fan_state = true;
if (ACPI.FIELD.WriteByOffset("_SB.PCI0.LPCB.EC0.ERAM", TEMP_CPU_FAN_OFF, 0x51, 8) == false) { return false; }
written_temp_cpu = TEMP_CPU_FAN_OFF;
}
else
{
quiet_fan_state = false;
if (ACPI.FIELD.WriteByOffset("_SB.PCI0.LPCB.EC0.ERAM", TEMP_CPU_FAN_LOW_SPEED, 0x51, 8) == false) { return false; }
written_temp_cpu = TEMP_CPU_FAN_LOW_SPEED;
}
if (quiet_fan_control_read_temp_counter > 0) quiet_fan_control_read_temp_counter--;
}
else
{
// Switch off FAN
if (temp_cpu != TEMP_CPU_FAN_OFF)
{
if (ACPI.FIELD.WriteByOffset("_SB.PCI0.LPCB.EC0.ERAM", TEMP_CPU_FAN_OFF, 0x51, 8) == false) { return false; }
written_temp_cpu = TEMP_CPU_FAN_OFF;
}
}
}
return true;
}
//
#endregion
}
#region Thermal Zone class for CPU Temperature : class TZ00
//
public static class TZ00 // If the name of the Thermal Zone class is the same as the name of
// an existing thermal zone in the system then NHC will overwrite
// the system thermal zone
{
// Info
public const string description = "CPU Temperature"; // Description of current class
public const bool default_enable = true; // false = By default the current
// class is disabled in NHC
public const int icon = 5; // 5 = Temperature icon
public const bool thermal_zone = true; // NHC will interpret this class as
// a Thermal Zone class if this
// value is true
#region Value class for _TMP : class _TMP
//
public static class _TMP
{
// Properties of the value class
public const string description = "Current CPU Temperature"; // Description of current
// value
public const bool nhc_visible = true; // true -> value is visible in NHC
// Value
public static int _tmp = 0; // It must have the same name as the class
// (case are ignored)
public const string unit = "°C"; // unit of the example_value class.
}
//
#endregion
public const int refresh_interval = 1; // <= 1 -> 1 Second; 2 -> 2 Seconds ...
public static bool refresh()
{
if (FAN.enable == true)
{
_TMP._tmp = FAN.cpu_temperature; // read cpu temperature from FAN control
return true;
}
else
{
// get CPU temperature form Embedded Controller
return ACPI.FIELD.ReadByOffset("_SB.PCI0.LPCB.EC0.ERAM", ref _TMP._tmp, 0x51, 8);
}
}
}
//
#endregion
}
}
#endregion
NHC legt auch eine 10,0 KB grosse S12.dll im acpi-Ordner ab.
Wo liegt der Hund begraben?
Vielen Dank, Martin






