File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
common/recipes-core/fan-ctrl/fan-ctrl Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 78
78
79
79
#include " watchdog.h"
80
80
81
+ #define USERVER_ERROR_THRESHOLD INTERNAL_TEMPS (120 )
82
+
81
83
#if !defined(CONFIG_LIGHTNING)
82
84
/* Sensor definitions */
83
85
@@ -768,6 +770,21 @@ int read_temp(const char *device, int *value) {
768
770
usleep (10000 );
769
771
}
770
772
773
+ if (strstr (device, USERVER_TEMP_DEVICE)) {
774
+ retry = 0 ;
775
+ if (*value > USERVER_ERROR_THRESHOLD) {
776
+ while (retry++ <= 3 ) {
777
+ *value = 0 ;
778
+ rc = read_device (full_name, value);
779
+ usleep (10000 );
780
+ }
781
+ if (*value > USERVER_ERROR_THRESHOLD) {
782
+ syslog (LOG_CRIT, " Userver(COMe) temperature read error, value:%d. \n " , (*value)/1000 );
783
+ *value = BAD_TEMP;
784
+ }
785
+ }
786
+ }
787
+
771
788
return rc;
772
789
}
773
790
#endif
@@ -1505,6 +1522,10 @@ int write_fan_led(const int fan, const char *color) {
1505
1522
}
1506
1523
1507
1524
int server_shutdown (const char *why) {
1525
+ if (0 == access (" /mnt/data/etc/not_shutdown_come" , F_OK))
1526
+ {
1527
+ return 0 ;
1528
+ }
1508
1529
int fan;
1509
1530
for (fan = 0 ; fan < total_fans; fan++) {
1510
1531
write_fan_speed (fan + fan_offset, fan_max);
You can’t perform that action at this time.
0 commit comments