#avr | Logs for 2016-09-02

Back
[00:00:24] <Thrashbarg> ._.
[01:32:13] <pepijndevos> Yo dawg, I heard you like loops, so I put some loops in your car so you can loop while you loop.
[01:32:43] <pepijndevos> A friend who is going to study in Aachen learns Haskell in the first year. No loops anywhere.
[03:12:08] <pepijndevos> Welp. 2 fabs together causes gcc to error: unable to find a register to spill in class 'POINTER_REGS'
[04:44:11] <pitastrudl> hello
[04:44:54] <pitastrudl> i have atmel studio 7, and an atmega16u2. I was using AVR studio 4 before. Now with atmel studio 7 i cant find the hex file generated by the build
[04:45:23] <pitastrudl> usually i would just open the asm file and build it and in FLIP i would select the hex file generated in the same dir the .asm file is
[04:45:57] <pitastrudl> but now i have to open up a project for each .asm file, import it in and then build it and use the hex file
[04:46:31] <pitastrudl> is there anyway to not clutter my folders with the project stuff the IDE generates?
[04:49:43] <^Richard> doubt it
[04:50:35] <pitastrudl> damn
[04:52:19] <twnqx> and that's the main reason not to use IDEs.
[04:53:14] <pitastrudl> but how else do i programme the board?
[04:53:20] <pitastrudl> and generate the hex file?
[04:54:29] <^Richard> use as7 like the rest of us and suck it up? ;p
[04:56:19] <twnqx> for me: emacs, gnu make, avr-gcc, git, avrdude
[05:02:52] <pitastrudl> aha
[05:03:02] <pitastrudl> why not vim
[05:04:07] <twnqx> i tried both 20 years ago, found i do not like the separate edit/command mode of vim, and stuck to emacs
[05:35:30] <Jartza> hallo
[05:36:01] <Jartza> I've switched to more modern stuff, like sublime text
[05:51:35] <pepijndevos> How do I implement a lock/mutex kind of thing between ISR and main code? Just volatile bool, or is there some special atomic magic I'm supposed to use?
[05:55:06] <pepijndevos> Or... actually what I want to do is briefly stop free running ADC interrupts, and I don't know if the ADC keeps running and how to restart it properly.
[05:55:42] <pepijndevos> Can I just clear and set ADIE? And do I need to set ADSC again?
[09:04:28] <Duality> are there any tutorials on how to write assembly and assemble it with avr-gcc
[09:04:29] <Duality> ?
[09:05:03] <antto> eh? isn't assembly assembled by an assembler? binutils perhaps
[09:07:28] <Duality> i know how to write assembly for avr, and compile it with this tool: http://www.avr-asm-tutorial.net/gavrasm/index_en.html
[09:07:50] <Duality> antto: normally you can pass gcc a .s file and it'll invoke the assembler for you
[09:08:14] <Duality> but i am just curious how that is done for avr, and if it requires a certain set of syntax :)
[09:08:17] <antto> yeah, i know this but i haven't used it
[09:08:45] <antto> but isn't this in situations where you want to use .s files as part of your C/C++ project?
[09:09:04] <antto> i mean, i'm not sure if you can use this approach for entirely ASM projects
[09:10:01] <antto> afaik somewhere at the end, avrgcc would call the binutils
[09:10:04] <Duality> that is what i am wondering also
[09:10:29] <antto> so i think you'd need to use the binutils directly
[09:10:47] <antto> they have include files for all the supported avr chips
[09:13:11] <antto> i can't answer that, but there are folks here who certainly have used asm on avr, they will know
[09:13:32] <_ami_> Duality: using Makefiles?
[09:13:54] <_ami_> you could add following rule for .S files
[09:13:55] <_ami_> .S.o:
[09:13:55] <_ami_> $(COMPILE) -x assembler-with-cpp -c $< -o $@
[09:14:17] <_ami_> where COMPILE is your compiler.
[09:14:21] <_ami_> in my case, its COMPILE = avr-gcc -Wall -Os -DF_CPU=$(F_CPU) $(CFLAGS) -mmcu=$(DEVICE)
[09:15:16] <_ami_> you could refer vusb library makefile for reference.
[09:15:30] <antto> ah, so it's doable
[09:15:36] <_ami_> yes indeed.
[09:15:41] <_ami_> giving you a link
[09:16:37] <_ami_> Duality: https://github.com/amitesh-singh/ldd/blob/master/usb/usb-leds-class/firmware/Makefile#L134
[09:18:57] <Duality> cool will check it out
[09:21:52] <_ami_> twnqx: ping
[09:22:26] <_ami_> twnqx: i was wondering if you worked on led trigger module in linux kernel before?
[09:22:36] <_ami_> need some advice
[09:25:15] <twnqx> no, i didn't
[09:31:06] <_ami_> twnqx: i should use rpi for development. i have been crashing my pc kernel quite often. :P