   1               		.file	"adc.c"
   2               	__SP_H__ = 0x3e
   3               	__SP_L__ = 0x3d
   4               	__SREG__ = 0x3f
   5               	__RAMPZ__ = 0x3b
   6               	__tmp_reg__ = 0
   7               	__zero_reg__ = 1
   9               		.text
  10               	.Ltext0:
 156               	.global	atmelReadSingleADCChannelVoltage
 158               	atmelReadSingleADCChannelVoltage:
   1:adc.c         **** /*
   2:adc.c         ****    Licensed under the EUPL V.1.1, Lizenziert unter EUPL V.1.1 
   3:adc.c         **** */
   4:adc.c         **** /*
   5:adc.c         ****  * VERSION 1.0 Januar 7th 2010 LATE  File: 'one_wire_temperature.c'
   6:adc.c         ****  * Author: Linda Fouedjio  based on Michael Traxler based and Giacomo Ortona's hadtempsens
   7:adc.c         ****  * modified (heavily rather rebuild): Peter Zumbruch
   8:adc.c         ****  */
   9:adc.c         **** #include <stdint.h>
  10:adc.c         **** #include <stdio.h>
  11:adc.c         **** #include <stdarg.h>
  12:adc.c         **** #include <string.h>
  13:adc.c         **** #include <math.h>
  14:adc.c         **** #include <stdlib.h>
  15:adc.c         **** #include <util/delay.h>
  16:adc.c         **** #include <avr/pgmspace.h>
  17:adc.c         **** 
  18:adc.c         **** #include <avr/io.h>
  19:adc.c         **** /*
  20:adc.c         ****  * VERSION 1.0 Januar 7th 2010 LATE  File: 'adc.c'
  21:adc.c         ****  * Author: Linda Fouedjio  based  Giacomo Ortona
  22:adc.c         ****  * modified (heavily rather rebuild): Peter Zumbruch
  23:adc.c         ****  */
  24:adc.c         **** #include <avr/interrupt.h>
  25:adc.c         **** #include <avr/sleep.h>
  26:adc.c         **** #include <avr/iocan128.h>
  27:adc.c         **** 
  28:adc.c         **** #include "api.h"
  29:adc.c         **** #include "api_define.h"
  30:adc.c         **** #include "api_global.h"
  31:adc.c         **** 
  32:adc.c         **** #include "api_debug.h"
  33:adc.c         **** #include "can.h"
  34:adc.c         **** #include "led.h"
  35:adc.c         **** #include "mem-check.h"
  36:adc.c         **** #include "adc.h"
  37:adc.c         **** #include "jtag.h"
  38:adc.c         **** 
  39:adc.c         **** #include "one_wire_adc.h"
  40:adc.c         **** #include "one_wire_dualSwitch.h"
  41:adc.c         **** #include "one_wire_temperature.h"
  42:adc.c         **** #include "read_write_register.h"
  43:adc.c         **** 
  44:adc.c         **** #include "OWIDeviceSpecific.h"
  45:adc.c         **** #include "OWIHighLevelFunctions.h"
  46:adc.c         **** #include "OWIBitFunctions.h"
  47:adc.c         **** 
  48:adc.c         **** static const char filename[] 		PROGMEM = __FILE__;
  49:adc.c         **** 
  50:adc.c         **** #define ADC_CYCLES 3 /*the number of ADC conversions done to get an average voltage value*/
  51:adc.c         **** #define ADC_TIMEOUT 1000 /*wait ADC_TIMEOUT clock cycles for a single ADC conversion*/
  52:adc.c         **** 
  53:adc.c         **** void atmelReadADCs( struct uartStruct *ptr_uartStruct)
  54:adc.c         **** {
  55:adc.c         ****    switch(ptr_uartStruct->number_of_arguments)
  56:adc.c         ****    {
  57:adc.c         ****       case 0:
  58:adc.c         ****       {
  59:adc.c         ****          /* read all channels*/
  60:adc.c         ****          int8_t channelIndex = 0;
  61:adc.c         ****          int8_t channelIndexMax = 0;
  62:adc.c         ****          channelIndexMax = (disableJTAG_flag)? 8 : 4;
  63:adc.c         ****          for (channelIndex = 0; channelIndex < channelIndexMax; channelIndex++)
  64:adc.c         ****          {
  65:adc.c         ****             atmelCollectSingleADCChannel(channelIndex, FALSE);
  66:adc.c         ****          }
  67:adc.c         ****       }
  68:adc.c         ****       break;
  69:adc.c         ****       case 1:
  70:adc.c         ****       {
  71:adc.c         ****      	  printDebug_p(debugLevelEventDebug, debugSystemADC, __LINE__, filename, PSTR(""));
  72:adc.c         **** 
  73:adc.c         **** 
  74:adc.c         ****          /* read single channel */
  75:adc.c         ****          int8_t channelIndex = ptr_uartStruct->Uart_Message_ID;
  76:adc.c         ****          atmelCollectSingleADCChannel(channelIndex, FALSE);
  77:adc.c         ****       }
  78:adc.c         ****       break;
  79:adc.c         ****       default:
  80:adc.c         ****          generalErrorCode = CommunicationError_p(ERRG, dynamicMessage_ErrorIndex, TRUE, PSTR("inval
  81:adc.c         ****          break;
  82:adc.c         ****    }
  83:adc.c         ****    return;
  84:adc.c         **** 
  85:adc.c         **** }
  86:adc.c         **** 
  87:adc.c         **** /*this function takes the value of the voltage read from the ADC-channel
  88:adc.c         ****  * and convert it in the form of the API
  89:adc.c         ****  * as input parameters the function needs a keyword and the number of channel
  90:adc.c         ****  * the function has no return parameter
  91:adc.c         ****  * quiet: disables printout
  92:adc.c         ****  * channelIndex: index of adc channel [0..7]
  93:adc.c         ****  */
  94:adc.c         **** 
  95:adc.c         **** uint8_t atmelCollectSingleADCChannel( int8_t channelIndex, uint8_t quiet )
  96:adc.c         **** {
  97:adc.c         ****  	printDebug_p(debugLevelEventDebug, debugSystemADC, __LINE__, filename, PSTR("channel index %i"), 
  98:adc.c         **** 
  99:adc.c         ****    for ( uint8_t i = 0 ; i <= 1 ; i++ )
 100:adc.c         ****    {
 101:adc.c         ****       _delay_ms(10);
 102:adc.c         ****    }
 103:adc.c         **** 
 104:adc.c         ****    int8_t status = eNoError;
 105:adc.c         **** 
 106:adc.c         ****    /*check channel index*/
 107:adc.c         ****    switch (channelIndex)
 108:adc.c         ****    {
 109:adc.c         ****       case 0:
 110:adc.c         ****       case 1:
 111:adc.c         ****       case 2:
 112:adc.c         ****       case 3:
 113:adc.c         ****          break;
 114:adc.c         ****       case 4:
 115:adc.c         ****       case 5:
 116:adc.c         ****       case 6:
 117:adc.c         ****       case 7:
 118:adc.c         ****          if ( FALSE == disableJTAG_flag)
 119:adc.c         ****          {
 120:adc.c         ****             generalErrorCode = CommunicationError_p(ERRG, GENERAL_ERROR_channel_undefined, TRUE, NU
 121:adc.c         ****             return eADCwrongAddress;
 122:adc.c         ****          }
 123:adc.c         ****          break;
 124:adc.c         ****       default:
 125:adc.c         ****          generalErrorCode = CommunicationError_p(ERRG, GENERAL_ERROR_channel_undefined, TRUE, NULL)
 126:adc.c         ****          return eADCwrongAddress;
 127:adc.c         ****          break;
 128:adc.c         ****    }
 129:adc.c         **** 
 130:adc.c         ****    /* get ADC value for channel: channelIndex*/
 131:adc.c         ****    status = atmelReadSingleADCChannelVoltage(channelIndex);
 132:adc.c         **** 
 133:adc.c         ****    /* set global status*/
 134:adc.c         ****    switch (channelIndex)
 135:adc.c         ****    {
 136:adc.c         ****       case 0:
 137:adc.c         ****          res0 = status;
 138:adc.c         ****          break;
 139:adc.c         ****       case 1:
 140:adc.c         ****          res1 = status;
 141:adc.c         ****          break;
 142:adc.c         ****       case 2:
 143:adc.c         ****          res2 = status;
 144:adc.c         ****          break;
 145:adc.c         ****       case 3:
 146:adc.c         ****          res3 = status;
 147:adc.c         ****          break;
 148:adc.c         ****       case 4:
 149:adc.c         ****          res4 = status;
 150:adc.c         ****          break;
 151:adc.c         ****       case 5:
 152:adc.c         ****          res5 = status;
 153:adc.c         ****          break;
 154:adc.c         ****       case 6:
 155:adc.c         ****          res6 = status;
 156:adc.c         ****          break;
 157:adc.c         ****       case 7:
 158:adc.c         ****          res7 = status;
 159:adc.c         ****          break;
 160:adc.c         ****    }
 161:adc.c         **** 
 162:adc.c         ****    /* check status return*/
 163:adc.c         ****    if ( status != eNoError )
 164:adc.c         ****    {
 165:adc.c         ****       CommunicationError_p(ERRG, dynamicMessage_ErrorIndex, TRUE, PSTR("error accessing ADC channel
 166:adc.c         ****       return status;
 167:adc.c         ****    }
 168:adc.c         ****     printDebug_p(debugLevelEventDebug, debugSystemADC, __LINE__, filename, PSTR("value %i"), atmelA
 169:adc.c         **** 
 170:adc.c         ****    if ( ! quiet )
 171:adc.c         ****    {
 172:adc.c         **** 	   createReceiveHeader(ptr_uartStruct, uart_message_string, BUFFER_SIZE);
 173:adc.c         **** 
 174:adc.c         **** 	   /*generate message*/
 175:adc.c         **** 	   snprintf_P(uart_message_string, BUFFER_SIZE - 1, PSTR("%s%x %x"),
 176:adc.c         **** 			   uart_message_string, channelIndex, atmelAdcValues[channelIndex]);
 177:adc.c         **** 
 178:adc.c         **** 	   UART0_Send_Message_String_p(uart_message_string, BUFFER_SIZE - 1);
 179:adc.c         ****    }
 180:adc.c         ****    return status;
 181:adc.c         **** }//END of atmelCollectSingleADCChannel function
 182:adc.c         **** 
 183:adc.c         **** /* this function reads and converts the voltage of the ADC channels
 184:adc.c         ****  * as input parameters the function needs number of channel to read a voltage
 185:adc.c         ****  * the value returned is the voltage read from the channel
 186:adc.c         ****  */
 187:adc.c         **** 
 188:adc.c         **** int8_t atmelReadSingleADCChannelVoltage( unsigned int channel_nr )
 189:adc.c         **** {
 160               	.LM0:
 161               	.LFBB1:
 162               	/* prologue: function */
 163               	/* frame size = 0 */
 164               	/* stack size = 0 */
 165               	.L__stack_usage = 0
 166 0000 9C01      		movw r18,r24
 190:adc.c         **** 	   /* generate header */
 191:adc.c         **** 
 192:adc.c         ****    uint16_t Timeout;
 193:adc.c         ****    uint16_t Value;
 194:adc.c         ****    uint16_t iStep;
 195:adc.c         ****    int16_t TotalValue;
 196:adc.c         **** 
 197:adc.c         ****    if (FALSE == disableJTAG_flag)
 168               	.LM1:
 169 0002 8091 0000 		lds r24,disableJTAG_flag
 170 0006 8111      		cpse r24,__zero_reg__
 171 0008 00C0      		rjmp .L2
 198:adc.c         ****    {
 199:adc.c         ****       if ( channel_nr > 3 )
 173               	.LM2:
 174 000a 2430      		cpi r18,4
 175 000c 3105      		cpc r19,__zero_reg__
 176 000e 00F0      		brlo .L3
 200:adc.c         ****       {
 201:adc.c         ****          atmelAdcValues[channel_nr] = 0;
 178               	.LM3:
 179 0010 F901      		movw r30,r18
 180 0012 EE0F      		lsl r30
 181 0014 FF1F      		rol r31
 182 0016 E050      		subi r30,lo8(-(atmelAdcValues))
 183 0018 F040      		sbci r31,hi8(-(atmelAdcValues))
 184 001a 1182      		std Z+1,__zero_reg__
 185 001c 1082      		st Z,__zero_reg__
 186 001e 00C0      		rjmp .L10
 187               	.L2:
 202:adc.c         ****          return eADCwrongAddress;
 203:adc.c         ****       }
 204:adc.c         ****    }
 205:adc.c         ****    else /* FALSE != disableJTAG_flag */
 206:adc.c         ****    {
 207:adc.c         ****       if ( channel_nr > sizeof(atmelAdcValues)/sizeof(uint16_t))
 189               	.LM4:
 190 0020 2930      		cpi r18,9
 191 0022 3105      		cpc r19,__zero_reg__
 192 0024 00F0      		brlo .+2
 193 0026 00C0      		rjmp .L10
 194               	.L3:
 208:adc.c         ****       {
 209:adc.c         ****          return eADCwrongAddress;
 210:adc.c         ****       }
 211:adc.c         ****    }
 212:adc.c         **** 
 213:adc.c         ****    /*use 3.3V supply voltage as reference voltage
 214:adc.c         ****     * and select the voltage to be measured*/
 215:adc.c         ****    ADMUX = 0x40 | (unsigned char) channel_nr;
 196               	.LM5:
 197 0028 822F      		mov r24,r18
 198 002a 8064      		ori r24,lo8(64)
 199 002c 8093 7C00 		sts 124,r24
 200 0030 63E0      		ldi r22,lo8(3)
 201 0032 70E0      		ldi r23,0
 216:adc.c         ****    /*ADMUX = 0x40 | 0x1B;*/
 217:adc.c         **** 
 218:adc.c         ****    TotalValue = 0;
 203               	.LM6:
 204 0034 80E0      		ldi r24,0
 205 0036 90E0      		ldi r25,0
 206               	.L9:
 219:adc.c         ****    for ( iStep = 0; iStep < ADC_CYCLES ; iStep++ )
 220:adc.c         ****    {
 221:adc.c         ****       /* start a new single conversion*/
 222:adc.c         ****       ADCSRA |= BIT (ADSC);
 208               	.LM7:
 209 0038 4091 7A00 		lds r20,122
 210 003c 4064      		ori r20,lo8(64)
 211 003e 4093 7A00 		sts 122,r20
 223:adc.c         **** 
 224:adc.c         ****       /* wait until conversion is complete*/
 225:adc.c         ****       Timeout = ADC_TIMEOUT;
 213               	.LM8:
 214 0042 48EE      		ldi r20,lo8(-24)
 215 0044 53E0      		ldi r21,lo8(3)
 216               	.L6:
 226:adc.c         ****       while ( !( ADCSRA & BIT (ADIF) ) && ( --Timeout > 0 ) )
 218               	.LM9:
 219 0046 E091 7A00 		lds r30,122
 220 004a E4FD      		sbrc r30,4
 221 004c 00C0      		rjmp .L5
 223               	.LM10:
 224 004e 4150      		subi r20,1
 225 0050 5109      		sbc r21,__zero_reg__
 226 0052 4115      		cp r20,__zero_reg__
 227 0054 5105      		cpc r21,__zero_reg__
 228 0056 01F4      		brne .L6
 229               	.L5:
 227:adc.c         ****          ;
 228:adc.c         **** 
 229:adc.c         ****       /* clear interrupt flag from former conversion*/
 230:adc.c         ****       ADCSRA |= BIT (ADIF);
 231               	.LM11:
 232 0058 E091 7A00 		lds r30,122
 233 005c E061      		ori r30,lo8(16)
 234 005e E093 7A00 		sts 122,r30
 231:adc.c         **** 
 232:adc.c         ****       if ( Timeout == 0 )
 236               	.LM12:
 237 0062 452B      		or r20,r21
 238 0064 01F4      		brne .L7
 233:adc.c         ****       {
 234:adc.c         ****      	  printDebug_p(debugLevelEventDebug, debugSystemADC, __LINE__, filename, PSTR("Timeout"));
 240               	.LM13:
 241 0066 80E0      		ldi r24,lo8(__c.2989)
 242 0068 90E0      		ldi r25,hi8(__c.2989)
 243 006a 9F93      		push r25
 244 006c 8F93      		push r24
 245 006e 80E0      		ldi r24,lo8(filename)
 246 0070 90E0      		ldi r25,hi8(filename)
 247 0072 9F93      		push r25
 248 0074 8F93      		push r24
 249 0076 1F92      		push __zero_reg__
 250 0078 8AEE      		ldi r24,lo8(-22)
 251 007a 8F93      		push r24
 252 007c 1F92      		push __zero_reg__
 253 007e 1F92      		push __zero_reg__
 254 0080 1F92      		push __zero_reg__
 255 0082 85E0      		ldi r24,lo8(5)
 256 0084 8F93      		push r24
 257 0086 82E0      		ldi r24,lo8(2)
 258 0088 8F93      		push r24
 259 008a E091 0000 		lds r30,printDebug_p
 260 008e F091 0000 		lds r31,printDebug_p+1
 261 0092 0995      		icall
 235:adc.c         ****          return eADCTimeout;
 263               	.LM14:
 264 0094 8DB7      		in r24,__SP_L__
 265 0096 9EB7      		in r25,__SP_H__
 266 0098 0B96      		adiw r24,11
 267 009a 0FB6      		in __tmp_reg__,__SREG__
 268 009c F894      		cli
 269 009e 9EBF      		out __SP_H__,r25
 270 00a0 0FBE      		out __SREG__,__tmp_reg__
 271 00a2 8DBF      		out __SP_L__,r24
 272 00a4 80E2      		ldi r24,lo8(32)
 273 00a6 0895      		ret
 274               	.L7:
 236:adc.c         ****       }
 237:adc.c         **** 
 238:adc.c         ****       /*one must read ADCL before ADCH!*/
 239:adc.c         ****       Value = ADCL;
 276               	.LM15:
 277 00a8 4091 7800 		lds r20,120
 240:adc.c         ****       Value |= (unsigned int) ( ADCH & 0x03 ) << 8;
 279               	.LM16:
 280 00ac E091 7900 		lds r30,121
 281 00b0 E370      		andi r30,lo8(3)
 282 00b2 50E0      		ldi r21,0
 283 00b4 5E2B      		or r21,r30
 241:adc.c         ****       TotalValue += Value;
 285               	.LM17:
 286 00b6 840F      		add r24,r20
 287 00b8 951F      		adc r25,r21
 288 00ba 6150      		subi r22,1
 289 00bc 7109      		sbc r23,__zero_reg__
 219:adc.c         ****    {
 291               	.LM18:
 292 00be 6115      		cp r22,__zero_reg__
 293 00c0 7105      		cpc r23,__zero_reg__
 294 00c2 01F0      		breq .+2
 295 00c4 00C0      		rjmp .L9
 242:adc.c         ****    }
 243:adc.c         **** 
 244:adc.c         ****    TotalValue = TotalValue / ADC_CYCLES;
 297               	.LM19:
 298 00c6 63E0      		ldi r22,lo8(3)
 299 00c8 70E0      		ldi r23,0
 300 00ca 0E94 0000 		call __divmodhi4
 245:adc.c         **** 
 246:adc.c         ****    /*save results*/
 247:adc.c         ****    atmelAdcValues[channel_nr] = (uint16_t) TotalValue;
 302               	.LM20:
 303 00ce F901      		movw r30,r18
 304 00d0 EE0F      		lsl r30
 305 00d2 FF1F      		rol r31
 306 00d4 E050      		subi r30,lo8(-(atmelAdcValues))
 307 00d6 F040      		sbci r31,hi8(-(atmelAdcValues))
 308 00d8 6083      		st Z,r22
 309 00da 7183      		std Z+1,r23
 248:adc.c         ****     printDebug_p(debugLevelEventDebug, debugSystemADC, __LINE__, filename, PSTR("value = %i"), Tota
 311               	.LM21:
 312 00dc 7F93      		push r23
 313 00de 6F93      		push r22
 314 00e0 80E0      		ldi r24,lo8(__c.2994)
 315 00e2 90E0      		ldi r25,hi8(__c.2994)
 316 00e4 9F93      		push r25
 317 00e6 8F93      		push r24
 318 00e8 80E0      		ldi r24,lo8(filename)
 319 00ea 90E0      		ldi r25,hi8(filename)
 320 00ec 9F93      		push r25
 321 00ee 8F93      		push r24
 322 00f0 1F92      		push __zero_reg__
 323 00f2 88EF      		ldi r24,lo8(-8)
 324 00f4 8F93      		push r24
 325 00f6 1F92      		push __zero_reg__
 326 00f8 1F92      		push __zero_reg__
 327 00fa 1F92      		push __zero_reg__
 328 00fc 85E0      		ldi r24,lo8(5)
 329 00fe 8F93      		push r24
 330 0100 82E0      		ldi r24,lo8(2)
 331 0102 8F93      		push r24
 332 0104 E091 0000 		lds r30,printDebug_p
 333 0108 F091 0000 		lds r31,printDebug_p+1
 334 010c 0995      		icall
 249:adc.c         **** 
 250:adc.c         ****    return eNoError;
 336               	.LM22:
 337 010e 8DB7      		in r24,__SP_L__
 338 0110 9EB7      		in r25,__SP_H__
 339 0112 0D96      		adiw r24,13
 340 0114 0FB6      		in __tmp_reg__,__SREG__
 341 0116 F894      		cli
 342 0118 9EBF      		out __SP_H__,r25
 343 011a 0FBE      		out __SREG__,__tmp_reg__
 344 011c 8DBF      		out __SP_L__,r24
 345 011e 80E0      		ldi r24,0
 346 0120 0895      		ret
 347               	.L10:
 209:adc.c         ****       }
 349               	.LM23:
 350 0122 80E8      		ldi r24,lo8(-128)
 251:adc.c         **** }// END of atmelReadSingleADCChannelVoltage function
 352               	.LM24:
 353 0124 0895      		ret
 358               	.Lscope1:
 362               	.global	atmelCollectSingleADCChannel
 364               	atmelCollectSingleADCChannel:
  96:adc.c         ****  	printDebug_p(debugLevelEventDebug, debugSystemADC, __LINE__, filename, PSTR("channel index %i"), 
 366               	.LM25:
 367               	.LFBB2:
 368 0126 EF92      		push r14
 369 0128 FF92      		push r15
 370 012a 0F93      		push r16
 371 012c 1F93      		push r17
 372 012e CF93      		push r28
 373 0130 DF93      		push r29
 374               	/* prologue: function */
 375               	/* frame size = 0 */
 376               	/* stack size = 6 */
 377               	.L__stack_usage = 6
 378 0132 E82E      		mov r14,r24
 379 0134 F62E      		mov r15,r22
  97:adc.c         **** 
 381               	.LM26:
 382 0136 082F      		mov r16,r24
 383 0138 1127      		clr r17
 384 013a 07FD      		sbrc r16,7
 385 013c 1095      		com r17
 386 013e 1F93      		push r17
 387 0140 8F93      		push r24
 388 0142 20E0      		ldi r18,lo8(__c.2947)
 389 0144 30E0      		ldi r19,hi8(__c.2947)
 390 0146 3F93      		push r19
 391 0148 2F93      		push r18
 392 014a 20E0      		ldi r18,lo8(filename)
 393 014c 30E0      		ldi r19,hi8(filename)
 394 014e 3F93      		push r19
 395 0150 2F93      		push r18
 396 0152 1F92      		push __zero_reg__
 397 0154 81E6      		ldi r24,lo8(97)
 398 0156 8F93      		push r24
 399 0158 1F92      		push __zero_reg__
 400 015a 1F92      		push __zero_reg__
 401 015c 1F92      		push __zero_reg__
 402 015e 85E0      		ldi r24,lo8(5)
 403 0160 8F93      		push r24
 404 0162 82E0      		ldi r24,lo8(2)
 405 0164 8F93      		push r24
 406 0166 E091 0000 		lds r30,printDebug_p
 407 016a F091 0000 		lds r31,printDebug_p+1
 408 016e 0995      		icall
 409               	.LBB9:
 410               	.LBB10:
 411               	.LBB11:
 413               	.Ltext1:
   1:/usr/lib/avr/include/util/delay.h **** /* Copyright (c) 2002, Marek Michalkiewicz
   2:/usr/lib/avr/include/util/delay.h ****    Copyright (c) 2004,2005,2007 Joerg Wunsch
   3:/usr/lib/avr/include/util/delay.h ****    Copyright (c) 2007  Florin-Viorel Petrov
   4:/usr/lib/avr/include/util/delay.h ****    All rights reserved.
   5:/usr/lib/avr/include/util/delay.h **** 
   6:/usr/lib/avr/include/util/delay.h ****    Redistribution and use in source and binary forms, with or without
   7:/usr/lib/avr/include/util/delay.h ****    modification, are permitted provided that the following conditions are met:
   8:/usr/lib/avr/include/util/delay.h **** 
   9:/usr/lib/avr/include/util/delay.h ****    * Redistributions of source code must retain the above copyright
  10:/usr/lib/avr/include/util/delay.h ****      notice, this list of conditions and the following disclaimer.
  11:/usr/lib/avr/include/util/delay.h **** 
  12:/usr/lib/avr/include/util/delay.h ****    * Redistributions in binary form must reproduce the above copyright
  13:/usr/lib/avr/include/util/delay.h ****      notice, this list of conditions and the following disclaimer in
  14:/usr/lib/avr/include/util/delay.h ****      the documentation and/or other materials provided with the
  15:/usr/lib/avr/include/util/delay.h ****      distribution.
  16:/usr/lib/avr/include/util/delay.h **** 
  17:/usr/lib/avr/include/util/delay.h ****    * Neither the name of the copyright holders nor the names of
  18:/usr/lib/avr/include/util/delay.h ****      contributors may be used to endorse or promote products derived
  19:/usr/lib/avr/include/util/delay.h ****      from this software without specific prior written permission.
  20:/usr/lib/avr/include/util/delay.h **** 
  21:/usr/lib/avr/include/util/delay.h ****   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  22:/usr/lib/avr/include/util/delay.h ****   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  23:/usr/lib/avr/include/util/delay.h ****   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  24:/usr/lib/avr/include/util/delay.h ****   ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  25:/usr/lib/avr/include/util/delay.h ****   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  26:/usr/lib/avr/include/util/delay.h ****   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  27:/usr/lib/avr/include/util/delay.h ****   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  28:/usr/lib/avr/include/util/delay.h ****   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  29:/usr/lib/avr/include/util/delay.h ****   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  30:/usr/lib/avr/include/util/delay.h ****   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  31:/usr/lib/avr/include/util/delay.h ****   POSSIBILITY OF SUCH DAMAGE. */
  32:/usr/lib/avr/include/util/delay.h **** 
  33:/usr/lib/avr/include/util/delay.h **** /* $Id$ */
  34:/usr/lib/avr/include/util/delay.h **** 
  35:/usr/lib/avr/include/util/delay.h **** #ifndef _UTIL_DELAY_H_
  36:/usr/lib/avr/include/util/delay.h **** #define _UTIL_DELAY_H_ 1
  37:/usr/lib/avr/include/util/delay.h **** 
  38:/usr/lib/avr/include/util/delay.h **** #ifndef __HAS_DELAY_CYCLES
  39:/usr/lib/avr/include/util/delay.h **** #define __HAS_DELAY_CYCLES 1
  40:/usr/lib/avr/include/util/delay.h **** #endif
  41:/usr/lib/avr/include/util/delay.h **** 
  42:/usr/lib/avr/include/util/delay.h **** #include <inttypes.h>
  43:/usr/lib/avr/include/util/delay.h **** #include <util/delay_basic.h>
  44:/usr/lib/avr/include/util/delay.h **** #include <math.h>
  45:/usr/lib/avr/include/util/delay.h **** 
  46:/usr/lib/avr/include/util/delay.h **** /** \file */
  47:/usr/lib/avr/include/util/delay.h **** /** \defgroup util_delay <util/delay.h>: Convenience functions for busy-wait delay loops
  48:/usr/lib/avr/include/util/delay.h ****     \code
  49:/usr/lib/avr/include/util/delay.h ****     #define F_CPU 1000000UL  // 1 MHz
  50:/usr/lib/avr/include/util/delay.h ****     //#define F_CPU 14.7456E6
  51:/usr/lib/avr/include/util/delay.h ****     #include <util/delay.h>
  52:/usr/lib/avr/include/util/delay.h ****     \endcode
  53:/usr/lib/avr/include/util/delay.h **** 
  54:/usr/lib/avr/include/util/delay.h ****     \note As an alternative method, it is possible to pass the
  55:/usr/lib/avr/include/util/delay.h ****     F_CPU macro down to the compiler from the Makefile.
  56:/usr/lib/avr/include/util/delay.h ****     Obviously, in that case, no \c \#define statement should be
  57:/usr/lib/avr/include/util/delay.h ****     used.
  58:/usr/lib/avr/include/util/delay.h **** 
  59:/usr/lib/avr/include/util/delay.h ****     The functions in this header file are wrappers around the basic
  60:/usr/lib/avr/include/util/delay.h ****     busy-wait functions from <util/delay_basic.h>.  They are meant as
  61:/usr/lib/avr/include/util/delay.h ****     convenience functions where actual time values can be specified
  62:/usr/lib/avr/include/util/delay.h ****     rather than a number of cycles to wait for.  The idea behind is
  63:/usr/lib/avr/include/util/delay.h ****     that compile-time constant expressions will be eliminated by
  64:/usr/lib/avr/include/util/delay.h ****     compiler optimization so floating-point expressions can be used
  65:/usr/lib/avr/include/util/delay.h ****     to calculate the number of delay cycles needed based on the CPU
  66:/usr/lib/avr/include/util/delay.h ****     frequency passed by the macro F_CPU.
  67:/usr/lib/avr/include/util/delay.h **** 
  68:/usr/lib/avr/include/util/delay.h ****     \note In order for these functions to work as intended, compiler
  69:/usr/lib/avr/include/util/delay.h ****     optimizations <em>must</em> be enabled, and the delay time
  70:/usr/lib/avr/include/util/delay.h ****     <em>must</em> be an expression that is a known constant at
  71:/usr/lib/avr/include/util/delay.h ****     compile-time.  If these requirements are not met, the resulting
  72:/usr/lib/avr/include/util/delay.h ****     delay will be much longer (and basically unpredictable), and
  73:/usr/lib/avr/include/util/delay.h ****     applications that otherwise do not use floating-point calculations
  74:/usr/lib/avr/include/util/delay.h ****     will experience severe code bloat by the floating-point library
  75:/usr/lib/avr/include/util/delay.h ****     routines linked into the application.
  76:/usr/lib/avr/include/util/delay.h **** 
  77:/usr/lib/avr/include/util/delay.h ****     The functions available allow the specification of microsecond, and
  78:/usr/lib/avr/include/util/delay.h ****     millisecond delays directly, using the application-supplied macro
  79:/usr/lib/avr/include/util/delay.h ****     F_CPU as the CPU clock frequency (in Hertz).
  80:/usr/lib/avr/include/util/delay.h **** 
  81:/usr/lib/avr/include/util/delay.h **** */
  82:/usr/lib/avr/include/util/delay.h **** 
  83:/usr/lib/avr/include/util/delay.h **** #if !defined(__DOXYGEN__)
  84:/usr/lib/avr/include/util/delay.h **** static inline void _delay_us(double __us) __attribute__((always_inline));
  85:/usr/lib/avr/include/util/delay.h **** static inline void _delay_ms(double __ms) __attribute__((always_inline));
  86:/usr/lib/avr/include/util/delay.h **** #endif
  87:/usr/lib/avr/include/util/delay.h **** 
  88:/usr/lib/avr/include/util/delay.h **** #ifndef F_CPU
  89:/usr/lib/avr/include/util/delay.h **** /* prevent compiler error by supplying a default */
  90:/usr/lib/avr/include/util/delay.h **** # warning "F_CPU not defined for <util/delay.h>"
  91:/usr/lib/avr/include/util/delay.h **** # define F_CPU 1000000UL
  92:/usr/lib/avr/include/util/delay.h **** #endif
  93:/usr/lib/avr/include/util/delay.h **** 
  94:/usr/lib/avr/include/util/delay.h **** #ifndef __OPTIMIZE__
  95:/usr/lib/avr/include/util/delay.h **** # warning "Compiler optimizations disabled; functions from <util/delay.h> won't work as designed"
  96:/usr/lib/avr/include/util/delay.h **** #endif
  97:/usr/lib/avr/include/util/delay.h **** 
  98:/usr/lib/avr/include/util/delay.h **** #if __HAS_DELAY_CYCLES && defined(__OPTIMIZE__) && \
  99:/usr/lib/avr/include/util/delay.h ****   !defined(__DELAY_BACKWARD_COMPATIBLE__) &&	   \
 100:/usr/lib/avr/include/util/delay.h ****   __STDC_HOSTED__
 101:/usr/lib/avr/include/util/delay.h **** #  include <math.h>
 102:/usr/lib/avr/include/util/delay.h **** #endif
 103:/usr/lib/avr/include/util/delay.h **** 
 104:/usr/lib/avr/include/util/delay.h **** /**
 105:/usr/lib/avr/include/util/delay.h ****    \ingroup util_delay
 106:/usr/lib/avr/include/util/delay.h **** 
 107:/usr/lib/avr/include/util/delay.h ****    Perform a delay of \c __ms milliseconds, using _delay_loop_2().
 108:/usr/lib/avr/include/util/delay.h **** 
 109:/usr/lib/avr/include/util/delay.h ****    The macro F_CPU is supposed to be defined to a
 110:/usr/lib/avr/include/util/delay.h ****    constant defining the CPU clock frequency (in Hertz).
 111:/usr/lib/avr/include/util/delay.h **** 
 112:/usr/lib/avr/include/util/delay.h ****    The maximal possible delay is 262.14 ms / F_CPU in MHz.
 113:/usr/lib/avr/include/util/delay.h **** 
 114:/usr/lib/avr/include/util/delay.h ****    When the user request delay which exceed the maximum possible one,
 115:/usr/lib/avr/include/util/delay.h ****    _delay_ms() provides a decreased resolution functionality. In this
 116:/usr/lib/avr/include/util/delay.h ****    mode _delay_ms() will work with a resolution of 1/10 ms, providing
 117:/usr/lib/avr/include/util/delay.h ****    delays up to 6.5535 seconds (independent from CPU frequency).  The
 118:/usr/lib/avr/include/util/delay.h ****    user will not be informed about decreased resolution.
 119:/usr/lib/avr/include/util/delay.h **** 
 120:/usr/lib/avr/include/util/delay.h ****    If the avr-gcc toolchain has __builtin_avr_delay_cycles(unsigned long)
 121:/usr/lib/avr/include/util/delay.h ****    support, maximal possible delay is 4294967.295 ms/ F_CPU in MHz. For
 122:/usr/lib/avr/include/util/delay.h ****    values greater than the maximal possible delay, overflows results in
 123:/usr/lib/avr/include/util/delay.h ****    no delay i.e., 0ms.
 124:/usr/lib/avr/include/util/delay.h **** 
 125:/usr/lib/avr/include/util/delay.h ****    Conversion of __us into clock cycles may not always result in integer.
 126:/usr/lib/avr/include/util/delay.h ****    By default, the clock cycles rounded up to next integer. This ensures that
 127:/usr/lib/avr/include/util/delay.h ****    the user gets atleast __us microseconds of delay.
 128:/usr/lib/avr/include/util/delay.h **** 
 129:/usr/lib/avr/include/util/delay.h ****    Alternatively, user can define __DELAY_ROUND_DOWN__ and __DELAY_ROUND_CLOSEST__
 130:/usr/lib/avr/include/util/delay.h ****    to round down and round to closest integer.
 131:/usr/lib/avr/include/util/delay.h **** 
 132:/usr/lib/avr/include/util/delay.h ****    Note: The new implementation of _delay_ms(double __ms) with 
 133:/usr/lib/avr/include/util/delay.h ****     __builtin_avr_delay_cycles(unsigned long) support is not backward compatible. 
 134:/usr/lib/avr/include/util/delay.h ****    User can define __DELAY_BACKWARD_COMPATIBLE__ to get a backward compatible delay.
 135:/usr/lib/avr/include/util/delay.h ****    Also, the backward compatible
 136:/usr/lib/avr/include/util/delay.h ****    algorithm will be chosen if the code is compiled in a <em>freestanding
 137:/usr/lib/avr/include/util/delay.h ****    environment</em> (GCC option \c -ffreestanding), as the math functions
 138:/usr/lib/avr/include/util/delay.h ****    required for rounding are not available to the compiler then.
 139:/usr/lib/avr/include/util/delay.h **** 
 140:/usr/lib/avr/include/util/delay.h ****  */
 141:/usr/lib/avr/include/util/delay.h **** void
 142:/usr/lib/avr/include/util/delay.h **** _delay_ms(double __ms)
 143:/usr/lib/avr/include/util/delay.h **** {
 144:/usr/lib/avr/include/util/delay.h **** 	double __tmp ; 
 145:/usr/lib/avr/include/util/delay.h **** #if __HAS_DELAY_CYCLES && defined(__OPTIMIZE__) && \
 146:/usr/lib/avr/include/util/delay.h ****   !defined(__DELAY_BACKWARD_COMPATIBLE__) &&	   \
 147:/usr/lib/avr/include/util/delay.h ****   __STDC_HOSTED__
 148:/usr/lib/avr/include/util/delay.h **** 	uint32_t __ticks_dc;
 149:/usr/lib/avr/include/util/delay.h **** 	extern void __builtin_avr_delay_cycles(unsigned long);
 150:/usr/lib/avr/include/util/delay.h **** 	__tmp = ((F_CPU) / 1e3) * __ms;
 151:/usr/lib/avr/include/util/delay.h **** 
 152:/usr/lib/avr/include/util/delay.h **** 	#if defined(__DELAY_ROUND_DOWN__)
 153:/usr/lib/avr/include/util/delay.h **** 		__ticks_dc = (uint32_t)fabs(__tmp);
 154:/usr/lib/avr/include/util/delay.h **** 
 155:/usr/lib/avr/include/util/delay.h **** 	#elif defined(__DELAY_ROUND_CLOSEST__)
 156:/usr/lib/avr/include/util/delay.h **** 		__ticks_dc = (uint32_t)(fabs(__tmp)+0.5);
 157:/usr/lib/avr/include/util/delay.h **** 
 158:/usr/lib/avr/include/util/delay.h **** 	#else
 159:/usr/lib/avr/include/util/delay.h **** 		//round up by default
 160:/usr/lib/avr/include/util/delay.h **** 		__ticks_dc = (uint32_t)(ceil(fabs(__tmp)));
 161:/usr/lib/avr/include/util/delay.h **** 	#endif
 162:/usr/lib/avr/include/util/delay.h **** 
 163:/usr/lib/avr/include/util/delay.h **** 	__builtin_avr_delay_cycles(__ticks_dc);
 415               	.LM27:
 416 0170 87EA      		ldi r24,lo8(24999)
 417 0172 91E6      		ldi r25,hi8(24999)
 418 0174 0197      		1: sbiw r24,1
 419 0176 01F4      		brne 1b
 420 0178 00C0      		rjmp .
 421 017a 0000      		nop
 422 017c 87EA      		ldi r24,lo8(24999)
 423 017e 91E6      		ldi r25,hi8(24999)
 424 0180 0197      		1: sbiw r24,1
 425 0182 01F4      		brne 1b
 426 0184 00C0      		rjmp .
 427 0186 0000      		nop
 428               	.LBE11:
 429               	.LBE10:
 430               	.LBE9:
 432               	.Ltext2:
 107:adc.c         ****    {
 434               	.LM28:
 435 0188 2DB7      		in r18,__SP_L__
 436 018a 3EB7      		in r19,__SP_H__
 437 018c 235F      		subi r18,-13
 438 018e 3F4F      		sbci r19,-1
 439 0190 0FB6      		in __tmp_reg__,__SREG__
 440 0192 F894      		cli
 441 0194 3EBF      		out __SP_H__,r19
 442 0196 0FBE      		out __SREG__,__tmp_reg__
 443 0198 2DBF      		out __SP_L__,r18
 444 019a 8E2D      		mov r24,r14
 445 019c 9927      		clr r25
 446 019e 87FD      		sbrc r24,7
 447 01a0 9095      		com r25
 448 01a2 E7FC      		sbrc r14,7
 449 01a4 00C0      		rjmp .L16
 450 01a6 33E0      		ldi r19,lo8(3)
 451 01a8 3E15      		cp r19,r14
 452 01aa 04F4      		brge .L17
 453 01ac 27E0      		ldi r18,lo8(7)
 454 01ae 2E15      		cp r18,r14
 455 01b0 04F0      		brlt .L16
 118:adc.c         ****          {
 457               	.LM29:
 458 01b2 2091 0000 		lds r18,disableJTAG_flag
 459 01b6 2111      		cpse r18,__zero_reg__
 460 01b8 00C0      		rjmp .L17
 461               	.L16:
 125:adc.c         ****          return eADCwrongAddress;
 463               	.LM30:
 464 01ba 1F92      		push __zero_reg__
 465 01bc 1F92      		push __zero_reg__
 466 01be 81E0      		ldi r24,lo8(1)
 467 01c0 8F93      		push r24
 468 01c2 1F92      		push __zero_reg__
 469 01c4 86E0      		ldi r24,lo8(6)
 470 01c6 8F93      		push r24
 471 01c8 1F92      		push __zero_reg__
 472 01ca E091 0000 		lds r30,CommunicationError_p
 473 01ce F091 0000 		lds r31,CommunicationError_p+1
 474 01d2 0995      		icall
 475 01d4 90E0      		ldi r25,0
 476 01d6 9093 0000 		sts generalErrorCode+1,r25
 477 01da 8093 0000 		sts generalErrorCode,r24
 126:adc.c         ****          break;
 479               	.LM31:
 480 01de 0F90      		pop __tmp_reg__
 481 01e0 0F90      		pop __tmp_reg__
 482 01e2 0F90      		pop __tmp_reg__
 483 01e4 0F90      		pop __tmp_reg__
 484 01e6 0F90      		pop __tmp_reg__
 485 01e8 0F90      		pop __tmp_reg__
 486 01ea 80E8      		ldi r24,lo8(-128)
 487 01ec 00C0      		rjmp .L19
 488               	.L17:
 131:adc.c         **** 
 490               	.LM32:
 491 01ee 0E94 0000 		call atmelReadSingleADCChannelVoltage
 492 01f2 C82F      		mov r28,r24
 134:adc.c         ****    {
 494               	.LM33:
 495 01f4 4E2D      		mov r20,r14
 496 01f6 5527      		clr r21
 497 01f8 47FD      		sbrc r20,7
 498 01fa 5095      		com r21
 499 01fc 652F      		mov r22,r21
 500 01fe 752F      		mov r23,r21
 501 0200 4830      		cpi r20,8
 502 0202 5105      		cpc r21,__zero_reg__
 503 0204 00F4      		brsh .L20
 504 0206 FA01      		movw r30,r20
 505 0208 E050      		subi r30,lo8(-(gs(.L22)))
 506 020a F040      		sbci r31,hi8(-(gs(.L22)))
 507 020c 0C94 0000 		jmp __tablejump2__
 508               		.section	.progmem.gcc_sw_table,"a",@progbits
 509               		.p2align	1
 510               	.L22:
 511 0000 0000      		.word gs(.L21)
 512 0002 0000      		.word gs(.L23)
 513 0004 0000      		.word gs(.L24)
 514 0006 0000      		.word gs(.L25)
 515 0008 0000      		.word gs(.L26)
 516 000a 0000      		.word gs(.L27)
 517 000c 0000      		.word gs(.L28)
 518 000e 0000      		.word gs(.L29)
 519               		.text
 520               	.L21:
 137:adc.c         ****          break;
 522               	.LM34:
 523 0210 8093 0000 		sts res0,r24
 138:adc.c         ****       case 1:
 525               	.LM35:
 526 0214 00C0      		rjmp .L20
 527               	.L23:
 140:adc.c         ****          break;
 529               	.LM36:
 530 0216 8093 0000 		sts res1,r24
 141:adc.c         ****       case 2:
 532               	.LM37:
 533 021a 00C0      		rjmp .L20
 534               	.L24:
 143:adc.c         ****          break;
 536               	.LM38:
 537 021c 8093 0000 		sts res2,r24
 144:adc.c         ****       case 3:
 539               	.LM39:
 540 0220 00C0      		rjmp .L20
 541               	.L25:
 146:adc.c         ****          break;
 543               	.LM40:
 544 0222 8093 0000 		sts res3,r24
 147:adc.c         ****       case 4:
 546               	.LM41:
 547 0226 00C0      		rjmp .L20
 548               	.L26:
 149:adc.c         ****          break;
 550               	.LM42:
 551 0228 8093 0000 		sts res4,r24
 150:adc.c         ****       case 5:
 553               	.LM43:
 554 022c 00C0      		rjmp .L20
 555               	.L27:
 152:adc.c         ****          break;
 557               	.LM44:
 558 022e 8093 0000 		sts res5,r24
 153:adc.c         ****       case 6:
 560               	.LM45:
 561 0232 00C0      		rjmp .L20
 562               	.L28:
 155:adc.c         ****          break;
 564               	.LM46:
 565 0234 8093 0000 		sts res6,r24
 156:adc.c         ****       case 7:
 567               	.LM47:
 568 0238 00C0      		rjmp .L20
 569               	.L29:
 158:adc.c         ****          break;
 571               	.LM48:
 572 023a 8093 0000 		sts res7,r24
 573               	.L20:
 163:adc.c         ****    {
 575               	.LM49:
 576 023e CC23      		tst r28
 577 0240 01F0      		breq .L30
 165:adc.c         ****       return status;
 579               	.LM50:
 580 0242 E091 0000 		lds r30,ptr_uartStruct
 581 0246 F091 0000 		lds r31,ptr_uartStruct+1
 582 024a 8381      		ldd r24,Z+3
 583 024c 8F93      		push r24
 584 024e 8281      		ldd r24,Z+2
 585 0250 8F93      		push r24
 586 0252 8181      		ldd r24,Z+1
 587 0254 8F93      		push r24
 588 0256 8081      		ld r24,Z
 589 0258 8F93      		push r24
 590 025a 20E0      		ldi r18,lo8(__c.2973)
 591 025c 30E0      		ldi r19,hi8(__c.2973)
 592 025e 3F93      		push r19
 593 0260 2F93      		push r18
 594 0262 81E0      		ldi r24,lo8(1)
 595 0264 8F93      		push r24
 596 0266 8FEF      		ldi r24,lo8(-1)
 597 0268 8F93      		push r24
 598 026a 8CE9      		ldi r24,lo8(-100)
 599 026c 8F93      		push r24
 600 026e 1F92      		push __zero_reg__
 601 0270 E091 0000 		lds r30,CommunicationError_p
 602 0274 F091 0000 		lds r31,CommunicationError_p+1
 603 0278 0995      		icall
 166:adc.c         ****    }
 605               	.LM51:
 606 027a 8C2F      		mov r24,r28
 607 027c 2DB7      		in r18,__SP_L__
 608 027e 3EB7      		in r19,__SP_H__
 609 0280 265F      		subi r18,-10
 610 0282 3F4F      		sbci r19,-1
 611 0284 0FB6      		in __tmp_reg__,__SREG__
 612 0286 F894      		cli
 613 0288 3EBF      		out __SP_H__,r19
 614 028a 0FBE      		out __SREG__,__tmp_reg__
 615 028c 2DBF      		out __SP_L__,r18
 616 028e 00C0      		rjmp .L19
 617               	.L30:
 168:adc.c         **** 
 619               	.LM52:
 620 0290 E801      		movw r28,r16
 621 0292 CC0F      		lsl r28
 622 0294 DD1F      		rol r29
 623 0296 C050      		subi r28,lo8(-(atmelAdcValues))
 624 0298 D040      		sbci r29,hi8(-(atmelAdcValues))
 625 029a 8981      		ldd r24,Y+1
 626 029c 8F93      		push r24
 627 029e 8881      		ld r24,Y
 628 02a0 8F93      		push r24
 629 02a2 20E0      		ldi r18,lo8(__c.2975)
 630 02a4 30E0      		ldi r19,hi8(__c.2975)
 631 02a6 3F93      		push r19
 632 02a8 2F93      		push r18
 633 02aa 20E0      		ldi r18,lo8(filename)
 634 02ac 30E0      		ldi r19,hi8(filename)
 635 02ae 3F93      		push r19
 636 02b0 2F93      		push r18
 637 02b2 1F92      		push __zero_reg__
 638 02b4 88EA      		ldi r24,lo8(-88)
 639 02b6 8F93      		push r24
 640 02b8 1F92      		push __zero_reg__
 641 02ba 1F92      		push __zero_reg__
 642 02bc 1F92      		push __zero_reg__
 643 02be 85E0      		ldi r24,lo8(5)
 644 02c0 8F93      		push r24
 645 02c2 82E0      		ldi r24,lo8(2)
 646 02c4 8F93      		push r24
 647 02c6 E091 0000 		lds r30,printDebug_p
 648 02ca F091 0000 		lds r31,printDebug_p+1
 649 02ce 0995      		icall
 170:adc.c         ****    {
 651               	.LM53:
 652 02d0 8DB7      		in r24,__SP_L__
 653 02d2 9EB7      		in r25,__SP_H__
 654 02d4 0D96      		adiw r24,13
 655 02d6 0FB6      		in __tmp_reg__,__SREG__
 656 02d8 F894      		cli
 657 02da 9EBF      		out __SP_H__,r25
 658 02dc 0FBE      		out __SREG__,__tmp_reg__
 659 02de 8DBF      		out __SP_L__,r24
 660 02e0 F110      		cpse r15,__zero_reg__
 661 02e2 00C0      		rjmp .L31
 172:adc.c         **** 
 663               	.LM54:
 664 02e4 4CE8      		ldi r20,lo8(-116)
 665 02e6 50E0      		ldi r21,0
 666 02e8 60E0      		ldi r22,lo8(uart_message_string)
 667 02ea 70E0      		ldi r23,hi8(uart_message_string)
 668 02ec 8091 0000 		lds r24,ptr_uartStruct
 669 02f0 9091 0000 		lds r25,ptr_uartStruct+1
 670 02f4 0E94 0000 		call createReceiveHeader
 175:adc.c         **** 			   uart_message_string, channelIndex, atmelAdcValues[channelIndex]);
 672               	.LM55:
 673 02f8 8981      		ldd r24,Y+1
 674 02fa 8F93      		push r24
 675 02fc 8881      		ld r24,Y
 676 02fe 8F93      		push r24
 677 0300 1F93      		push r17
 678 0302 EF92      		push r14
 679 0304 80E0      		ldi r24,lo8(uart_message_string)
 680 0306 90E0      		ldi r25,hi8(uart_message_string)
 681 0308 9F93      		push r25
 682 030a 8F93      		push r24
 683 030c 20E0      		ldi r18,lo8(__c.2977)
 684 030e 30E0      		ldi r19,hi8(__c.2977)
 685 0310 3F93      		push r19
 686 0312 2F93      		push r18
 687 0314 1F92      		push __zero_reg__
 688 0316 2BE8      		ldi r18,lo8(-117)
 689 0318 2F93      		push r18
 690 031a 9F93      		push r25
 691 031c 8F93      		push r24
 692 031e 0E94 0000 		call snprintf_P
 178:adc.c         ****    }
 694               	.LM56:
 695 0322 E091 0000 		lds r30,UART0_Send_Message_String_p
 696 0326 F091 0000 		lds r31,UART0_Send_Message_String_p+1
 697 032a 6BE8      		ldi r22,lo8(-117)
 698 032c 70E0      		ldi r23,0
 699 032e 80E0      		ldi r24,lo8(uart_message_string)
 700 0330 90E0      		ldi r25,hi8(uart_message_string)
 701 0332 0995      		icall
 702 0334 2DB7      		in r18,__SP_L__
 703 0336 3EB7      		in r19,__SP_H__
 704 0338 245F      		subi r18,-12
 705 033a 3F4F      		sbci r19,-1
 706 033c 0FB6      		in __tmp_reg__,__SREG__
 707 033e F894      		cli
 708 0340 3EBF      		out __SP_H__,r19
 709 0342 0FBE      		out __SREG__,__tmp_reg__
 710 0344 2DBF      		out __SP_L__,r18
 711               	.L31:
 180:adc.c         **** }//END of atmelCollectSingleADCChannel function
 713               	.LM57:
 714 0346 80E0      		ldi r24,0
 715               	.L19:
 716               	/* epilogue start */
 181:adc.c         **** 
 718               	.LM58:
 719 0348 DF91      		pop r29
 720 034a CF91      		pop r28
 721 034c 1F91      		pop r17
 722 034e 0F91      		pop r16
 723 0350 FF90      		pop r15
 724 0352 EF90      		pop r14
 725 0354 0895      		ret
 730               	.Lscope2:
 733               	.global	atmelReadADCs
 735               	atmelReadADCs:
  54:adc.c         ****    switch(ptr_uartStruct->number_of_arguments)
 737               	.LM59:
 738               	.LFBB3:
 739 0356 CF93      		push r28
 740 0358 DF93      		push r29
 741               	/* prologue: function */
 742               	/* frame size = 0 */
 743               	/* stack size = 2 */
 744               	.L__stack_usage = 2
 745 035a EC01      		movw r28,r24
  55:adc.c         ****    {
 747               	.LM60:
 748 035c 8B8D      		ldd r24,Y+27
 749 035e 8823      		tst r24
 750 0360 01F0      		breq .L34
 751 0362 8130      		cpi r24,lo8(1)
 752 0364 01F4      		brne .L41
 753               	.LBB12:
  71:adc.c         **** 
 755               	.LM61:
 756 0366 80E0      		ldi r24,lo8(__c.2937)
 757 0368 90E0      		ldi r25,hi8(__c.2937)
 758 036a 9F93      		push r25
 759 036c 8F93      		push r24
 760 036e 80E0      		ldi r24,lo8(filename)
 761 0370 90E0      		ldi r25,hi8(filename)
 762 0372 9F93      		push r25
 763 0374 8F93      		push r24
 764 0376 1F92      		push __zero_reg__
 765 0378 87E4      		ldi r24,lo8(71)
 766 037a 8F93      		push r24
 767 037c 1F92      		push __zero_reg__
 768 037e 1F92      		push __zero_reg__
 769 0380 1F92      		push __zero_reg__
 770 0382 85E0      		ldi r24,lo8(5)
 771 0384 8F93      		push r24
 772 0386 82E0      		ldi r24,lo8(2)
 773 0388 8F93      		push r24
 774 038a E091 0000 		lds r30,printDebug_p
 775 038e F091 0000 		lds r31,printDebug_p+1
 776 0392 0995      		icall
  76:adc.c         ****       }
 778               	.LM62:
 779 0394 8DB7      		in r24,__SP_L__
 780 0396 9EB7      		in r25,__SP_H__
 781 0398 0B96      		adiw r24,11
 782 039a 0FB6      		in __tmp_reg__,__SREG__
 783 039c F894      		cli
 784 039e 9EBF      		out __SP_H__,r25
 785 03a0 0FBE      		out __SREG__,__tmp_reg__
 786 03a2 8DBF      		out __SP_L__,r24
 787 03a4 60E0      		ldi r22,0
 788 03a6 8881      		ld r24,Y
 789               	/* epilogue start */
 790               	.LBE12:
  85:adc.c         **** 
 792               	.LM63:
 793 03a8 DF91      		pop r29
 794 03aa CF91      		pop r28
 795               	.LBB13:
  76:adc.c         ****       }
 797               	.LM64:
 798 03ac 0C94 0000 		jmp atmelCollectSingleADCChannel
 799               	.L34:
 800               	.LBE13:
 801               	.LBB14:
  62:adc.c         ****          for (channelIndex = 0; channelIndex < channelIndexMax; channelIndex++)
 803               	.LM65:
 804 03b0 8091 0000 		lds r24,disableJTAG_flag
 805 03b4 8823      		tst r24
 806 03b6 01F0      		breq .L39
 807 03b8 D8E0      		ldi r29,lo8(8)
 808 03ba 00C0      		rjmp .L36
 809               	.L39:
 810 03bc D4E0      		ldi r29,lo8(4)
 811               	.L36:
  63:adc.c         ****          {
 813               	.LM66:
 814 03be C0E0      		ldi r28,0
 815               	.L38:
  65:adc.c         ****          }
 817               	.LM67:
 818 03c0 60E0      		ldi r22,0
 819 03c2 8C2F      		mov r24,r28
 820 03c4 0E94 0000 		call atmelCollectSingleADCChannel
 821 03c8 CF5F      		subi r28,lo8(-(1))
  63:adc.c         ****          {
 823               	.LM68:
 824 03ca CD17      		cp r28,r29
 825 03cc 04F0      		brlt .L38
 826 03ce 00C0      		rjmp .L32
 827               	.L41:
 828               	.LBE14:
  80:adc.c         ****          break;
 830               	.LM69:
 831 03d0 80E0      		ldi r24,lo8(__c.2941)
 832 03d2 90E0      		ldi r25,hi8(__c.2941)
 833 03d4 9F93      		push r25
 834 03d6 8F93      		push r24
 835 03d8 81E0      		ldi r24,lo8(1)
 836 03da 8F93      		push r24
 837 03dc 8FEF      		ldi r24,lo8(-1)
 838 03de 8F93      		push r24
 839 03e0 8CE9      		ldi r24,lo8(-100)
 840 03e2 8F93      		push r24
 841 03e4 1F92      		push __zero_reg__
 842 03e6 E091 0000 		lds r30,CommunicationError_p
 843 03ea F091 0000 		lds r31,CommunicationError_p+1
 844 03ee 0995      		icall
 845 03f0 90E0      		ldi r25,0
 846 03f2 9093 0000 		sts generalErrorCode+1,r25
 847 03f6 8093 0000 		sts generalErrorCode,r24
  81:adc.c         ****    }
 849               	.LM70:
 850 03fa 0F90      		pop __tmp_reg__
 851 03fc 0F90      		pop __tmp_reg__
 852 03fe 0F90      		pop __tmp_reg__
 853 0400 0F90      		pop __tmp_reg__
 854 0402 0F90      		pop __tmp_reg__
 855 0404 0F90      		pop __tmp_reg__
 856               	.L32:
 857               	/* epilogue start */
  85:adc.c         **** 
 859               	.LM71:
 860 0406 DF91      		pop r29
 861 0408 CF91      		pop r28
 862 040a 0895      		ret
 868               	.Lscope3:
 869               		.section	.progmem.data,"a",@progbits
 872               	__c.2994:
 873 0000 7661 6C75 		.string	"value = %i"
 873      6520 3D20 
 873      2569 00
 876               	__c.2989:
 877 000b 5469 6D65 		.string	"Timeout"
 877      6F75 7400 
 880               	__c.2977:
 881 0013 2573 2578 		.string	"%s%x %x"
 881      2025 7800 
 884               	__c.2975:
 885 001b 7661 6C75 		.string	"value %i"
 885      6520 2569 
 885      00
 888               	__c.2973:
 889 0024 6572 726F 		.string	"error accessing ADC channel %i"
 889      7220 6163 
 889      6365 7373 
 889      696E 6720 
 889      4144 4320 
 892               	__c.2947:
 893 0043 6368 616E 		.string	"channel index %i"
 893      6E65 6C20 
 893      696E 6465 
 893      7820 2569 
 893      00
 896               	__c.2941:
 897 0054 696E 7661 		.string	"invalid number of arguments"
 897      6C69 6420 
 897      6E75 6D62 
 897      6572 206F 
 897      6620 6172 
 900               	__c.2937:
 901 0070 00        		.zero	1
 904               	filename:
 905 0071 6164 632E 		.string	"adc.c"
 905      6300 
 906               		.comm	ErrorCodes,1,1
 907               		.comm	LED,2,1
 908               		.comm	canTimerInterval,4,1
 913               		.text
 915               	.Letext0:
 916               		.ident	"GCC: (GNU) 4.8.1"
 917               	.global __do_clear_bss
DEFINED SYMBOLS
                            *ABS*:00000000 adc.c
     /tmp/ccsOXSpd.s:2      *ABS*:0000003e __SP_H__
     /tmp/ccsOXSpd.s:3      *ABS*:0000003d __SP_L__
     /tmp/ccsOXSpd.s:4      *ABS*:0000003f __SREG__
     /tmp/ccsOXSpd.s:5      *ABS*:0000003b __RAMPZ__
     /tmp/ccsOXSpd.s:6      *ABS*:00000000 __tmp_reg__
     /tmp/ccsOXSpd.s:7      *ABS*:00000001 __zero_reg__
     /tmp/ccsOXSpd.s:158    .text:00000000 atmelReadSingleADCChannelVoltage
     /tmp/ccsOXSpd.s:876    .progmem.data:0000000b __c.2989
     /tmp/ccsOXSpd.s:904    .progmem.data:00000071 filename
     /tmp/ccsOXSpd.s:872    .progmem.data:00000000 __c.2994
     /tmp/ccsOXSpd.s:364    .text:00000126 atmelCollectSingleADCChannel
     /tmp/ccsOXSpd.s:892    .progmem.data:00000043 __c.2947
     /tmp/ccsOXSpd.s:888    .progmem.data:00000024 __c.2973
     /tmp/ccsOXSpd.s:884    .progmem.data:0000001b __c.2975
     /tmp/ccsOXSpd.s:880    .progmem.data:00000013 __c.2977
     /tmp/ccsOXSpd.s:735    .text:00000356 atmelReadADCs
     /tmp/ccsOXSpd.s:900    .progmem.data:00000070 __c.2937
     /tmp/ccsOXSpd.s:896    .progmem.data:00000054 __c.2941
                            *COM*:00000001 ErrorCodes
                            *COM*:00000002 LED
                            *COM*:00000004 canTimerInterval

UNDEFINED SYMBOLS
disableJTAG_flag
atmelAdcValues
printDebug_p
__divmodhi4
CommunicationError_p
generalErrorCode
__tablejump2__
res0
res1
res2
res3
res4
res5
res6
res7
ptr_uartStruct
uart_message_string
createReceiveHeader
snprintf_P
UART0_Send_Message_String_p
__do_clear_bss
