3 ms·
I still get a segmentation fault out of that when I run it. I think there's flags you can use to get the linker to not complain about missing main if you give g
by extraduder_ire 3y ago
I still get a segmentation fault out of that when I run it. I think there's flags you can use to get the linker to not complain about missing main if you give gcc an empty file.
The craziest thing I got gcc (the AVR version, specifically) to compile for real purposes was a preprocessor macro that spit out tens of thousands of asm blocks with memory barriers and nop (do nothing) instructions with "PORTB = 1;" in the middle and "PORTB = 0" at the end. I needed it to bitbang out a clock signal to read an RFID tag on poorly documented hardware. (fun fact: the clock the cpu uses on an arduino uno is considerably worse and less accurate than the one that's on the board for the USB chip.)
- SomeoneFromCA 3y agoMust be the internal RC clock? it sucks.
- extraduder_ire 3y agoNope, it's an external one at 16mhz. I think the internal one on the chip can only get up to 8mhz, and is accurate to about +-5% It's enough to work for most things. Only annoying thing is, if you use the ICSP header to set the clock to external, you need a working clock to even use ICSP. (the 328pb falls back to the internal clock in this case)