532 karma · joined Mar 1, 2019 (7y ago) · 151 submissions
comment 1mo ago · link · parent
comment 2mo ago · link · parent
comment 4mo ago · link · parent
comment 6mo ago · link · parent
comment 9mo ago · link · parent
comment 1y ago · link · parent
comment 1y ago · link · parent
comment 1y ago · link · parent
comment 4y ago · link · parent
My friend's mac would "take off" (fan spun up crazy fast) after every boot/login and I disabled full-text search of documents to fix it. There was probably a weird, maybe not-to-spec pdf/docx on the filesystem that spotlight couldn't parse and got stuck. Kinda dumb that it would waste a 100% usage on one CPU core for a couple minutes every boot though.
comment 5y ago · link · parent
comment 5y ago · link · parent
[0] https://old.reddit.com/r/rust/comments/7qels2/i_wonder_why_g...
comment 5y ago · link · parent
In that article, they have three goals: verify that the pin is correctly configured, use atomic reads and writes, make sure only one thread (including interrupts) can write to a pin at a time.
Spoiler alert, the way they avoid interrupts screwing everything up is with `cortex_m::interrupt::free(|_| {/*read/write pin*/})`, which executes the passed closure in an interrupt-free context. The author's solution isn't atomic, but the borrow checker and the fact that they target single threaded MCU means no one else can be writing to the port at the same time.
comment 5y ago · link · parent
comment 5y ago · link · parent
comment 5y ago · link · parent