From 89385e621020b4d6dc6e758ff7ee7fa11e662cf5 Mon Sep 17 00:00:00 2001 From: vrokas Date: Sun, 11 Jun 2006 21:40:26 +0000 Subject: [PATCH] * device/include/pic16/adc.h, device/include/lib/pic16/libio/adc/adcopen.c: applied patch #1364387 and fixed bug #1364390 git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4218 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- ChangeLog | 3 +++ device/include/pic16/adc.h | 9 +++++---- device/lib/pic16/libio/adc/adcopen.c | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index b85ebecc..a9564d6e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,9 @@ * src/pic16/gen.c (genCast): fixed bug with assignment of a pointer to a char variable. Fixed bug #1504211 + * device/include/pic16/adc.h, + device/include/lib/pic16/libio/adc/adcopen.c: applied patch #1364387 + and fixed bug #1364390 2006-06-10 Borut Razem diff --git a/device/include/pic16/adc.h b/device/include/pic16/adc.h index 333e9909..68a685e2 100644 --- a/device/include/pic16/adc.h +++ b/device/include/pic16/adc.h @@ -44,11 +44,12 @@ /* oscillator frequency */ #define ADC_FOSC_2 0x00 -#define ADC_FOSC_4 0x10 -#define ADC_FOSC_16 0x11 +#define ADC_FOSC_4 0x04 +#define ADC_FOSC_8 0x01 +#define ADC_FOSC_16 0x05 #define ADC_FOSC_32 0x02 -#define ADC_FOSC_64 0x12 -#define ADC_FOSC_RC 0x03 +#define ADC_FOSC_64 0x06 +#define ADC_FOSC_RC 0x07 /* channel selection */ diff --git a/device/lib/pic16/libio/adc/adcopen.c b/device/lib/pic16/libio/adc/adcopen.c index 1842eb10..980cac5c 100644 --- a/device/lib/pic16/libio/adc/adcopen.c +++ b/device/lib/pic16/libio/adc/adcopen.c @@ -54,7 +54,7 @@ void adc_open(unsigned char channel, unsigned char fosc, unsigned char pcfg, uns /* setup reference and pins */ ADCON1 |= pcfg & 0x0f; - ADCON0 |= (config & ADC_FRM_RJUST); + ADCON1 |= (config & ADC_FRM_RJUST); if(config & ADC_INT_ON) { PIR1bits.ADIF = 0; -- 2.30.2