#avr Logs

Oct 19 2019

#avr Calendar

06:10 AM ravon: Heyo, I'm toying around with C++ development on AVR and I'd like some input on the register manipulation used here https://github.com/denravonska/avrcpp. The output from objdump looks suspicious so I've probably done something wrong.
06:15 AM ravon: Got kids running berserk so I'm having a hard time focusing.
10:10 AM nohit: ravon: check #avrs, no cpp people here
11:41 AM ravon: nohit, I need another pair of eyes on the C part in my example.
11:42 AM ravon: nohit, TY for the #avrs tip though, I'll check it out
11:48 AM cehteh: ravon: comparing sleek C++ code with deliberately ugly C isnt really fair :D
11:50 AM cehteh: usually one would try to setup ports with all their bits at once and writing properly readable C code as well than doing bitmashing
11:51 AM cehteh: with optimizations on this should result in 'ideal' asm code no matter if you use C++ or C
12:00 PM cehteh: https://pastebin.com/kdBSnAGv << i wonder what asm that generates, and the if() could possibly nicer wraped pretty much into button_read() and led_set() functions as well
12:51 PM Santh_ is now known as Santh
01:04 PM ravon: cehteh, That's why I wanted input on my example :)
01:05 PM ravon: cehteh, Yours yields https://pastebin.com/Ef9wp54k which looks tighter.
01:22 PM ravon: The C++ version seems to use fewer cycles though. 9 vs 15 (?)
01:22 PM ravon: Or should I look at something else besides just raw instruction cost? I'm new to AVR so I'm trying to learn it.
01:28 PM ravon: I guess I should include the jump. In that case the tight (and unreadable) C version uses as many cycles as the generic and readable C++ version :) If I read it right I'm fine with that. I just need to update my example.
01:37 PM ravon: Scratch that, the C++ version has a constant cost of 14. I think.
04:05 PM nabil_ is now known as nabil
08:10 PM rue_shop1: ravon, what you makin?
10:41 PM ravon: rue_shop1, Got tired of the stiff registry handling and I got inspired by Jason Turner's "C++ for the C64" talk, so I'm seeing if I can make a usable lib for the AVR.
10:42 PM rue_shop1: hmm
10:43 PM rue_shop1: lib to cover what?
10:43 PM ravon: For now GPIO, ADC and timers.
11:43 PM day__ is now known as day