From 4cff703b53bd28846a0691506b6f6c5ddb980d6e Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sun, 20 May 2012 02:17:25 +0000 Subject: fixed adc read ??? git-svn-id: https://svn.spreadspace.org/mur.sat@448 7de4ea59-55d0-425e-a1af-a3118ea81d4c --- software/hhd70dongle/util.c | 24 +++++++++++++----------- software/hhd70dongle/util.h | 7 +++---- 2 files changed, 16 insertions(+), 15 deletions(-) (limited to 'software') diff --git a/software/hhd70dongle/util.c b/software/hhd70dongle/util.c index b0e6e89..2c358fa 100644 --- a/software/hhd70dongle/util.c +++ b/software/hhd70dongle/util.c @@ -70,18 +70,20 @@ void reset(void) #endif } -int16_t adc_read(uint8_t mux) +uint8_t adc_read(uint8_t mux) { - uint8_t low; - char aref = 0b01000000; - ADCSRA = (1< save power + + return ADCH; } void debug_sprint_int16hex(uint8_t *buffer, int16_t num) @@ -93,4 +95,4 @@ void debug_sprint_int16hex(uint8_t *buffer, int16_t num) buffer[c] = n + ((n < 10) ? '0' : 'A' - 10); } buffer[4]=0; -} \ No newline at end of file +} diff --git a/software/hhd70dongle/util.h b/software/hhd70dongle/util.h index 1c4cb21..20068fd 100644 --- a/software/hhd70dongle/util.h +++ b/software/hhd70dongle/util.h @@ -32,13 +32,12 @@ #ifndef MURSAT_util_h_INCLUDED #define MURSAT_util_h_INCLUDED -#define ADC_PRESCALER 0 -#define ADCMUX_INTERNALTEMP 0b100111 -#define ADCMUX_ADC12 0b100100 +#define ADCMUX_INTERNALTEMP 0b00100111 +#define ADCMUX_ADC12 0b00100100 void reset(void); -int16_t adc_read(uint8_t mux); +uint8_t adc_read(uint8_t mux); void debug_sprint_int16hex(uint8_t *buffer, int16_t num); #endif -- cgit v1.2.3