1 .file "sound.c" 2 __SP_H__ = 0x3e 3 __SP_L__ = 0x3d 4 __SREG__ = 0x3f 5 __RAMPZ__ = 0x3b 6 __tmp_reg__ = 0 7 __zero_reg__ = 1 8 .text 9 .Ltext0: 10 .cfi_sections .debug_frame 11 .section .text.configure_beeper,"ax",@progbits 12 .global configure_beeper 14 configure_beeper: 15 .LFB0: 16 .file 1 "sound.c" 1:sound.c **** /* Copyright (C) 2015 David Guerrero 2:sound.c **** * 3:sound.c **** * Permission is hereby granted, free of charge, to any person obtaining a copy 4:sound.c **** * of this software and associated documentation files (the "Software"), to deal 5:sound.c **** * in the Software without restriction, including without limitation the rights 6:sound.c **** * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7:sound.c **** * copies of the Software, and to permit persons to whom the Software is 8:sound.c **** * furnished to do so, subject to the following conditions: 9:sound.c **** * 10:sound.c **** * The above copyright notice and this permission notice shall be included in 11:sound.c **** * all copies or substantial portions of the Software. 12:sound.c **** * 13:sound.c **** * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14:sound.c **** * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15:sound.c **** * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16:sound.c **** * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17:sound.c **** * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18:sound.c **** * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19:sound.c **** * THE SOFTWARE. 20:sound.c **** */ 21:sound.c **** 22:sound.c **** #ifndef SOUND 23:sound.c **** #include "sound.h" 24:sound.c **** #endif 25:sound.c **** 26:sound.c **** #include 27:sound.c **** 28:sound.c **** void configure_beeper(void) 29:sound.c **** { 17 .loc 1 29 0 18 .cfi_startproc 19 /* prologue: function */ 20 /* frame size = 0 */ 21 /* stack size = 0 */ 22 .L__stack_usage = 0 30:sound.c **** TCCR1A=_BV(COM1C0);//toggle oc1c on compare match 23 .loc 1 30 0 24 0000 84E0 ldi r24,lo8(4) 25 0002 8093 8000 sts 128,r24 26 0006 0895 ret 27 .cfi_endproc 28 .LFE0: 30 .section .text.beep,"ax",@progbits 31 .global beep 33 beep: 34 .LFB1: 31:sound.c **** } 32:sound.c **** 33:sound.c **** #define beeper_base_fequency 7812 //Hertz 34:sound.c **** 35:sound.c **** void beep(uint16_t frequency) 36:sound.c **** { 35 .loc 1 36 0 36 .cfi_startproc 37 .LVL0: 38 /* prologue: function */ 39 /* frame size = 0 */ 40 /* stack size = 0 */ 41 .L__stack_usage = 0 42 0000 BC01 movw r22,r24 37:sound.c **** uint16_t ICR1_value=beeper_base_fequency/frequency; 43 .loc 1 37 0 44 0002 84E8 ldi r24,lo8(-124) 45 0004 9EE1 ldi r25,lo8(30) 46 .LVL1: 47 0006 0E94 0000 call __udivmodhi4 48 .LVL2: 38:sound.c **** TCCR1B=0; //disable timer 49 .loc 1 38 0 50 000a E1E8 ldi r30,lo8(-127) 51 000c F0E0 ldi r31,0 52 000e 1082 st Z,__zero_reg__ 39:sound.c **** ICR1H=ICR1_value>>8; 53 .loc 1 39 0 54 0010 7093 8700 sts 135,r23 40:sound.c **** ICR1L=ICR1_value&255; 55 .loc 1 40 0 56 0014 6093 8600 sts 134,r22 41:sound.c **** TCNT1=0; // set timer0 counter initial value to 0 57 .loc 1 41 0 58 0018 1092 8500 sts 132+1,__zero_reg__ 59 001c 1092 8400 sts 132,__zero_reg__ 42:sound.c **** DDRB|=1<<7; 60 .loc 1 42 0 61 0020 279A sbi 0x4,7 43:sound.c **** TCCR1B=_BV(WGM13)|_BV(WGM12)|5;//clear timer on compare match with ICR1|divide frequency by 64 (15 62 .loc 1 43 0 63 0022 8DE1 ldi r24,lo8(29) 64 0024 8083 st Z,r24 65 0026 0895 ret 66 .cfi_endproc 67 .LFE1: 69 .text 70 .Letext0: 71 .file 2 "/usr/lib/avr/include/stdint.h" DEFINED SYMBOLS *ABS*:0000000000000000 sound.c /tmp/cc5hYUMt.s:2 *ABS*:000000000000003e __SP_H__ /tmp/cc5hYUMt.s:3 *ABS*:000000000000003d __SP_L__ /tmp/cc5hYUMt.s:4 *ABS*:000000000000003f __SREG__ /tmp/cc5hYUMt.s:5 *ABS*:000000000000003b __RAMPZ__ /tmp/cc5hYUMt.s:6 *ABS*:0000000000000000 __tmp_reg__ /tmp/cc5hYUMt.s:7 *ABS*:0000000000000001 __zero_reg__ /tmp/cc5hYUMt.s:14 .text.configure_beeper:0000000000000000 configure_beeper /tmp/cc5hYUMt.s:33 .text.beep:0000000000000000 beep UNDEFINED SYMBOLS __udivmodhi4