| 145 | | return fmtExtra (alarm, beep); |
| 146 | | } |
| 147 | | |
| 148 | | static const char * |
| 149 | | fmtInt |
| 150 | | (const double values[], int alarm, int beep) { |
| 151 | | sprintf (buff, "%d", (int) values[0]); |
| 152 | | return fmtExtra (alarm, beep); |
| 153 | | } |
| 154 | | |
| 155 | | static const char * |
| 156 | | fmtIntCrossInt |
| 157 | | (const double values[], int alarm, int beep) { |
| 158 | | sprintf (buff, "%dx%d", (int) values[0], (int) values[1]); |
| 159 | | return fmtExtra (alarm, beep); |
| 160 | | } |
| 161 | | |
| 162 | | static const char * |
| 163 | | fmtIntDashInt |
| 164 | | (const double values[], int alarm, int beep) { |
| 165 | | sprintf (buff, "%d-%d", (int) values[0], (int) values[1]); |
| 933 | | /** DDCMON **/ |
| 934 | | |
| 935 | | static const char * |
| 936 | | fmtID_DDCMON |
| 937 | | (const double values[], int alarm, int beep) { |
| 938 | | int value = (int) values[0]; |
| 939 | | buff[0] = ((value >> 10) & 0x1f) + '@'; |
| 940 | | buff[1] = ((value >> 5) & 0x1f) + '@'; |
| 941 | | buff[2] = (value & 0x1f) + '@'; |
| 942 | | buff[3] = ((value >> 20) & 0xf) + '0'; |
| 943 | | buff[4] = ((value >> 16) & 0xf) + '0'; |
| 944 | | buff[5] = ((value >> 28) & 0xf) + '0'; |
| 945 | | buff[6] = ((value >> 24) & 0xf) + '0'; |
| 946 | | buff[7] = '\0'; |
| 947 | | return buff; |
| 948 | | } |
| 949 | | |
| 950 | | static const char *ddcmon_names[] = { |
| 951 | | SENSORS_DDCMON_PREFIX, NULL |
| 952 | | }; |
| 953 | | |
| 954 | | static const FeatureDescriptor ddcmon_features[] = { |
| 955 | | { fmtID_DDCMON, NULL, DataType_other, 0, 0, |
| 956 | | { SENSORS_DDCMON_ID, -1 } }, |
| 957 | | { fmtInt, NULL, DataType_other, 0, 0, |
| 958 | | { SENSORS_DDCMON_SERIAL, -1 } }, |
| 959 | | { fmtIntCrossInt, NULL, DataType_other, 0, 0, |
| 960 | | { SENSORS_DDCMON_VERSIZE, SENSORS_DDCMON_HORSIZE, -1 } }, |
| 961 | | { fmtIntDashInt, NULL, DataType_other, 0, 0, |
| 962 | | { SENSORS_DDCMON_VERSYNCMIN, SENSORS_DDCMON_VERSYNCMAX, -1 } }, |
| 963 | | { fmtIntDashInt, NULL, DataType_other, 0, 0, |
| 964 | | { SENSORS_DDCMON_HORSYNCMIN, SENSORS_DDCMON_HORSYNCMAX, -1 } }, |
| 965 | | { NULL } |
| 966 | | }; |
| 967 | | |
| 968 | | static const ChipDescriptor ddcmon_chip = { |
| 969 | | ddcmon_names, ddcmon_features, 0, 0 |
| 970 | | }; |
| 971 | | |