Skip to content

Commit e80a65d

Browse files
committed
Update stepper crate versions including embedded_common
1 parent 96a33b7 commit e80a65d

6 files changed

Lines changed: 360 additions & 39 deletions

File tree

src/stepper_drivebase_firmware/Cargo.lock

Lines changed: 121 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/stepper_drivebase_firmware/Cargo.toml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
authors = ["Jonah Hopkin <jonahhopkin@gmail.com>", "Evan LaFontaine", "Aavin Fernando", "Jethro Rosettenstein"]
2+
authors = ["Jonah Hopkin <turtle@turtle.business>", "Evan LaFontaine", "Aavin Fernando", "Jethro Rosettenstein"]
33
edition = "2024"
44
readme = "README.md"
55
name = "stepper_drivebase_firmware"
@@ -10,9 +10,9 @@ cortex-m-rt = "0.7"
1010
defmt = "1.1"
1111
defmt-rtt = "1.0"
1212
panic-probe = { version = "1.0", features = ["defmt"] }
13-
canadensis = "0.5.0"
14-
canadensis_data_types = "0.5.0"
15-
canadensis_filter_config = "0.5.0"
13+
canadensis = "0.6.1"
14+
canadensis_data_types = "0.6.0"
15+
canadensis_filter_config = "0.6.0"
1616
heapless = "0.9.3"
1717
embedded-alloc = "0.7.0"
1818
# embedded-io = "0.6.1"
@@ -27,17 +27,18 @@ git = "https://github.com/bluesatunsw/stm32g4xx-hal"
2727
features = ["stm32g474", "rt", "can"]
2828

2929
[dependencies.canadensis_can]
30-
version = "0.5.1"
30+
version = "0.6.0"
3131
features = ["can-fd"]
3232

3333
[dependencies.cortex-m]
3434
version = "0.7"
3535
features = ["critical-section-single-core"]
3636

3737
[dependencies.embedded-common]
38-
version = "0.0.1"
38+
version = "0.1.0"
3939
git = "https://github.com/bluesatunsw/embedded_common/"
40-
features = ["stepper-board"]
40+
branch = "v0.1.0"
41+
features = ["stepper-board", "stm32g474", "can-fd"]
4142

4243
# cargo build/run
4344
[profile.dev]

src/stepper_drivebase_firmware/src/drivebase.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
use embedded_common::{
2-
stepper_bus::{
3-
Channel, ClkPin, DiagPin, EnnPin, StepperBus, StepperNcsPins, StepperSpiPins, ALL_CHANNELS,
4-
},
52
tmc_registers::{
63
AMax, ChopConf, DMax, GConf, GStat, GlobalScalar, IHoldIRun, PwmConf, RampMode, TPowerDown,
74
TPwmThrs, TZeroWait, TmcPosition, UnitlessExt, UnitsExt, VMax, VStart, VStop, XActual,
@@ -11,6 +8,10 @@ use embedded_common::{
118
use hal::{pac, rcc::Rcc};
129
use stm32g4xx_hal as hal;
1310

11+
use crate::stepper_bus::{
12+
Channel, ClkPin, DiagPin, EnnPin, StepperBus, StepperNcsPins, StepperSpiPins, ALL_CHANNELS,
13+
};
14+
1415
/// Gear ratio between the stepper motor shaft and the shaft actually being driven.
1516
const GEAR_RATIO: f32 = 60.;
1617
/// Inverts the position convention for the motors.

src/stepper_drivebase_firmware/src/encoder_bus.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// FIXME!
22

33
use cortex_m::asm::delay;
4-
use embedded_common::stepper_bus::Channel;
4+
use crate::stepper_bus::Channel;
55
use stm32g4xx_hal::{
66
gpio::{AnyPin, Output, AF5, PB13, PB14, PB15},
77
pac::SPI2,

src/stepper_drivebase_firmware/src/main.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ use embedded_common::{
2525
argb::{self, Colour},
2626
can::CanDriver,
2727
clock,
28-
stepper_bus::{Channel, StepperNcsPins},
2928
tmc_registers::TmcPosition,
3029
};
3130
use heapless::Vec;
@@ -49,12 +48,14 @@ use panic_probe as _;
4948
use defmt_rtt as _;
5049

5150
use crate::drivebase::Drivebase;
51+
use crate::stepper_bus::{Channel, StepperNcsPins};
5252

5353
extern crate alloc;
5454

5555
mod as_registers;
5656
mod drivebase;
5757
mod encoder_bus;
58+
mod stepper_bus;
5859

5960
// Cyphal constants
6061
const NODE_ID: u8 = 6;
@@ -63,7 +64,7 @@ const CYPHAL_NUM_TOPICS: usize = 8;
6364
const CYPHAL_NUM_SERVICES: usize = 8;
6465

6566
const HEARTBEAT_PERIOD_US: u32 = 1_000_000;
66-
const TELEM_PERIOD_US: u32 = 1_000;
67+
const TELEM_PERIOD_US: u32 = 50_000;
6768
const TID_TIMEOUT_US: u32 = 100_000;
6869

6970
const ENABLE_TELEM: bool = true;

0 commit comments

Comments
 (0)