firmware for my Touchscreen E-Paper Input Module for Framework Laptop 16
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

eepy-launcher: display slot number in info page; fix build

arthomnix 27d116f9 f6676c82

+32 -18
+14 -4
eepy-launcher/src/ui/page/app_info.rs
··· 1 + use core::fmt::Write; 1 2 use eepy_gui::element::button::Button; 2 3 use embedded_graphics::prelude::*; 3 4 use embedded_graphics::primitives::Rectangle; ··· 30 31 Self { 31 32 slot, 32 33 back_button: Button::with_default_style_auto_sized(Point::new(10, 386), "Back", true), 33 - delete_button: Button::with_default_style_auto_sized(Point::new(10, 60), "Delete program", true), 34 + delete_button: Button::with_default_style_auto_sized(Point::new(10, 80), "Delete program", true), 34 35 autostart_button: Button::with_default_style( 35 - Rectangle::new(Point::new(10, 90), Size::new((10 * "Disable autostart".len() + 5) as u32, 20)), 36 + Rectangle::new(Point::new(10, 110), Size::new((10 * "Disable autostart".len() + 5) as u32, 20)), 36 37 Self::autostart_label(slot), 37 38 true 38 39 ), ··· 46 47 fn draw_init(&self, target: &mut EpdDrawTarget) { 47 48 let header = unsafe { slot(self.slot) }; 48 49 49 - Text::new("Program: ", Point::new(10, 20), DEFAULT_TEXT_STYLE) 50 + Text::new("Program:", Point::new(10, 20), DEFAULT_TEXT_STYLE) 50 51 .draw(target) 51 52 .unwrap(); 52 53 ··· 61 62 } 62 63 63 64 64 - Text::new("Version: ", Point::new(10, 40), DEFAULT_TEXT_STYLE) 65 + Text::new("Version:", Point::new(10, 40), DEFAULT_TEXT_STYLE) 65 66 .draw(target) 66 67 .unwrap(); 67 68 ··· 74 75 .draw(target) 75 76 .unwrap(); 76 77 } 78 + 79 + Text::new("Slot:", Point::new(10, 60), DEFAULT_TEXT_STYLE) 80 + .draw(target) 81 + .unwrap(); 82 + let mut slot_s = heapless::String::<2>::new(); 83 + write!(slot_s, "{}", self.slot).unwrap(); 84 + Text::new(&slot_s, Point::new(120, 60), DEFAULT_TEXT_STYLE) 85 + .draw(target) 86 + .unwrap(); 77 87 78 88 self.back_button.draw_init(target); 79 89 self.delete_button.draw_init(target);
+13 -9
eepy-sys/src/critical_section_impl.rs
··· 8 8 unsafe impl critical_section::Impl for EepyCs { 9 9 unsafe fn acquire() -> bool { 10 10 let mut state: usize; 11 - syscall!( 12 - SyscallNumber::CriticalSection, 13 - out state in CsSyscall::Acquire, 14 - ); 11 + unsafe { 12 + syscall!( 13 + SyscallNumber::CriticalSection, 14 + out state in CsSyscall::Acquire, 15 + ); 16 + } 15 17 state != 0 16 18 } 17 19 18 20 unsafe fn release(state: bool) { 19 - syscall!( 20 - SyscallNumber::CriticalSection, 21 - in CsSyscall::Release, 22 - in state, 23 - ); 21 + unsafe { 22 + syscall!( 23 + SyscallNumber::CriticalSection, 24 + in CsSyscall::Release, 25 + in state, 26 + ); 27 + } 24 28 } 25 29 }
+3 -3
eepy/src/flash.rs
··· 30 30 31 31 unsafe { 32 32 let start_ptr: *mut u32 = XIP_BASE.add(start_addr as usize).cast_mut().cast(); 33 - let words = len / 4; 34 - for _ in 0..words { 35 - start_ptr.add(words as usize).write_volatile(0); 33 + let words = len / size_of::<u32>() as u32; 34 + for word in 0..words { 35 + start_ptr.add(word as usize).write_volatile(0); 36 36 } 37 37 } 38 38 }
+2 -2
launcher.x
··· 2 2 ENTRY(entry); 3 3 4 4 MEMORY { 5 - RAM : ORIGIN = 0x20020000, LENGTH = 136K 6 - SLOT: ORIGIN = 0x10000000 + 128K, LENGTH = 128K 5 + RAM : ORIGIN = 0x20020000, LENGTH = 136K 6 + SLOT : ORIGIN = 0x10000000 + 128K, LENGTH = 128K 7 7 } 8 8 9 9 SECTIONS {