#avr Logs

Nov 29 2018

#avr Calendar

04:13 AM nabil__ is now known as nabil
08:18 AM nabil_ is now known as nabil
06:45 PM devinmcelheran: Hey guys. I'm learning the Dallas One Wire bus protocol. The polled exampled from Atmel uses __delay_cycles() to wait before proceeding with transmission or sampling the line. Isn't this a huge waste of cycles?
06:55 PM LeoNerd: On the one hand, yes. On the other hand, no not if you've nothing else to do at the time
07:01 PM rue_mohr: devinmcelheran, hi
07:01 PM devinmcelheran: Hi, guys, sorry.
07:02 PM rue_mohr: howsthe 1 wire going?
07:02 PM devinmcelheran: Just reading through the Atmel example code.
07:02 PM devinmcelheran: Reading the polled stuff right now and then I'll move onto the UART stuff.
07:03 PM rue_mohr: I hope its not dogmeat code
07:03 PM rue_mohr: full of #ifdef and garbage
07:03 PM devinmcelheran: But I was wondering, would it be reasonable to dynamically configure timers and use switch statements in ISRs to run the appropriate code based on a global status struct.
07:03 PM rue_mohr: what 1wire device do you have to speak with
07:04 PM devinmcelheran: I have a temperature sensor of some sort. But I would like to create some general purpose 1-wire code.
07:04 PM devinmcelheran: This is the Atmel app note https://www.microchip.com/wwwappnotes/appnotes.aspx?appnote=en591191
07:09 PM devinmcelheran: Also, it does have quite a few #ifdefs
08:52 PM rue_mohr: arg, i hate ifdef slaughtered code
08:52 PM rue_mohr: #ifdef sallyHadABaby
08:52 PM rue_mohr: #ifdef EndOfTheWorld
08:53 PM rue_mohr: #ifdef sticky_switch_7_on
08:53 PM rue_mohr: #ifdef actually_run_helloWorld_instead
08:54 PM rue_mohr: #ifdef use_if_insteadOf_CASE_statement
10:31 PM jesseg: hahahaha
10:33 PM jesseg: rue_mohr, but yeah it's rather annoying trying to troubleshoot someone's code when instead of writing it in C they invented a new cryptic language which they implemented with macros
10:37 PM rue_mohr: ;) indeed
10:38 PM rue_mohr: jesseg, so, I would like to point out that I'm having to make motif widgets to do layout properly, and its got me strongly biased to writing my own gui
10:39 PM rue_mohr: right now, I cant get my layout widget to show its children (expose events) when its in another managment object
10:39 PM jesseg: rue_mohr, I wondered how long it'd take you to reach that point :D
10:39 PM rue_mohr: no, dont underestimate, I only wanted to not write my own gui so that I wouldn't ahve to reinvent the wheel
10:39 PM rue_mohr: but these wheels are square on one side
10:40 PM rue_mohr: and you cant double them up cause of the bolt pattern
10:40 PM jesseg: yup, or the hole is off center or like you say the bolt patterns are random :P
10:41 PM rue_mohr: seriously, they have a grid layout object called a rowcolumn
10:41 PM rue_mohr: and its COMPLETELY hacked to be a menu
10:42 PM rue_mohr: you dont specify how many columns your objects are put into
10:42 PM rue_mohr: you specify the total number of objects your going to put into it and the number of rows,
10:42 PM rue_mohr: it calculates the columns
10:43 PM jesseg: sounds like pure magic to me :P
10:43 PM rue_mohr: and then it stretches them all wrong one way, and not in the other
10:43 PM jesseg: lol
10:43 PM rue_mohr: http://ruemohr.org/~ircjunk/images/cam_layout_widget.png
10:44 PM rue_mohr: so I been working on making a widget to lay fields out like that
10:44 PM rue_mohr: (or buttons or whatever)
10:44 PM rue_mohr: http://ruemohr.org/~ircjunk/images/cam_26Nov2018.png
10:44 PM jesseg: that's pretty nice
10:44 PM rue_mohr: its supposed to go in a pane on the right of what i have so far
10:44 PM jesseg: actually text entry dialogues is something I need to reinvent for mine
10:45 PM rue_mohr: oh yea
10:45 PM rue_mohr: well motif only does that, text
10:45 PM jesseg: I might make them as an extension to my button class
10:45 PM rue_mohr: I had to write a filter set for restricting it properly to numbers
10:45 PM rue_mohr: let me throw you a bone
10:46 PM rue_mohr: http://paste.debian.net/1053809/
10:46 PM rue_mohr: that is given every character or string, typed or pasted
10:47 PM rue_mohr: if doit is false, the object rejects the change and beeps (hey , the beep is automatic behaviour!)
10:48 PM rue_mohr: jesseg, that, by the way, is 2 hours of work
10:48 PM rue_mohr: I suspect you can adapt it
10:50 PM jesseg: that's pretty cool
10:56 PM rue_mohr: I hope you can use it to
10:56 PM rue_mohr: two
10:56 PM rue_mohr: too...
10:57 PM rue_mohr: you seem to be one of the closest people to some of the things I'm doing
11:29 PM jesseg: except I really am not a programmer... I kind of hack it and forget it.. LOL.
11:30 PM jesseg: I look at other people's code and can't figure out what it does, and I tell myself they just can't code. Then I look at mine and I can't figure out what it does either :P
11:34 PM day__ is now known as day
11:34 PM jesseg: so I think it's clear that I'm the one that can't code :D