hoc-overlay: add fan control feature to sysmodule
This commit is contained in:
41
Source/sys-clk/sysmodule/src/fancontrol.h
Normal file
41
Source/sys-clk/sysmodule/src/fancontrol.h
Normal file
@@ -0,0 +1,41 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <math.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/syslimits.h>
|
||||
#include <switch.h>
|
||||
|
||||
#define LOG_DIR "./config/hoc-clk/"
|
||||
#define LOG_FILE "./config/hoc-clk/fan_log.txt"
|
||||
#define CONFIG_DIR "./config/hoc-clk/"
|
||||
#define CONFIG_FILE "./config/hoc-clk/config.dat"
|
||||
#define TABLE_SIZE sizeof(TemperaturePoint) * 10
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int temperature_c;
|
||||
float fanLevel_f;
|
||||
} TemperaturePoint;
|
||||
|
||||
void WriteConfigFile(TemperaturePoint *table);
|
||||
void ReadConfigFile(TemperaturePoint **table_out);
|
||||
|
||||
void InitFanController(TemperaturePoint *table);
|
||||
void FanControllerThreadFunction(void*);
|
||||
void StartFanControllerThread();
|
||||
void CloseFanControllerThread();
|
||||
void WaitFanController();
|
||||
void WriteLog(char *buffer);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user