Skip to content

Commit

Permalink
uart misbehaving >:(
Browse files Browse the repository at this point in the history
  • Loading branch information
sky-dragn committed Feb 22, 2024
1 parent 9828584 commit 3ef817a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions src/bin/minimal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ mod app {
&mut rcc.apb2
);
gps_uart.listen(serial::Event::Rxne);
rtic::pend(Interrupt::USART1);
// rtic::pend(Interrupt::USART1);

// Spawn tasks
display_task::spawn().unwrap();
Expand Down Expand Up @@ -183,7 +183,9 @@ mod app {
#[task(binds = USART1, shared = [gps])]
fn on_uart(mut cx: on_uart::Context) {
info!("hewwo");
cx.shared.gps.lock(|gps| gps.handle());
cx.shared.gps.lock(|gps| {
gps.handle();
});
}

#[task(binds = RTC_WKUP)]
Expand Down
2 changes: 1 addition & 1 deletion src/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ impl<SPI, CS> SharpMemDisplay<SPI, CS>
.fold(
self.driver.start(UPDATE_BIT), // command byte
|trn, (y, row)|
trn.send(&[y as u8]) // address byte
trn.send(&[(y + 1) as u8]) // address byte, row is 1-indexed
.send(row) // row data
.send(&[0x00]) // spacing byte
)
Expand Down
4 changes: 2 additions & 2 deletions src/gps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ use ublox::{PacketRef, Parser};
use tinyvec::ArrayVec;

pub struct Gps<SERIAL> {
serial: SERIAL,
parser: Parser<ArrayVec<[u8; 256]>>
pub serial: SERIAL,
pub parser: Parser<ArrayVec<[u8; 256]>>
}

impl<SERIAL> Gps<SERIAL>
Expand Down

0 comments on commit 3ef817a

Please sign in to comment.