Support fan PWM settings #73
|
@ -286,4 +286,4 @@ Please note that power doesn't correlate with the actual speed linearly.
|
||||||
3. `fcurve <a> <b> <c>` - set coefficients of the controlling curve `a*x^2 + b*x + c`, where `x` is `abs_max_tec_i/MAX_TEC_I`,
|
3. `fcurve <a> <b> <c>` - set coefficients of the controlling curve `a*x^2 + b*x + c`, where `x` is `abs_max_tec_i/MAX_TEC_I`,
|
||||||
i.e. receives values from 0 to 1 linearly tied to the maximum current. The controlling curve should produce values from 0 to 1,
|
i.e. receives values from 0 to 1 linearly tied to the maximum current. The controlling curve should produce values from 0 to 1,
|
||||||
as below and beyond values would be substituted by 0 and 1 respectively.
|
as below and beyond values would be substituted by 0 and 1 respectively.
|
||||||
4. `fan-restore` - restore fan settings to defaults: `auto = true, a = 1.0, b = 0.0, c = 0.0`.
|
4. `fan-restore` - restore fan settings to defaults: `auto = true, a = 1.0, b = 0.0, c = 0.04`.
|
||||||
|
|
|
@ -69,7 +69,7 @@
|
||||||
buildInputs = with pkgs; [
|
buildInputs = with pkgs; [
|
||||||
rustPlatform.rust.rustc
|
rustPlatform.rust.rustc
|
||||||
rustPlatform.rust.cargo
|
rustPlatform.rust.cargo
|
||||||
openocd dfu-util gcc-arm-embedded-10
|
openocd dfu-util
|
||||||
] ++ (with python3Packages; [
|
] ++ (with python3Packages; [
|
||||||
numpy matplotlib
|
numpy matplotlib
|
||||||
]);
|
]);
|
||||||
|
|
|
@ -1,7 +1,17 @@
|
||||||
use core::fmt;
|
use core::fmt;
|
||||||
use core::num::ParseIntError;
|
use core::num::ParseIntError;
|
||||||
use core::str::{from_utf8, Utf8Error};
|
use core::str::{from_utf8, Utf8Error};
|
||||||
use nom::{IResult, branch::alt, bytes::complete::{is_a, tag, take_while1}, character::{is_digit, complete::{char, one_of}}, combinator::{complete, map, opt, value}, sequence::preceded, multi::{fold_many0, fold_many1}, error::ErrorKind, Needed};
|
use nom::{
|
||||||
|
IResult,
|
||||||
|
branch::alt,
|
||||||
|
bytes::complete::{is_a, tag, take_while1},
|
||||||
|
character::{is_digit, complete::{char, one_of}},
|
||||||
|
combinator::{complete, map, opt, value},
|
||||||
|
sequence::preceded,
|
||||||
|
multi::{fold_many0, fold_many1},
|
||||||
|
error::ErrorKind,
|
||||||
|
Needed,
|
||||||
|
};
|
||||||
use num_traits::{Num, ParseFloatError};
|
use num_traits::{Num, ParseFloatError};
|
||||||
use serde::{Serialize, Deserialize};
|
use serde::{Serialize, Deserialize};
|
||||||
|
|
||||||
|
|
|
@ -138,9 +138,9 @@ fn main() -> ! {
|
||||||
|
|
||||||
usb::State::setup(usb);
|
usb::State::setup(usb);
|
||||||
|
|
||||||
let mut channels = RefCell::new(Channels::new(pins));
|
|
||||||
|
|
||||||
let mut store = flash_store::store(dp.FLASH);
|
let mut store = flash_store::store(dp.FLASH);
|
||||||
|
|
||||||
|
let mut channels = RefCell::new(Channels::new(pins));
|
||||||
for c in 0..CHANNELS {
|
for c in 0..CHANNELS {
|
||||||
match store.read_value::<ChannelConfig>(CHANNEL_CONFIG_KEY[c]) {
|
match store.read_value::<ChannelConfig>(CHANNEL_CONFIG_KEY[c]) {
|
||||||
Ok(Some(config)) =>
|
Ok(Some(config)) =>
|
||||||
|
|
Loading…
Reference in New Issue