Skip to content

Commit

Permalink
Merge branch 'main' of github.com:zarath/subtone
Browse files Browse the repository at this point in the history
  • Loading branch information
zarath committed Sep 22, 2023
2 parents 9e545d1 + e697a13 commit 9b420e3
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 2 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,4 @@ opt-level = 's'
[features]
default = []
call-tone = []
rotate = []
3 changes: 3 additions & 0 deletions Prototype_2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions Prototype_2b.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ Prefer tantalum caps for better switching supression.

![prototype](Prototype.jpg "Prototype attached to 23cm tranciever")

![prototype](Prototype_2.jpg "First prototype PCB (needs a bodge)")
![prototype](Prototype_2b.jpg "First prototype PCB (needs a bodge, backside)")

Waveform Example
----------------

Expand Down
9 changes: 7 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ include!(concat!(env!("OUT_DIR"), "/fontmap.rs"));
const ADDR_OFFSET: u32 = 2 * 1024 * 1024 - 4096;
const FLASH_SIZE: usize = 2 * 1024 * 1024;

#[cfg(not(feature = "rotate"))]
const DISP_ROTATION: DisplayRotation = DisplayRotation::Rotate0;
#[cfg(feature = "rotate")]
const DISP_ROTATION: DisplayRotation = DisplayRotation::Rotate180;

#[cfg(not(feature = "call-tone"))]
const SUBTONES: [f32; 51] = [
67.0, 69.3, 71.9, 74.4, 77.0, 79.7, 82.5, 85.4, 88.5, 91.5, 94.8, 97.4, 100.0, 103.5, 107.2,
Expand Down Expand Up @@ -250,8 +255,8 @@ async fn core0_task(

info!("Set up Display");
let interface = I2CDisplayInterface::new(i2c);
let ref mut display = Ssd1306::new(interface, DisplaySize128x64, DisplayRotation::Rotate180)
.into_buffered_graphics_mode();
let ref mut display =
Ssd1306::new(interface, DisplaySize128x64, DISP_ROTATION).into_buffered_graphics_mode();
display.init().unwrap();
display.set_brightness(Brightness::DIM).unwrap();

Expand Down

0 comments on commit 9b420e3

Please sign in to comment.