From 35dd23091ee4b019bf91ca4459195dfd50900f40 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Wed, 24 Jun 2020 09:14:50 -0600 Subject: [PATCH] system76/common/peci.c: allow board overrides --- src/board/system76/common/peci.c | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/src/board/system76/common/peci.c b/src/board/system76/common/peci.c index 8211713..0c5bfa4 100644 --- a/src/board/system76/common/peci.c +++ b/src/board/system76/common/peci.c @@ -8,10 +8,18 @@ #include // 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 -#define COOLDOWN 10 +#ifdef BOARD_COOLDOWN + #define COOLDOWN BOARD_COOLDOWN +#else + #define COOLDOWN 10 +#endif // Interpolate duty cycle #define INTERPOLATE 0 @@ -35,11 +43,15 @@ struct FanPoint { // Fan curve with temperature in degrees C, duty cycle in percent struct FanPoint __code FAN_POINTS[] = { - FAN_POINT(70, 40), - FAN_POINT(75, 50), - FAN_POINT(80, 60), - FAN_POINT(85, 65), - FAN_POINT(90, 65) +#ifdef BOARD_FAN_POINTS + BOARD_FAN_POINTS +#else + FAN_POINT(65, 40), + 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