Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
Sapozhnik
Jan 2, 2005

Nap Ghost
the c standard doesn't let you do that unfortunately. you need c++ "constexpr" (ugh) to be able to do that.

you can define it as a freestanding enum constant though.

enum { fart = 100, butt = fart + 1 };

Adbot
ADBOT LOVES YOU

Sapozhnik
Jan 2, 2005

Nap Ghost
well, shifting by more than the word size is also undefined. on some arches you get zero, on others the high-order bits of the shift parameter are ignored.

Sapozhnik
Jan 2, 2005

Nap Ghost
yeah like java, where >> means arithmetic right shift, a thing you'd want to do, ever

logical right shift is >>>

Sapozhnik
Jan 2, 2005

Nap Ghost
jfc i'm pretty sure i could do a better job than that and i've never designed a pcb before in my life

Sapozhnik
Jan 2, 2005

Nap Ghost
why does anybody use atmel for anything

it was an iffy choice even before microchip bought them out and jacked up all the prices 500%

like it's not a bad 8-bit architecture by any means, it's just that we live in the year 2017 and cost-competitive 32-bit microcontrollers which can be targeted by the same compilers that see massive use for desktop and server applications are things that exist

Sapozhnik
Jan 2, 2005

Nap Ghost
You can get NXP cm0 chips in dip packaging

Lol nothing you interface with is gonna be 5v grandpa

Sapozhnik
Jan 2, 2005

Nap Ghost
gently caress device trees gently caress raspberries pi gently caress everything

i ain't got time to get a phd in whatever semi-undocumented stupid mmio layout description language the linux gophers are using this week

Sapozhnik
Jan 2, 2005

Nap Ghost
good news, i'm not modifying kernel code! i just want this loving thing to boot in a usable state!

bindings docs are poo poo so yes i guess you do have to go code spleunking in practice to figure out what the actual gently caress is going on

like, why the poo poo doesn't this uart work? gpio pinmux? lack of a clock signal to the functional block?? who the gently caress knows???

the raspberry pi 3 is the only embedded platform i've seen where it is far easier to get a framebuffer console than it is to get a uart console and that's just perversely impressive somehow

Sapozhnik
Jan 2, 2005

Nap Ghost
oh i'm well aware it's just a broadcom marketing exercise

but hmm do i buy a 1GHz 1GB quad core compute module which has a well known retail price of $40 or do i speak to some other vendor's loving salesprick who wants to see how far into the three figures he can push his luck

Sapozhnik
Jan 2, 2005

Nap Ghost
yeah and if you can meet a 3000 unit moq then you can get an actual application soc and put it right on your design, pi cm isn't intended for large volume applications

that and the pi cm doesn't particularly serve the goals of broadcom's marketing department so they actually put a fairly juicy profit margin on it

Adbot
ADBOT LOVES YOU

Sapozhnik
Jan 2, 2005

Nap Ghost
the kinetis mcu found on the teensy 3 is, shall we say, the dick dastardly of microcontrollers

it is fast but it is also bad

  • Locked thread