Skip to content

Commit

Permalink
Add 'pub' where necessary to build a binary with this crate.
Browse files Browse the repository at this point in the history
  • Loading branch information
jgouly committed Oct 24, 2016
1 parent ecccae0 commit 64cdbe2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions src/action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use matrix::Matrix;
use state::KeyState;

const MAX_PACKET_SIZE: usize = 6;
struct USBBuffer {
pub struct USBBuffer {
data: [u32; MAX_PACKET_SIZE],
count: usize,
}
Expand All @@ -20,11 +20,11 @@ impl USBBuffer {
}
}

trait Layout {
pub trait Layout {
fn process_action(&self, row: usize, col: usize, state: KeyState, buf: &mut USBBuffer);
}

fn process_actions<SM: Matrix<KeyState>, L: Layout>(states: SM, layout: &L) -> USBBuffer {
pub fn process_actions<SM: Matrix<KeyState>, L: Layout>(states: SM, layout: &L) -> USBBuffer {
let mut buf = USBBuffer::new();
for c in 0..states.get_num_columns() {
for r in 0..states.get_num_rows() {
Expand Down
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#![cfg_attr(not(test), no_std)]

#[macro_use]
mod matrix;
mod matrix_config;
pub mod matrix;
pub mod matrix_config;
pub mod scan;
mod state;
mod action;
pub mod state;
pub mod action;
6 changes: 3 additions & 3 deletions src/scan.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
use matrix::Matrix;
use matrix_config::MatrixConfig;

trait InputPin {
pub trait InputPin {
fn read_input(&self) -> u32;
}

trait OutputPin {
pub trait OutputPin {
fn set_low(&self);
fn set_high(&self);
}

fn single_scan<MC: MatrixConfig, RM: Matrix<u32>>(conf: &MC) -> RM
pub fn single_scan<MC: MatrixConfig, RM: Matrix<u32>>(conf: &MC) -> RM
where MC::InputPin: InputPin,
MC::OutputPin: OutputPin
{
Expand Down
2 changes: 1 addition & 1 deletion src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ impl Default for KeyState {
}
}

fn process_key_state<RM, SM>(result: RM, previous_result: RM) -> SM
pub fn process_key_state<RM, SM>(result: RM, previous_result: RM) -> SM
where RM: Matrix<u32>,
SM: Matrix<KeyState>
{
Expand Down

0 comments on commit 64cdbe2

Please sign in to comment.