Compare commits

..

No commits in common. "a332b5fcdc3f25c1a5be7da71109f04b0c96e7de" and "9e23b14ace8dc7dc59df8fedefddbf2bf2dbbf75" have entirely different histories.

4 changed files with 9 additions and 21 deletions

View File

@ -77,14 +77,3 @@ The scope of this setting is per TCP session.
| `save` | Save configuration to EEPROM |
| `reset` | Reset the device |
| `ipv4 <X.X.X.X>` | Configure IPv4 address |
## USB
The firmware includes experimental support for acting as a USB-Serial
peripheral. Debug logging will be sent there by default (unless build
with logging via semihosting.)
**Caveat:** This logging does not flush its output. Doing so would
hang indefinitely if the output is not read by the USB host. Therefore
output will be truncated once buffers are full.

View File

@ -121,7 +121,7 @@ fn report_to(channel: usize, channels: &mut Channels, socket: &mut TcpSocket) ->
#[entry]
fn main() -> ! {
init_log();
info!("thermostat");
info!("tecpak");
let mut cp = CorePeripherals::take().unwrap();
cp.SCB.enable_icache();
@ -388,10 +388,9 @@ fn main() -> ! {
});
// Apply new IPv4 address
new_ipv4_address.map(|new_ipv4_address| {
server.set_ipv4_address(ipv4_address);
ipv4_address = new_ipv4_address;
});
new_ipv4_address.map(|ipv4_address|
server.set_ipv4_address(ipv4_address)
);
// Update watchdog
wd.feed();

View File

@ -52,20 +52,20 @@ impl Controller {
// partial
let p = f64::from(self.parameters.kp) * error;
// integral
self.integral += f64::from(self.parameters.ki) * error;
//integral
self.integral += error;
if self.integral < self.parameters.integral_min.into() {
self.integral = self.parameters.integral_min.into();
}
if self.integral > self.parameters.integral_max.into() {
self.integral = self.parameters.integral_max.into();
}
let i = self.integral;
let i = f64::from(self.parameters.ki) * f64::from(self.integral);
// derivative
let d = match self.last_input {
None => 0.0,
Some(last_input) => f64::from(self.parameters.kd) * (last_input - input),
Some(last_input) => f64::from(self.parameters.kd) * (last_input - input)
};
self.last_input = Some(input);

View File

@ -30,7 +30,7 @@ impl State {
let serial = SerialPort::new(bus);
let dev = UsbDeviceBuilder::new(bus, UsbVidPid(0x16c0, 0x27dd))
.manufacturer("M-Labs")
.product("thermostat")
.product("tecpak")
.device_release(0x20)
.self_powered(true)
.device_class(usbd_serial::USB_CLASS_CDC)