From 4208123bfbccd41e7c684fa5e5fb13f1e472fcf0 Mon Sep 17 00:00:00 2001 From: asterix Date: Fri, 28 May 2010 12:49:27 +0000 Subject: [PATCH] Add support for missing avr cpu. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3872 38d2e660-2303-0410-9eaa-f027e97ec537 --- bertos/cpu/avr/drv/adc_avr.c | 8 +++++++- bertos/drv/adc.h | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/bertos/cpu/avr/drv/adc_avr.c b/bertos/cpu/avr/drv/adc_avr.c index 9a6f2d39..7e932f62 100644 --- a/bertos/cpu/avr/drv/adc_avr.c +++ b/bertos/cpu/avr/drv/adc_avr.c @@ -99,7 +99,13 @@ void adc_hw_select_ch(uint8_t ch) { /* Set to 0 all mux registers */ - ADMUX &= ~(BV(MUX4) | BV(MUX3) | BV(MUX2) | BV(MUX1) | BV(MUX0)); + #if CPU_AVR_ATMEGA8 || CPU_AVR_ATMEGA328P || CPU_AVR_ATMEGA168 + ADMUX &= ~(BV(MUX3) | BV(MUX2) | BV(MUX1) | BV(MUX0)); + #elif CPU_AVR_ATMEGA32 || CPU_AVR_ATMEGA64 || CPU_AVR_ATMEGA128 || CPU_AVR_ATMEGA1281 + ADMUX &= ~(BV(MUX4) | BV(MUX3) | BV(MUX2) | BV(MUX1) | BV(MUX0)); + #else + #error Unknown CPU + #endif /* Select channel, only first 8 channel modes are supported for now */ ADMUX |= (ch & 0x07); diff --git a/bertos/drv/adc.h b/bertos/drv/adc.h index 1aa0a4ac..78f3e81d 100644 --- a/bertos/drv/adc.h +++ b/bertos/drv/adc.h @@ -36,7 +36,7 @@ * * $WIZ$ module_name = "adc" * $WIZ$ module_configuration = "bertos/cfg/cfg_adc.h" - * $WIZ$ module_supports = "not atmega103 and not atmega168 and not atmega8" + * $WIZ$ module_supports = "not atmega103" */ -- 2.25.1