Skip to content
This repository has been archived by the owner on Aug 17, 2021. It is now read-only.

Commit

Permalink
static, not const.
Browse files Browse the repository at this point in the history
  • Loading branch information
thejpster committed Oct 13, 2018
1 parent 62a0972 commit f2e416b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 15 deletions.
6 changes: 2 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,11 @@ use monotron_synth::*;
use tm4c123x_hal::interrupt;
use cortex_m_rt::{entry, exception};

const VERSION: &'static str = env!("CARGO_PKG_VERSION");
const GIT_DESCRIBE: &'static str = env!("GIT_DESCRIBE");
const ISR_LATENCY: u32 = 94;

// Must come first
static mut APPLICATION_RAM: [u8; 24 * 1024] = [0u8; 24 * 1024];

static VERSION: &'static str = env!("CARGO_PKG_VERSION");
static GIT_DESCRIBE: &'static str = env!("GIT_DESCRIBE");
static mut G_SYNTH: Synth = Synth::new(80_000_000 / 2112);
static mut FRAMEBUFFER: fb::FrameBuffer<VideoHardware> = fb::FrameBuffer::new();

Expand Down
2 changes: 1 addition & 1 deletion src/rust_logo.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub const RUST_LOGO_DATA: [u8; 384 * 288 / 8] = [
pub static RUST_LOGO_DATA: [u8; 384 * 288 / 8] = [
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
Expand Down
20 changes: 10 additions & 10 deletions src/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,62 +7,62 @@ use menu;
pub(crate) type Menu<'a> = menu::Menu<'a, Context>;
pub(crate) type Item<'a> = menu::Item<'a, Context>;

const ITEM_CLEAR: Item = Item {
static ITEM_CLEAR: Item = Item {
item_type: menu::ItemType::Callback(item_clear),
command: "clear",
help: Some("Resets the display."),
};

const ITEM_PEEK: Item = Item {
static ITEM_PEEK: Item = Item {
item_type: menu::ItemType::Callback(item_peek),
command: "peek",
help: Some("<addr> - Read a register."),
};

const ITEM_POKE: Item = Item {
static ITEM_POKE: Item = Item {
item_type: menu::ItemType::Callback(item_poke),
command: "poke",
help: Some("<addr> <value> - Write a register."),
};

const ITEM_DUMP: Item = Item {
static ITEM_DUMP: Item = Item {
item_type: menu::ItemType::Callback(item_dump),
command: "dump",
help: Some("<addr> <bytes> - Dump RAM/ROM."),
};

const ITEM_LOAD: Item = Item {
static ITEM_LOAD: Item = Item {
item_type: menu::ItemType::Callback(item_load_file),
command: "load",
help: Some("<len> - Load program from UART."),
};

const ITEM_DEBUG: Item = Item {
static ITEM_DEBUG: Item = Item {
item_type: menu::ItemType::Callback(item_debug_info),
command: "debug",
help: Some("Show some debug info."),
};

const ITEM_RUN: Item = Item {
static ITEM_RUN: Item = Item {
item_type: menu::ItemType::Callback(item_run_program),
command: "run",
help: Some("Run loaded program."),
};

const ITEM_BEEP: Item = Item {
static ITEM_BEEP: Item = Item {
item_type: menu::ItemType::Callback(item_beep),
command: "beep",
help: Some("Make a beep."),
};

const ITEM_DEMOS: Item = Item {
static ITEM_DEMOS: Item = Item {
item_type: menu::ItemType::Menu(&demos::DEMO_MENU),
command: "demos",
help: Some("Enter demo menu."),
};


pub(crate) const ROOT_MENU: Menu = Menu {
pub(crate) static ROOT_MENU: Menu = Menu {
label: "root",
items: &[
&ITEM_CLEAR,
Expand Down

0 comments on commit f2e416b

Please sign in to comment.