#avr Logs

Oct 19 2018

#avr Calendar

04:23 AM nohit: --
09:14 AM rue_mohr: hmm
09:21 AM kakimir: anyone have any rule of thumb how many lines of code goes to 1Kilo of program space?
09:21 AM kakimir: 1000?
09:21 AM rue_mohr: 1, for long lines of code
09:22 AM kakimir: yes
09:22 AM rue_mohr: there isn't much relation
09:22 AM kakimir: I once wrote 600char long condition
09:22 AM kakimir: actually I didn't because I got so confused I had to atomize it
09:23 AM rue_mohr: for example PORTD = PORTD &= ~0x80;
09:23 AM rue_mohr: is one instruction
09:23 AM rue_mohr: but
09:23 AM rue_mohr: for example myvar = myvar & ~0x80;
09:23 AM rue_mohr: is about 5 instructions
09:23 AM polprog: printf() is not :)
09:24 AM polprog: technically, kakimir didnt ask what language the code was i
09:24 AM polprog: in*
09:24 AM rue_mohr: kakimir, just write the code, let the compiler do the work
09:24 AM polprog: :P
09:24 AM kakimir: can I tell to compiler that I want this block of code compiled in way order doesn't matter
09:24 AM polprog: you can use avr-size to check the sizes
09:24 AM polprog: what?
09:24 AM polprog: why would you do it
09:24 AM kakimir: ie. if I have lines of IO initialization
09:24 AM rue_mohr: kakimir, your overthinking it again
09:24 AM polprog: if it doesnt matter, it will optimize it itself.
09:24 AM kakimir: one pin at a time
09:25 AM kakimir: registers are volatile
09:25 AM kakimir: it wont
09:25 AM polprog: like, DDRA |= (1<<a); DDRA |= (1<<b) .... etc?
09:25 AM rue_mohr: DDRB = (INPUT << PB0 | INPUT << PB1 |INPUT << PB2 |INPUT << PB3 |INPUT << PB4 |INPUT << PB5 |INPUT << PB6 |INPUT << PB7);
09:25 AM rue_mohr: that is one instruction
09:25 AM kakimir: yes
09:25 AM polprog: well, you can OR it with a bit mask
09:25 AM kakimir: I should
09:25 AM rue_mohr: polprog, (or is it two?)
09:26 AM kakimir: but in case I don't
09:26 AM rue_mohr: kakimir, why are you so paranoid about what the fompilers doing?
09:26 AM polprog: rue_mohr: iirc its a simple sbi for single bit stuff, and probably some load-or-store thing
09:26 AM kakimir: because I'm bad coder
09:26 AM polprog: long way to go wih this attitude ;)
09:27 AM rue_mohr: you keep asking questions revolving around making sure the compiler compiles your C properly
09:27 AM rue_mohr: its not a PIC C compiler
09:27 AM polprog: lol
09:27 AM polprog: let it do its job
09:27 AM rue_mohr: it can actually compile C code
09:27 AM rue_mohr: worry about the hardware limits
09:27 AM polprog: GCC is probably the most advanced C compiler ever, it can compile C in a sane way
09:27 AM polprog: ^
09:28 AM rue_mohr: like the amount of flash space needed for printf() (which might be all of it)
09:28 AM rue_mohr: and the amount of ram available for strings
09:28 AM rue_mohr: (dont try to buffer up 200k of data)
09:29 AM rue_mohr: kakimir, your code will get much smaller when compiled with -O3 too
09:29 AM rue_mohr: compiling will take longer, upwards of possibly 750ms
09:30 AM rue_mohr: arg, I'm so late
09:30 AM rue_mohr: I hate this lack of sunlight in the morning thing
09:31 AM rue_mohr: theBear, give our sun back!
09:31 AM rue_mohr: oh wait, were sharing, right, nevermind...
09:38 AM polprog: ive heard sun servers are cheap on ebay
09:38 AM polprog: can't have too much Sun :D
10:14 AM skz81: <rue_mohr> kakimir, your code will get much smaller when compiled with -O3 too >> -Os is even more recommended, while optimizing size !
04:24 PM nohit: --
07:11 PM [1]MrMobius is now known as MrMobius
11:19 PM day__ is now known as day