mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-02 03:52:11 +08:00
33d5cfc393
date: 2025-12-18T23:23:16 master commit: 3cdee7b54718ee14bd85befd6c5bad3d699c5479
20 lines
402 B
C
20 lines
402 B
C
#pragma once
|
|
|
|
struct fan_state_t {
|
|
uint16_t tach_counter;
|
|
uint16_t rpm;
|
|
uint8_t power;
|
|
float error_integral;
|
|
uint8_t stall_counter;
|
|
uint8_t stall_threshold;
|
|
uint8_t total_stall_count;
|
|
uint8_t cooldown_counter;
|
|
};
|
|
extern struct fan_state_t fan_state;
|
|
|
|
void fan_set_power(uint8_t percentage);
|
|
void llfan_init(void);
|
|
void fan_init(void);
|
|
// Call this at FAN_TICK_FREQ
|
|
void fan_tick(void);
|