system76/common/peci.c: allow board overrides

This commit is contained in:
Jeremy Soller 2020-06-24 09:14:50 -06:00
parent fc990f8043
commit 35dd23091e
No known key found for this signature in database
GPG Key ID: E988B49EE78A7FB1

View File

@ -8,10 +8,18 @@
#include <ec/pwm.h> #include <ec/pwm.h>
// Fan speed is the lowest requested over HEATUP seconds // Fan speed is the lowest requested over HEATUP seconds
#define HEATUP 10 #ifdef BOARD_HEATUP
#define HEATUP BOARD_HEATUP
#else
#define HEATUP 10
#endif
// Fan speed is the highest HEATUP speed over COOLDOWN seconds // Fan speed is the highest HEATUP speed over COOLDOWN seconds
#define COOLDOWN 10 #ifdef BOARD_COOLDOWN
#define COOLDOWN BOARD_COOLDOWN
#else
#define COOLDOWN 10
#endif
// Interpolate duty cycle // Interpolate duty cycle
#define INTERPOLATE 0 #define INTERPOLATE 0
@ -35,11 +43,15 @@ struct FanPoint {
// Fan curve with temperature in degrees C, duty cycle in percent // Fan curve with temperature in degrees C, duty cycle in percent
struct FanPoint __code FAN_POINTS[] = { struct FanPoint __code FAN_POINTS[] = {
FAN_POINT(70, 40), #ifdef BOARD_FAN_POINTS
FAN_POINT(75, 50), BOARD_FAN_POINTS
FAN_POINT(80, 60), #else
FAN_POINT(85, 65), FAN_POINT(65, 40),
FAN_POINT(90, 65) FAN_POINT(70, 60),
FAN_POINT(75, 75),
FAN_POINT(80, 90),
FAN_POINT(85, 100)
#endif
}; };
// Get duty cycle based on temperature, adapted from // Get duty cycle based on temperature, adapted from