#avr | Logs for 2014-06-19

Back
[02:13:12] <Jartza> hip
[03:57:41] <malinus> Hop
[09:45:59] <Jartza> silence!
[11:11:35] <Evidlo> How does an AVR know when to use MOSI/MISO/RST/SCK as ISP pins and not just io?
[11:14:59] <twnqx> mostly since it doesn't do anything while being held in reset
[15:02:11] <umquant_> is it considered bad practice to use static const for pin assignments instead of defines
[15:10:00] <jadew> umquant_, shouldn't matter, but there's a big difference there
[15:10:09] <jadew> when using defines the value gets replaced
[15:10:20] <jadew> while when using static const you rely on the compiler to do the right thing
[15:10:34] <jadew> #define is the safest way to go
[15:13:21] <umquant_> okay cool
[15:16:03] <umquant_> For fun I am writing libraries for all the periphials on an atmega328. I am looking up best practices and such to figure out if what I am doing is good/bad/etc.
[15:19:19] <jadew> I had that urge too at some point, for me it turned out to be a waste of time
[15:19:53] <umquant_> Really? Just because you felt it didn't do anything for you?
[15:19:54] <umquant_> or..
[15:20:05] <jadew> because I'm moving from chip to chip too often
[15:20:44] <umquant_> ah gotcha
[15:21:01] <umquant_> I am trying to build up my "embedded resume" as I currently don't do embedded work but want to move into it
[15:21:08] <jadew> now it's atmega328, tomorrow it's xmega, next week it's tiny10
[15:21:08] <jadew> :P
[15:21:18] <jadew> ah, I see
[15:23:16] <umquant_> That was another thing. I want to find out how to make platform agnostic code. I have seen libraries where they were for multiple AVRs
[15:23:31] <umquant_> it looks like they just conditionally include stuff with ifndefs
[15:25:32] * twnqx prefers enums anyway
[15:27:13] <twnqx> better than defines thanks to typing, and no storage problems like static const
[15:28:24] <umquant_> twnqx: I actually saw some really awesome use of enums and really like it.
[15:28:39] <umquant_> How does this look? https://gist.github.com/anonymous/ef7d682799c3e8937d44
[15:30:22] <twnqx> i'd prefix them, but that's me. otherwise it looks good
[15:30:32] <umquant_> prefix them?
[15:30:49] <twnqx> spi_lsb, spi_master, ...
[15:31:00] <twnqx> to avoid cluttering the global namespace
[15:31:35] <umquant_> ah okay. So like within the enums
[15:31:39] <twnqx> yes
[15:31:42] <umquant_> ok cool
[15:31:46] <umquant_> thank you for the input!
[15:32:50] <umquant_> do you typically put the pin defines in there? Or should I make those passable to my functions as well
[15:33:01] <umquant_> like for MOS SCLK and CS
[15:55:09] <Santh> s biatch
[15:55:13] <Santh> oops :|
[16:23:30] <umquant_> See any obvious bad practices in this code? https://gist.github.com/anonymous/498e9a14f646a20132f6
[16:29:25] <Jartza> evil
[16:29:33] <umquant_> ?
[16:29:45] <Jartza> I found out that some phones play audio with phase turned 180°
[16:29:56] <umquant_> so it cancels out?
[16:29:58] <Jartza> I had to make some changes to the modem
[16:30:13] <Jartza> nope, but when I was expecting a rising edge, I got falling, and vice versa
[16:30:36] <umquant_> Ah. I was going to link you to this if thats what you were talking about
[16:30:38] <umquant_> http://stackoverflow.com/questions/4401232/avfoundation-how-to-turn-off-the-shutter-sound-when-capturestillimageasynchrono
[16:30:39] <umquant_> lol
[16:30:51] <Jartza> :)
[17:06:52] <ac_slater> sigh.... about a month ago I solved a problem and put the results here. I'm faced with the problem again as my Makefile got lost. Question, is there public logging?
[17:20:03] <Jartza> oh well, got that thing fixed
[17:20:07] <Jartza> the phase-change
[18:05:54] <myself> ac_slater: I see a bunch of your activity from 06/05, but all you said about makefiles was " The code didnt come with a makefile so I'll just copy the compiler args from the project."
[18:06:10] <myself> (not logging, I just have a hugeass buffer and used /lastlog)
[18:13:47] <RikusW1> ac_slater: use zlog
[18:13:52] <RikusW1> zlog
[18:35:46] <Jartza> shenanigans:firmware jartza$ avr-size --format=avr --mcu=attiny85 modem.o
[18:35:52] <Jartza> Program: 254 bytes (3.1% Full)
[18:35:53] <Jartza> ;)
[19:09:23] <malinus> Jartza, have you seen this http://i.imgur.com/qZX07gR.png
[19:30:52] <Jartza> yeah
[19:30:54] <Jartza> so? :)
[19:31:05] <malinus> Jartza, full of lead :D
[19:34:16] <Jartza> yeah... so is my tin
[19:34:18] <Jartza> :)
[19:34:49] <Jartza> you just have to remember not to eat it
[19:36:03] <Jartza> I only use lead solder at home
[19:36:58] <malinus> yeah me too
[19:37:11] <malinus> I've tried soldering with lead-free tin
[19:37:20] <malinus> never again
[19:37:22] <Jartza> I don't dare to
[19:37:34] <Jartza> it has other poisons which aren't that healthy :)
[19:38:12] <malinus> I wouldn't know. I just think it's funny that it didn't pass any of the standards
[19:38:43] <Jartza> well, it's cheap and it's chinese :)
[19:39:24] <Jartza> and I should've gone to sleep like 3 hours ago... again :D
[19:49:13] <ac_slater> myself: turns out I needed to put F_CPU in my cppflags. Thanks for looking