[0]: https://github.com/FrameworkComputer/EmbeddedController/blob...
Testing was done [0], but it's not written in an easy-to-understand way. As a summary, Thinkpad keys are scrambled within 15-23 ms. Usually, humans ascribe scrambled letters to their own mistakes, but this time it's the keyboard's fault. Lenovo continues to ignore the issue.
One very stupid solution for your password is to change its letters to go from right to left. That way the scrambling will become anti-scrambling and you can type your password even faster than on a normal keyboard!
On top of that, I didn’t know what the issue was and it drove me nuts until I figured it out. Left a very bad taste in my mouth for Lenovo/ThinkPad despite all the love they receive.
Intuitively, this means register the event when you see the first edge, not once the bounces have finished.
For an example of incorrect denouncing, see most articles on denouncing (the hackaday article comes to mind), and the QMK firmware last time I checked (most keyboard set the denounce time to zero, so the debounce time just becomes the update rate).
c and c2 loop variables so a typo can hose you horribly. A global variable to hold the array length. ! instead of comparison to 0. Having to offset the second loop by 1. Early return which means the function will normally work fine but might result in N^2 extra time depending upon the data state. A bit trick relying on unsigned underflow without pointing out that unsigned is a key constraint even though it has a comment. An extra missing const on the incoming pointer (should be: const uint8_t * const). Braces left off the short-circuit if conditionals.
The worst part is I have personally written tons of functions like this. This is a "normal" function in C--in fact, it's far better than average.
The fact that you write C like this just shows how much we need something better.
This is a microcontroller firmware. Moving what is essentially a constant around the stack would be insanity.
> ! instead of comparison to 0
Not a problem and even idiomatic.
> Early return which means the function will normally work fine but might result in N^2 extra time depending upon the data state.
It only takes N^2 time when all columns have at least one key pressed but not have at least two rows in common in any of them (except maybe the last two) - hardly a state that you care that much about. Would you really want to increase the latency/power consumption for single key presses just to have the exceptional case not be slower than normal?
If you wanted to you could restrict the early exit with the same test for having at least two bits set. If the key matrix has no unused slots you would then only check if there is another column which shares any set row bits (because it would then share all of them), which could let you make the algorithm O(n) with some additional memory for row bit counts. But the code would be more complicated and the number of columns is not dymanic. Plus the key matrix most likely has unused slots precisely to avoid ghosting for common combinations.
> A bit trick relying on unsigned underflow without pointing out that unsigned is a key constraint even though it has a comment.
The variable with type is declared right before the bit trick. If you change it to signed when there are bit operations, especially ones you don't understand, then you deserve what you get. However, this trick does not rely on unsigned underflow. the only concern with signed (assuming two's complement) would be if the sign bit is the only one set, in which case the signed underflow would be undefined at the language level - but not a problem at the hardware level since two's complement addition/subtraction is exactly the same as unsigned addition/subtraction.
> An extra missing const on the incoming pointer (should be: const uint8_t * const).
const on the outside of function parameter types (as opposed to inside them) does not change how the function can be called. Sure, you could make all local variables const if they can be but for such a tiny function that really does not add anything.
> Braces left off the short-circuit if conditionals.
Meh, that is a code style choice and no reason to complain about C. Also not really that dangerous with modern compilers that warn based on misleading indentation.
And you missed the actually bad part of the function: The comment that says the colummns are ORed together when they are ANDed.
[0]: https://hackaday.com/2010/11/09/debounce-code-one-post-to-ru...
I kind of want to buy a framework though, just to support them? But I have no use for another laptop, let alone a small 12" one! Should I get one anyway because, what the hell, why not? Should I wait and then jump on one if/when they release a larger model?
Anybody else have similar feelings?
Edit to add:
I also have one of the last Thinkpad models that support S3 sleep (T480 -- within a model or two, I think?), which is currently super critical for Linux... I need to be able to close the lid and come back after a week.
It's easy to blame the manufacturers for this, but the consistent answer seems to be "Intel's Tiger Lake platform does not support S3 sleep," and all of the system builders base their work on what Intel's reference platform does. So short of going to extreme effort to hack it together themselves (something that is likely not their specialty), reasonable sleep behavior is not going to be an option unless Intel brings S3 back, or does work to improve the S0ix states.
I absolutely do not want to support the no-more-S3 clusterfuck right now.
Just adding to e-waste down the line, and I'm sure they are selling enough units.
In the future when you do actually need/want a new laptop of course it would be great to support them then. And advocate for them when a friend asks about what laptop to buy.
It drives me absolutely nuts when I open my bag and feel the heat coming out of it, and my laptop is left with 20% charge.
Apple has been able to do "clever" things while asleep, like waking up the wifi chipset periodically to check for email / messages / notifications / updates, so that when you wake up, everything magically feels ready to go instead of feeling like you just woke up from 1984 and have reams of crap to download.
But this only works well because Apple does their own firmware for most of the machine, and seems to do a reasonably good job, despite a few issues. They're careful about only doing things that aren't going to obliterate the battery in a way that would be surprising.
Microsoft is jealous of this functionality and knows they want something like that for Windows. They also know they need to cater to the lowest common denominator with system builders, so they asked Intel to put this kind of capability into their platforms, and to explicitly disable the old modes, so that system builders wouldn't be able to drag their feet. The result is that they've all switched, but the outcomes are generally poor and high variance. Sometimes they're passably okay within Windows, but not always. It'll probably get better, but for now things are crap, especially on Linux.
Not that I blame them, there are many different sleep states from core/package level [0] that map onto system/platform level sleep states [1]. Fucking confusing, and I'm sure something is waking it up. Have you checked Windows Task Scheduler? My college laptop had a Norton Antivirus scan wakeup at 5am every day and would be re-enabled every Windows Update, similar pain to you
[0] https://www.intel.com/content/www/us/en/support/articles/000... [1] https://www.tenforums.com/tutorials/63346-sleep-states-avail...
My wife (a teacher) loves his 13" one, it's ideal for her to make video calls, write emails etc.
For me as a developer at least 15" is a must, even though I love Framework, I'll only buy if they release a 15" or 16" version.
I'd like to support their cause, but like you, I have way too many machines that already work well enough, that I can't justify another purchase unless it would offer a substantial improvement over my current setup (old ThinkPads). Plus I really can't function without a Trackpoint ;)
So I'm holding out a generation or two to reconsider. I hope they improve.
I'm gonna be really honest here and say that people have a very distorted subjective idea of what a 'sturdy laptop' is like. A lot of marketing money has been spent to make people think the only way to have a strong object is for it to be made of a rigid metal or glass material, so people go "oh my god the lid can FLEX this thing will break if I drop it!" but that's not at all how things work.
The truth is you can't really just guess at whether a thing will survive falling or whatever by looking at or touching it. The only thing that tells you anything really is actual experience and/or testing.
(personally, I think my framework laptop feels plenty sturdy for all the subjective anecdata that's worth, it's just not designed in a way that's trying to scream at you "you can run it over with a truck and it will work perfectly")
Sources please. That's news to me.
I checked my Apple elitism at the door and I put my name down for a Framework in September and got it in October. Happy ever since. It's a great little laptop and would highly recommend others.
If it's published data, mind sharing a link?
Can’t comment on the trackpoint, which is something I’ve never personally liked, but if that’s a deal breaker, you’ll probably have to have a Thinkpad. But I’ve been very pleased with the build quality of my Framework.
I've been thinking about selling my current beefy laptop (razer blade 15) since I end up doing all my MCAD/ECAD work on my desktop anyway, and moving back to Manjaro on my laptop which only really gets used for software/firmware anyway.
But, I read so many horror stories about linux firmware glitchyness and poor battery life that I gave up on the idea. If I can just by a used thinkpad from a few generations ago that might be perfect.
It should be said I run a pretty minimal system (dwm, st, Vim, stuff like that) and usually throttle the system to "powersave", mostly because the fans will never spin up with it. It's a bit slower, but still plenty fast enough for me.
XPS 15 laptops appear to have an unresolved mouse lag issue that is noticeable under linux (but seems to happen in Windows too). Seems to not happen with external mice. Annoying but not a big deal. There is an open issue for it but no patch yet.
* very few people can solder a cpu and I've never heard of a heatsink needing replacement
Then go for the Framework one.
I want paid Linux support upfront.
I don’t want to pay for Windows support, remove it and then run unsupported Linux on my laptop.
A manufacturer saying “this is a Windows laptop but we won’t stop you running Linux on it” isn’t really good enough for what I want.
That only applies to the prebuild laptop. The DIY edition gives you the option to buy the laptop without an operating system. It's fairly easy to assemble the DIY edition yourself and save money by DIY.
They officially support Linux: https://frame.work/blog/linux-on-the-framework-laptop
Overall great machine
Edit: I may be missing software updates that improve this, no idea
Battery life in operation is excellent, but it does drain 30% in 8 hours when on suspend which is a bit much. Not a dealbreaker but hope this can be solved.
If you don't care about pixels (seems common in PC-land), this is probably a good thing re: power consumption.
I look at text all day, every day, and want it to be high res. It's been high res on my Macs for half a decade, and my XPS is even better. I'll get one of these once they fix the screen.
Just the same (not that it appears to be a problem with Framework, though it's easy to make the same mistake), country != language.
Please treat Currency != Language != Country. Give options to change these.
Their github also doesn't have any mention of coreboot: https://github.com/FrameworkComputer
And it isn't here either: https://doc.coreboot.org/mainboard/index.html
- AMD processor options
- Keyboards with a trackpoint - decades of ThinkPaddery have conditioned me; I regularly use a Dell touchpad-equipped laptop & contemporary Mac laptop and still pine for a trackpoint. Very personal preference, I know, but hopefully the Framework Marketplace comes to provide this.
- Proper 14" HiDPI screen
- Long battery life under Linux
I'm impressed with what they've been able to do and really hope they become sustainably successful!
I can't stress this enough. The display on the Framework can't do integer scaling and so almost everyone who intends to use an external monitor with the Framework can't do that on Linux without extremely annoying issues such as significantly higher input latency, GUI apps behaving abnormally, and not being able to use an external monitor and the laptop screen simultaneously. I don't care if they release Coreboot for the Framework, it's useless with its screen.
It doesn't seem to have a proper 14 inch HiDPI display. 1080p on 14 inches usually needs anywhere from 1.2x to 1.4x scaling and 4K would need around 2.5x scaling.
Guess what was the most frequently used key? Cursor down followed by cursor up.
For example, cursor down was pressed ~2.5x more times than space, or ~4 times more than letter E, which is was the most frequently used letter.
Guess what are the smallest keys on a Mac-type keyboard (the layout also used by the Framework laptop). Cursor up and down. Madness.
Ive also seen a laptop with the arrow keys slightly offset downward.
https://github.com/jhallen/rsa-verify
On the other hand, if you are looking for some generic embedded system code all in C, here is our library (it's been cleaned up for ATSAM and STM32 targets, but we've used in on many other platforms):
https://github.com/nklabs/libnklabs
I think it's most unique feature is the embedded schema-based database- so you can save things like calibration and configuration information in local flash memory (think protocol buffers, but for tiny systems). Recently I've been adding device drivers for all common devices I can find on break-out boards from the Arduino and Raspberry-PI communities.
Upsides:
- Hardware feels VERY premium and nice. It's not too heavy. You'd never guess it's the first laptop made by a new company.
- Keyboard is a pleasure to type on. I did nanowrimo last year on it and wrote ~60k words and never had a complaint.
- Company and its mission are awesome! Support team is very helpful and their communication has been great.
- Guides on the website for opening it up and replacing/fixing parts is amazing. If anything I hope I can keep this thing running for many many years.
- Choosing what ports you want via the expansion cards is really nice (USB-C charging on BOTH sides of the laptop?!?! amazing)
Downsides:
- Battery could be better. I get probably 3-6 hours on Win11 depending on what I'm doing.
- It can get HOT. I have the i7 processor; doing light dev work with a few Docker images running and VSCode with a medium-sized Node project open, it gets uncomfortably warm on my lap and the fan occasionally spins up. I played through Inscryption on it (awesome indie game, built in Unity) and the fan was EXTREMELY loud during the whole thing because it was making heavy work of the integrated graphics card. Just browsing the web or watching videos it is cool and silent, though.
- Because of issues with Tiger Lake, S3 sleep isn't supported so if it sleeps when you close the lid, the battery will continue to drain for a bit and eventually it'll go into hibernation. I set mine to just go into hibernation when the lid is closed which saves the battery more if I'm on-the-go. It takes around 11 seconds to wake from hibernation which isn't bad. Not an issue with the Framework specifically, I think this affects all Tiger Lake processors.
- Expansion cards are a bit of a novelty for me. I have 2x USB-C, 1x USB-A, 1X HDMI and don't see myself changing that any time soon and can't really think of any expansion cards I'd need in the future.
Looking forward the question at the top of my mind is "will this actually be upgradeable?"... if they ever release AMD or ARM-based processors, it'd be great to try them out, but you'd have to swap out the whole mainboard which is a bummer (but understandable given the hardware constraints). Different screen sizes would require a whole new laptop but at least you could bring along the internals. A touch screen would be really nice.
I'm admittedly a hobbyist/novice programmer, but this isn't necessarily what I'd call light.
On the expansion card front, I think I tweeted to them about doing some kind of card bay to put a USB dongle in.
* https://guides.frame.work/Guide/Fedora+35+Installation+on+th...
* https://guides.frame.work/Guide/Ubuntu+21.10+Installation+on...
(Coreboot is not an option for real computers because it doesn't have menus and various other things.)
https://github.com/qca/open-ath9k-htc-firmware https://github.com/chunkeey/carl9170fw http://netweb.ing.unibs.it/~openfwwf/
None for recent WiFi standards though.
Other open firmware:
...That said, not a subject matter expert so take this with a grain of rock salt.
I might go do some shopping then. Say hello to Linus btw, his video has done marvels to deservedly promote your product.
For public, general usage baseband, it will need to be at least tamper evident and you won't be able to just run your own.
I'd personally be fine with auditable baseband (i.e. you can always verify what code it runs, then let's say compare to public code tree and build hashes), with possibly a signature scheme that would link builder and certifications. Then if you went to the trouble of proving you have the necessary qualifications and won't break shit, you could sign with your own certificate and take responsibility.
https://projects.osmocom.org/projects/quectel-modems/
I can't find the post right now, but there are folks reverse engineering the proprietary binaries running under Linux on the PinePhone modem (which is Qectel) and replacing them with open source versions. The Hexagon DSP is out of reach for that work though.
Otherwise, very nice news!
Language and physical location are disjoint. Even worse when I know the original content is in English, my preferred language, but someone decides I only deserve the partial translation.
There's even a website for this issue
http://www.flagsarenotlanguages.com/blog/why-flags-do-not-re...
- :us-flag: United States [USD]
- :ca-flag: Canada (English) [CAD]
The Hindi argument is not good, Hindi is the _official_ language of India. I work with people from various parts of India and they can all communicate with each other because thry all speak Hindu/English (usually a mixture in conversation), even if their main language is Malayalam.
There are issues with flags = languages (e.g. "Welsh": "Gaelic" for instance, or Switzerland (which one?), but for English/Spanish examples, they are not good ones to use
And to end this, just because there is a website for your issues doesn't mean it's correct. There is nothing preventing someone from making a website called flagsarelanguages.com and having poo counter points to the original websites poo arguments. Appeal to authority nonsense.
I’m of the opinion to not worry about it and just use the flags. It’s enough effort to properly internationalize a site and keep it maintained. That it’s available at all is a huge effort. Debating flags vs a drop down with languages is nitpicking IMO.
Plus, when the language codes include a country it’s a natural UI decision.
EDIT: Supporting multiple languages increases the complexity of the entire development pipeline. Translation teams are brought in, translation tools are brought in to support in-code language as well as translations in the database itself. Every new text snippet needs to be translated to each language to deploy it.
Your search features get more complicated, date formats, number formats, currency, collations. Every language you add increases this complexity. Because of that, you will represent a language with a primary country and not every language spoken in that country. On the chance that a company has opted to go all in to support region specific dialects of languages where 100+ choices will be listed, then no…of course flags wouldn’t work. But in most cases you’re lucky to get 2 languages at all with potential for a couple more for all but the largest of companies. Virtually every other site is just going to use one and churn out some Google translations or ask you to do that yourself.
After considering all that, yes…just use flags.
Why not use full language names?
I am very tired of seeing one flag represent my language where that is the newer nation using that language as national language. But that language is spoken for a thousand years or more in other regions.
This:
Use the user locale. Expressed as a geographic region (which you can use to compute the best possible region to serve the user from) and a language (used to render the page).
If you do it correctly you can support weird combinations, such as a German speaker living in California (expects prices in USD). Or the country of Switzerland (one territory, 4 official languages).
Language auto detection^W assumption is such an anti-feature.
/rant
edit: I see I am not alone, who got hit by this.
Like if you're in Germany, you can set Google's language to English, but you're gonna get mainly German results for any search. A bizarre choice.
As for why it does not get used, MDN suggests[1] it's because changing it may lead to fingerprinting but there are likely other historical reasons.
[0]: https://datatracker.ietf.org/doc/html/rfc2616#section-14.4
[1]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Ac...
But some sites just don't care about it and try detect this base on other information.
edit: formatting
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Ac...
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Ac...
Quote from their website: “ Base and Performance configurations ship with Windows 10 Home pre-installed and Professional ships with Windows 10 Pro pre-installed. You can also load your own operating system later, like a Linux distribution.”