improve braille testing flags, make them more consistent

i wonder if there isn't a workspace-level way to flip a flag...
This commit is contained in:
bunnie 2021-09-07 19:11:54 +08:00
parent 3f998dd6e4
commit ccbe7c479f
7 changed files with 14 additions and 5 deletions

View file

@ -35,6 +35,5 @@ utralib = {path = "../../utralib"}
[features]
debugprint = []
slowstatus = [] # used for braille mode, so console isn't overwhelmed with status
# default = ["debugprint"] # "debugprint"
default = []

View file

@ -28,4 +28,5 @@ minifb = {version = "0.19.2", git = "https://github.com/xobs/rust_minifb.git", r
[features]
debugprint = []
braille = []
default = [] # "debugprint"

View file

@ -480,7 +480,9 @@ fn xmain() -> ! {
tv.text.as_str().unwrap().len()
);
}
log::debug!("{}", tv);
if cfg!(feature = "braille") {
log::info!("{}", tv);
}
let do_xor = tv.invert;
blitstr::paint_str(
display.native_buffer(),

View file

@ -25,4 +25,5 @@ utralib = {path = "../../utralib"}
[features]
debugprint = []
debuginject = [] # used only if you want key injection via the UART
braille = []
default = ["debuginject"] # "debugprint"

View file

@ -293,13 +293,19 @@ mod implementation {
let ticktimer = ticktimer_server::Ticktimer::new().expect("couldn't connect to ticktimer");
let timestamp = ticktimer.elapsed_ms();
let default_map = if cfg!(feature = "braille") {
KeyMap::Braille
} else {
KeyMap::Qwerty
};
let mut kbd = Keyboard {
conn: xous::connect(sid).unwrap(),
csr: CSR::new(csr.as_mut_ptr() as *mut u32),
new_state: HashSet::with_capacity(16), // pre-allocate space since this has to work in an interrupt context
last_state: HashSet::with_capacity(16),
ticktimer,
map: KeyMap::Qwerty,
map: default_map,
delay: 500,
rate: 20,
shift_down: false,

View file

@ -37,6 +37,6 @@ chrono = "0.4"
[features]
debugprint = []
slowstatus = [] # used for braille mode, so console isn't overwhelmed with status
braille = [] # used for braille mode, so console isn't overwhelmed with status
# default = ["debugprint"] # "debugprint"
default = []

View file

@ -277,7 +277,7 @@ fn xmain() -> ! {
let stats_interval;
let batt_interval;
let secnotes_interval;
if cfg!(feature = "slowstatus") {
if cfg!(feature = "braille") {
// lower the status output rate for braille mode, debugging, etc.
stats_interval = 30;
batt_interval = 60;