Skip to content

Commit

Permalink
Update esp-hal to fix timings
Browse files Browse the repository at this point in the history
  • Loading branch information
bugadani committed Feb 18, 2024
1 parent 42919dd commit b8835f2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
11 changes: 11 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,17 @@ smoltcp = { workspace = true }
crc = "3.0.1"
enumset = "1.1.3"

[patch.crates-io]
esp32-hal = { git = "https://github.com/esp-rs/esp-hal", rev = "deb9f212845212a6f0bfcd9df0a12484ece59894" }
esp32s2-hal = { git = "https://github.com/esp-rs/esp-hal", rev = "deb9f212845212a6f0bfcd9df0a12484ece59894" }
esp32s3-hal = { git = "https://github.com/esp-rs/esp-hal", rev = "deb9f212845212a6f0bfcd9df0a12484ece59894" }
esp32c2-hal = { git = "https://github.com/esp-rs/esp-hal", rev = "deb9f212845212a6f0bfcd9df0a12484ece59894" }
esp32c3-hal = { git = "https://github.com/esp-rs/esp-hal", rev = "deb9f212845212a6f0bfcd9df0a12484ece59894" }
esp32c6-hal = { git = "https://github.com/esp-rs/esp-hal", rev = "deb9f212845212a6f0bfcd9df0a12484ece59894" }
esp32h2-hal = { git = "https://github.com/esp-rs/esp-hal", rev = "deb9f212845212a6f0bfcd9df0a12484ece59894" }
esp-hal-procmacros = { git = "https://github.com/esp-rs/esp-hal", rev = "deb9f212845212a6f0bfcd9df0a12484ece59894" }
esp-hal-common = { git = "https://github.com/esp-rs/esp-hal", rev = "deb9f212845212a6f0bfcd9df0a12484ece59894" }

[features]
default = ["defmt"]

Expand Down
14 changes: 9 additions & 5 deletions src/board/startup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::{
drivers::{battery_monitor::BatteryMonitor, frontend::Frontend},
hal::{
clock::Clocks,
dma::DmaPriority,
dma::{DmaDescriptor, DmaPriority},
gpio::OutputPin as _,
interrupt, peripherals,
spi::{
Expand Down Expand Up @@ -119,8 +119,10 @@ impl StartupResources {
display_cs.connect_peripheral_to_output(display_spi.cs_signal());

const DESCR_SET_COUNT: usize = 1;
static mut DISP_SPI_DESCRIPTORS: [u32; DESCR_SET_COUNT * 3] = [0; DESCR_SET_COUNT * 3];
static mut DISP_SPI_RX_DESCRIPTORS: [u32; DESCR_SET_COUNT * 3] = [0; DESCR_SET_COUNT * 3];
static mut DISP_SPI_DESCRIPTORS: [DmaDescriptor; DESCR_SET_COUNT] =
[DmaDescriptor::EMPTY; DESCR_SET_COUNT];
static mut DISP_SPI_RX_DESCRIPTORS: [DmaDescriptor; DESCR_SET_COUNT] =
[DmaDescriptor::EMPTY; DESCR_SET_COUNT];
let display_spi = Spi::new(display_spi, 40u32.MHz(), SpiMode::Mode0, clocks)
.with_sck(display_sclk.into())
.with_mosi(display_mosi.into())
Expand Down Expand Up @@ -171,8 +173,10 @@ impl StartupResources {
unwrap!(adc_cs.set_high().ok());

const DESCR_SET_COUNT: usize = 1;
static mut ADC_SPI_DESCRIPTORS: [u32; DESCR_SET_COUNT * 3] = [0; DESCR_SET_COUNT * 3];
static mut ADC_SPI_RX_DESCRIPTORS: [u32; DESCR_SET_COUNT * 3] = [0; DESCR_SET_COUNT * 3];
static mut ADC_SPI_DESCRIPTORS: [DmaDescriptor; DESCR_SET_COUNT] =
[DmaDescriptor::EMPTY; DESCR_SET_COUNT];
static mut ADC_SPI_RX_DESCRIPTORS: [DmaDescriptor; DESCR_SET_COUNT] =
[DmaDescriptor::EMPTY; DESCR_SET_COUNT];

ExclusiveDevice::new(
Spi::new(adc_spi, 1u32.MHz(), SpiMode::Mode1, clocks)
Expand Down

0 comments on commit b8835f2

Please sign in to comment.