Skip to content

Commit

Permalink
Switch to rtt/jlink for example debug output
Browse files Browse the repository at this point in the history
  • Loading branch information
tstellanova committed Apr 13, 2020
1 parent 40d1eab commit 3e8383a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 2 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cst816s"
version = "0.1.3"
version = "0.1.4"
authors = ["Todd Stellanova <[email protected]>"]
edition = "2018"
description = "CST816S touchscreen driver for embedded hal / no_std"
Expand All @@ -27,8 +27,7 @@ embedded-hal = {version ="0.2.3", features = ["unproven"] }
[dev-dependencies]
cortex-m-rt = "0.6.12"
nrf52832-hal = {version = "0.8.1", default-features = false, features = ["xxAA-package", "rt"]}
panic-halt = "0.2.0"
panic-rtt-core = {version="0.1.0"}
st7789 = { git = "https://github.com/tstellanova/st7789" }
#st7789 = { path = "../st7789"}
shared-bus = {version = "0.1.4", features = ["cortexm"] }
embedded-graphics = "0.6.0"
7 changes: 6 additions & 1 deletion examples/touchpad.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#![no_std]
#![no_main]

extern crate panic_halt; // you can put a breakpoint on `rust_begin_unwind` to catch panics
use panic_rtt_core::{self, rtt_init_print, rprintln};

use nrf52832_hal as p_hal;
use p_hal::gpio::{GpioExt, Level};
Expand Down Expand Up @@ -36,6 +36,8 @@ const SCREEN_RADIUS: u32 = (MIN_SCREEN_DIM / 2) as u32;
///
#[entry]
fn main() -> ! {
rtt_init_print!(NoBlockTrim);

let cp = pac::CorePeripherals::take().unwrap();
let mut delay_source = Delay::new(cp.SYST);

Expand All @@ -53,6 +55,8 @@ fn main() -> ! {
let mut vibe = port0.p0_16.into_push_pull_output(Level::High).degrade();
pulse_vibe(&mut vibe, &mut delay_source, 10);

rprintln!("\r\n--- BEGIN ---");

// internal i2c0 bus devices: BMA421 (accel), HRS3300 (hrs), CST816S (TouchPad)
// BMA421-INT: P0.08
// TP-INT: P0.28
Expand Down Expand Up @@ -113,6 +117,7 @@ fn main() -> ! {

if let Some(evt) = touchpad.read_one_touch_event(true) {
refresh_count += 1;
rprintln!("{:?}",evt);

draw_marker(&mut display, &evt, rand_color);
let vibe_time = match evt.gesture {
Expand Down

0 comments on commit 3e8383a

Please sign in to comment.