Updating tick rates
This commit is contained in:
parent
330f67d3c8
commit
854f45ae15
@ -103,7 +103,7 @@ const APP: () = {
|
|||||||
stabilizer.dacs.1.start();
|
stabilizer.dacs.1.start();
|
||||||
|
|
||||||
// Start sampling ADCs.
|
// Start sampling ADCs.
|
||||||
//stabilizer.adc_dac_timer.start();
|
stabilizer.adc_dac_timer.start();
|
||||||
|
|
||||||
c.schedule.telemetry(c.start).unwrap();
|
c.schedule.telemetry(c.start).unwrap();
|
||||||
|
|
||||||
@ -231,16 +231,16 @@ const APP: () = {
|
|||||||
|
|
||||||
// Serialize telemetry outside of a critical section to prevent blocking the processing
|
// Serialize telemetry outside of a critical section to prevent blocking the processing
|
||||||
// task.
|
// task.
|
||||||
let _telemetry = miniconf::serde_json_core::to_string::<
|
let telemetry = miniconf::serde_json_core::to_string::<
|
||||||
heapless::consts::U256,
|
heapless::consts::U256,
|
||||||
_,
|
_,
|
||||||
>(&telemetry)
|
>(&telemetry)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
//c.resources.mqtt_interface.client(|client| {
|
c.resources.mqtt_interface.client(|client| {
|
||||||
// // TODO: Incorporate current MQTT prefix instead of hard-coded value.
|
// TODO: Incorporate current MQTT prefix instead of hard-coded value.
|
||||||
// client.publish("dt/sinara/dual-iir/telemetry", telemetry.as_bytes(), minimq::QoS::AtMostOnce, &[]).ok()
|
client.publish("dt/sinara/dual-iir/telemetry", telemetry.as_bytes(), minimq::QoS::AtMostOnce, &[]).ok()
|
||||||
//});
|
});
|
||||||
|
|
||||||
// Schedule the telemetry task in the future.
|
// Schedule the telemetry task in the future.
|
||||||
c.schedule
|
c.schedule
|
||||||
|
@ -10,14 +10,14 @@ impl SystemTimer {
|
|||||||
timer.pause();
|
timer.pause();
|
||||||
// Have the system timer operate at a tick rate of 10KHz (100uS per tick). With this
|
// Have the system timer operate at a tick rate of 10KHz (100uS per tick). With this
|
||||||
// configuration and a 65535 period, we get an overflow once every 6.5 seconds.
|
// configuration and a 65535 period, we get an overflow once every 6.5 seconds.
|
||||||
timer.set_tick_freq(10.khz());
|
timer.set_tick_freq(1.mhz());
|
||||||
timer.apply_freq();
|
timer.apply_freq();
|
||||||
|
|
||||||
timer.resume();
|
timer.resume();
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn ticks_from_secs(secs: u32) -> i32 {
|
pub fn ticks_from_secs(secs: u32) -> i32 {
|
||||||
(secs * 10_000) as i32
|
(secs * 1_000_000) as i32
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -27,7 +27,7 @@ impl rtic::Monotonic for SystemTimer {
|
|||||||
fn ratio() -> rtic::Fraction {
|
fn ratio() -> rtic::Fraction {
|
||||||
rtic::Fraction {
|
rtic::Fraction {
|
||||||
numerator: 1,
|
numerator: 1,
|
||||||
denominator: 40000,
|
denominator: 400,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user