Project

General

Profile

Revision 1862

Added by Dan Jacobs over 13 years ago

killed analog loop

View differences:

trunk/code/projects/libdragonfly/analog.c
74 74
 *
75 75
 **/
76 76
void analog_init(int start_conversion) {
77
	start_conversion=0;                   //forces the analog loop off
77 78
	for (int i = 0; i < 11; i++) {
78 79
		an_val[i].adc10 = 0;
79 80
		an_val[i].adc8 = 0;
......
94 95
	// Bit 5 - Enable Auto Trigger (for free running mode) NOT DOING THIS RIGHT NOW
95 96
	// Bit 4 - ADC interrupt flag, 0
96 97
	// Bit 3 - Enable ADC Interrupt (required to run free-running mode)
97
	// Bits 2-0 - Set to create a clock divisor of 128, to make ADC clock = 8,000,000/64 = 125kHz
98
	// Bits 2-0 - Set to create a clock divisor of 2, to make ADC clock != 8,000,000/64 = 125kHz (it runs at highest frequency)
98 99
	ADCSRA = 0;
99
	ADCSRA |= _BV(ADEN) | _BV(ADPS2) | _BV(ADPS1) | _BV(ADPS0);
100
	ADCSRA |= _BV(ADEN) | /*_BV(ADPS2) | _BV(ADPS1) |*/ _BV(ADPS0);
100 101
	
101 102
	// Set external mux lines to outputs
102 103
	DDRG |= 0x1C;
......
132 133
 * @see analog10, analog_get8, analog_get10
133 134
 **/
134 135
unsigned int analog8(int which) {
135
	if (which == BOM_PORT) {
136
/*	if (which == BOM_PORT) {
136 137
		return 0;
137 138
	} else {
138 139
		return an_val[which - 1].adc8;
139 140
	}
141
*/
142
return analog_get8(which);
140 143
}
141 144

  
142 145
/**
......
159 162
 * @see analog8, analog_get8, analog_get10
160 163
 **/
161 164
unsigned int analog10(int which) {
162
	if (which == BOM_PORT) {
165
/*	if (which == BOM_PORT) {
163 166
		return 0;
164 167
	} else {
165 168
		return an_val[which - 1].adc10;
166 169
	}
170
*/
171
return analog_get10(which);
167 172
}
168 173

  
169 174
/**

Also available in: Unified diff