Author: sebastien.lelong
Date: Wed Jul 8 10:10:35 2009
New Revision: 1097
Modified:
trunk/include/peripheral/adc/adc_channels.jal
trunk/test/unittest/16f88_adc.jalt
trunk/tools/adc/adc_channels.jal.tmpl
trunk/tools/build/unittest.sh
Log:
remove ANS bits normalization from adc_channels.jal lib, in favor of device
files JANSEL_ANSx bits
Modified: trunk/include/peripheral/adc/adc_channels.jal
==============================================================================
--- trunk/include/peripheral/adc/adc_channels.jal (original)
+++ trunk/include/peripheral/adc/adc_channels.jal Wed Jul 8 10:10:35 2009
@@ -1658,139 +1658,9 @@
-- - bit ANSELH_ANSx (8 <= x <= 13, or 8 <= x <= 12)
--
-- There's a need for normalization...
- -- All ANS bits will looks like: JALLIB_ANSx
+ -- ANS bits are now normalized in device files :)
+ -- I (Seb) keep these grep & sed rules as tools to check future changes
- -- PICs: 10f220, 10f222, 12f510, 16f506, 16f526
- if defined(ADCON0_ANS) == true then
- var volatile bit JALLIB_ANS0 at ADCON0_ANS : 0
- var volatile bit JALLIB_ANS1 at ADCON0_ANS : 1
- end if
-
- -- PICs: 16f785, 16hv785
- if defined(ANSEL0_ANS0) == true then
- var volatile bit JALLIB_ANS0 is ANSEL0_ANS0
- var volatile bit JALLIB_ANS1 is ANSEL0_ANS1
- var volatile bit JALLIB_ANS2 is ANSEL0_ANS2
- var volatile bit JALLIB_ANS3 is ANSEL0_ANS3
- var volatile bit JALLIB_ANS4 is ANSEL0_ANS4
- var volatile bit JALLIB_ANS5 is ANSEL0_ANS5
- var volatile bit JALLIB_ANS6 is ANSEL0_ANS6
- var volatile bit JALLIB_ANS7 is ANSEL0_ANS7
- end if
- -- PICs: 16f785, 16hv785
- if defined(ANSEL1_ANS8) == true then
- var volatile bit JALLIB_ANS8 is ANSEL1_ANS8
- var volatile bit JALLIB_ANS9 is ANSEL1_ANS9
- var volatile bit JALLIB_ANS10 is ANSEL1_ANS10
- var volatile bit JALLIB_ANS11 is ANSEL1_ANS11
- end if
-
- -- PICs: 16f722, 16f723, 16f724, 16f726, 16f727, 16lf722, 16lf723,
16lf724, 16lf726, 16lf727
- if defined(ANSELA_ANSA) == true then
- var volatile bit JALLIB_ANS0 at ANSELA_ANSA : 0
- var volatile bit JALLIB_ANS1 at ANSELA_ANSA : 1
- var volatile bit JALLIB_ANS2 at ANSELA_ANSA : 2
- var volatile bit JALLIB_ANS3 at ANSELA_ANSA : 3
- var volatile bit JALLIB_ANS4 at ANSELA_ANSA : 4
- var volatile bit JALLIB_ANS5 at ANSELA_ANSA : 5
- end if
- -- PICs: 16f722, 16f723, 16f724, 16f726, 16f727, 16lf722, 16lf723,
16lf724, 16lf726, 16lf727
- if defined(ANSELB_ANSB) == true then
- var volatile bit JALLIB_ANS6 at ANSELB_ANSB : 0
- var volatile bit JALLIB_ANS7 at ANSELB_ANSB : 1
- var volatile bit JALLIB_ANS8 at ANSELB_ANSB : 2
- var volatile bit JALLIB_ANS9 at ANSELB_ANSB : 3
- var volatile bit JALLIB_ANS10 at ANSELB_ANSB : 4
- var volatile bit JALLIB_ANS11 at ANSELB_ANSB : 5
- end if
- -- PICs: 16f724, 16f727, 16lf724, 16lf727
- if defined(ANSELD_ANSD) == true then
- var volatile bit JALLIB_ANS12 at ANSELD_ANSD : 0
- var volatile bit JALLIB_ANS13 at ANSELD_ANSD : 1
- var volatile bit JALLIB_ANS14 at ANSELD_ANSD : 2
- var volatile bit JALLIB_ANS15 at ANSELD_ANSD : 3
- var volatile bit JALLIB_ANS16 at ANSELD_ANSD : 4
- var volatile bit JALLIB_ANS17 at ANSELD_ANSD : 5
- var volatile bit JALLIB_ANS18 at ANSELD_ANSD : 6
- var volatile bit JALLIB_ANS19 at ANSELD_ANSD : 7
- end if
- -- PICs: 16f724, 16f727, 16lf724, 16lf727
- if defined(ANSELE_ANSE) == true then
- var volatile bit JALLIB_ANS20 at ANSELE_ANSE : 0
- var volatile bit JALLIB_ANS21 at ANSELE_ANSE : 1
- var volatile bit JALLIB_ANS22 at ANSELE_ANSE : 2
- end if
-
- -- PICs: 16f677, 16f685, 16f687, 16f689, 16f690, 18f13k22, 18f13k50,
18f14k22,
- -- 18f14k50, 18lf13k22, 18lf13k50, 18lf14k22, 18lf14k50
- -- ANSELH_ANSELH can be associated (ie. "high part of") ANSEL_ANSx and
ANSEL_ANSELx
- if defined(ANSELH_ANSELH) == true then
- var volatile bit JALLIB_ANS8 at ANSELH_ANSELH : 0
- var volatile bit JALLIB_ANS9 at ANSELH_ANSELH : 1
- var volatile bit JALLIB_ANS10 at ANSELH_ANSELH : 2
- var volatile bit JALLIB_ANS11 at ANSELH_ANSELH : 3
- end if
-
- -- PICs: 12f609, 12f615, 12f675, 12f683, 12hv609, 12hv615
- if defined(ANSEL_ANS) == true then
- var volatile bit JALLIB_ANS0 at ANSEL_ANS : 0
- var volatile bit JALLIB_ANS1 at ANSEL_ANS : 1
- var volatile bit JALLIB_ANS2 at ANSEL_ANS : 2
- var volatile bit JALLIB_ANS3 at ANSEL_ANS : 3
- end if
-
- -- PICs: 16f610, 16f616, 16f676, 16f677, 16f684, 16f685, 16f687,
16f688, 16f689,
- -- 16f690, 16f88, 16f882, 16f883, 16f884, 16f886, 16f887,
16hv610, 16hv616,
- -- 18f23k20, 18f24k20, 18f25k20, 18f26k20, 18f43k20, 18f44k20,
18f45k20, 18f46k20
- if defined(ANSEL_ANS0) == true then
- -- ANS0 always comes with ANS1 and ANS4
- var volatile bit JALLIB_ANS0 is ANSEL_ANS0
- var volatile bit JALLIB_ANS1 is ANSEL_ANS1
- var volatile bit JALLIB_ANS4 is ANSEL_ANS4
- end if
- -- PICs: 16f616, 16f676, 16f677, 16f684, 16f685, 16f687, 16f688,
16f689, 16f690,
- -- 16f88, 16f882, 16f883, 16f884, 16f886, 16f887, 16hv616,
18f23k20, 18f24k20,
- -- 18f25k20, 18f26k20, 18f43k20, 18f44k20, 18f45k20, 18f46k20,
- if defined(ANSEL_ANS2) == true then
- var volatile bit JALLIB_ANS2 is ANSEL_ANS2
- end if
- -- PICs: 16f616, 16f676, 16f677, 16f684, 16f685, 16f687, 16f688,
16f689, 16f690,
- -- 16f88, 16f882, 16f883, 16f884, 16f886, 16f887, 16hv616,
18f23k20, 18f24k20,
- -- 18f25k20, 18f26k20, 18f43k20, 18f44k20, 18f45k20, 18f46k20,
- if defined(ANSEL_ANS3) == true then
- var volatile bit JALLIB_ANS3 is ANSEL_ANS3
- end if
- -- PICs: 16f610, 16f616, 16f676, 16f677, 16f684, 16f685, 16f687,
16f688, 16f689,
- -- 16f690, 16f88, 16f884, 16f887, 16hv610, 16hv616, 18f43k20,
18f44k20,
- -- 18f45k20, 18f46k20,
- if defined(ANSEL_ANS5) == true then
- -- ANS5 always comes with ANS6
- var volatile bit JALLIB_ANS5 is ANSEL_ANS5
- var volatile bit JALLIB_ANS6 is ANSEL_ANS6
- end if
- -- PICs: 16f610, 16f616, 16f676, 16f677, 16f684, 16f685, 16f687,
16f688, 16f689,
- -- 16f690, 16f884, 16f887, 16hv610, 16hv616, 18f43k20, 18f44k20,
18f45k20, 18f46k20,
- if defined(ANSEL_ANS7) == true then
- var volatile bit JALLIB_ANS7 is ANSEL_ANS7
- end if
- -- PICs: 18f13k22, 18f14k22, 18lf13k22, 18lf14k22
- if defined(ANSEL_ANSEL0) == true then
- -- ANSEL0 always comes with ANSEL1 and ANSEL2
- var volatile bit JALLIB_ANS0 is ANSEL_ANSEL0
- var volatile bit JALLIB_ANS1 is ANSEL_ANSEL1
- var volatile bit JALLIB_ANS2 is ANSEL_ANSEL2
- end if
- -- PICs: 18f13k22, 18f13k50, 18f14k22, 18f14k50, 18lf13k22, 18lf13k50,
18lf14k22, 18lf14k50
- if defined(ANSEL_ANSEL3) == true then
- -- ANSEL3 always comes with ANSEL4, ANSEL5, ANSEL6 and ANSEL7
- var volatile bit JALLIB_ANS3 is ANSEL_ANSEL3
- var volatile bit JALLIB_ANS4 is ANSEL_ANSEL4
- var volatile bit JALLIB_ANS5 is ANSEL_ANSEL5
- var volatile bit JALLIB_ANS6 is ANSEL_ANSEL6
- var volatile bit JALLIB_ANS7 is ANSEL_ANSEL7
- end if
-
- -- Now, it's normalized...
-- Provide helper func to configure pins either in digital or analog
mode
-- (/!\, true/false logic is inverted compared to PCFGx bits)
@@ -1802,141 +1672,141 @@
-- one named AN12, if any
-- - set_analog_pin(4) will do the same for AN4
procedure set_analog_pin(byte in an_pin_num) is
- if defined(JALLIB_ANS0) == true then
+ if defined(JANSEL_ANS0) == true then
if an_pin_num == 0 then
- JALLIB_ANS0 = true
+ JANSEL_ANS0 = true
pin_AN0_direction = input
end if
end if
- if defined(JALLIB_ANS1) == true then
+ if defined(JANSEL_ANS1) == true then
if an_pin_num == 1 then
- JALLIB_ANS1 = true
+ JANSEL_ANS1 = true
pin_AN1_direction = input
end if
end if
- if defined(JALLIB_ANS2) == true then
+ if defined(JANSEL_ANS2) == true then
if an_pin_num == 2 then
- JALLIB_ANS2 = true
+ JANSEL_ANS2 = true
pin_AN2_direction = input
end if
end if
- if defined(JALLIB_ANS3) == true then
+ if defined(JANSEL_ANS3) == true then
if an_pin_num == 3 then
- JALLIB_ANS3 = true
+ JANSEL_ANS3 = true
pin_AN3_direction = input
end if
end if
- if defined(JALLIB_ANS4) == true then
+ if defined(JANSEL_ANS4) == true then
if an_pin_num == 4 then
- JALLIB_ANS4 = true
+ JANSEL_ANS4 = true
pin_AN4_direction = input
end if
end if
- if defined(JALLIB_ANS5) == true then
+ if defined(JANSEL_ANS5) == true then
if an_pin_num == 5 then
- JALLIB_ANS5 = true
+ JANSEL_ANS5 = true
pin_AN5_direction = input
end if
end if
- if defined(JALLIB_ANS6) == true then
+ if defined(JANSEL_ANS6) == true then
if an_pin_num == 6 then
- JALLIB_ANS6 = true
+ JANSEL_ANS6 = true
pin_AN6_direction = input
end if
end if
- if defined(JALLIB_ANS7) == true then
+ if defined(JANSEL_ANS7) == true then
if an_pin_num == 7 then
- JALLIB_ANS7 = true
+ JANSEL_ANS7 = true
pin_AN7_direction = input
end if
end if
- if defined(JALLIB_ANS8) == true then
+ if defined(JANSEL_ANS8) == true then
if an_pin_num == 8 then
- JALLIB_ANS8 = true
+ JANSEL_ANS8 = true
pin_AN8_direction = input
end if
end if
- if defined(JALLIB_ANS9) == true then
+ if defined(JANSEL_ANS9) == true then
if an_pin_num == 9 then
- JALLIB_ANS9 = true
+ JANSEL_ANS9 = true
pin_AN9_direction = input
end if
end if
- if defined(JALLIB_ANS10) == true then
+ if defined(JANSEL_ANS10) == true then
if an_pin_num == 10 then
- JALLIB_ANS10 = true
+ JANSEL_ANS10 = true
pin_AN10_direction = input
end if
end if
- if defined(JALLIB_ANS11) == true then
+ if defined(JANSEL_ANS11) == true then
if an_pin_num == 11 then
- JALLIB_ANS11 = true
+ JANSEL_ANS11 = true
pin_AN11_direction = input
end if
end if
- if defined(JALLIB_ANS12) == true then
+ if defined(JANSEL_ANS12) == true then
if an_pin_num == 12 then
- JALLIB_ANS12 = true
+ JANSEL_ANS12 = true
pin_AN12_direction = input
end if
end if
- if defined(JALLIB_ANS13) == true then
+ if defined(JANSEL_ANS13) == true then
if an_pin_num == 13 then
- JALLIB_ANS13 = true
+ JANSEL_ANS13 = true
pin_AN13_direction = input
end if
end if
- if defined(JALLIB_ANS14) == true then
+ if defined(JANSEL_ANS14) == true then
if an_pin_num == 14 then
- JALLIB_ANS14 = true
+ JANSEL_ANS14 = true
pin_AN14_direction = input
end if
end if
- if defined(JALLIB_ANS15) == true then
+ if defined(JANSEL_ANS15) == true then
if an_pin_num == 15 then
- JALLIB_ANS15 = true
+ JANSEL_ANS15 = true
pin_AN15_direction = input
end if
end if
- if defined(JALLIB_ANS16) == true then
+ if defined(JANSEL_ANS16) == true then
if an_pin_num == 16 then
- JALLIB_ANS16 = true
+ JANSEL_ANS16 = true
pin_AN16_direction = input
end if
end if
- if defined(JALLIB_ANS17) == true then
+ if defined(JANSEL_ANS17) == true then
if an_pin_num == 17 then
- JALLIB_ANS17 = true
+ JANSEL_ANS17 = true
pin_AN17_direction = input
end if
end if
- if defined(JALLIB_ANS18) == true then
+ if defined(JANSEL_ANS18) == true then
if an_pin_num == 18 then
- JALLIB_ANS18 = true
+ JANSEL_ANS18 = true
pin_AN18_direction = input
end if
end if
- if defined(JALLIB_ANS19) == true then
+ if defined(JANSEL_ANS19) == true then
if an_pin_num == 19 then
- JALLIB_ANS19 = true
+ JANSEL_ANS19 = true
pin_AN19_direction = input
end if
end if
- if defined(JALLIB_ANS20) == true then
+ if defined(JANSEL_ANS20) == true then
if an_pin_num == 20 then
- JALLIB_ANS20 = true
+ JANSEL_ANS20 = true
pin_AN20_direction = input
end if
end if
- if defined(JALLIB_ANS21) == true then
+ if defined(JANSEL_ANS21) == true then
if an_pin_num == 21 then
- JALLIB_ANS21 = true
+ JANSEL_ANS21 = true
pin_AN21_direction = input
end if
end if
- if defined(JALLIB_ANS22) == true then
+ if defined(JANSEL_ANS22) == true then
if an_pin_num == 22 then
- JALLIB_ANS22 = true
+ JANSEL_ANS22 = true
pin_AN22_direction = input
end if
end if
@@ -1954,119 +1824,119 @@
--
-- Note: the pin direction is not modified
procedure set_digital_pin(byte in an_pin_num) is
- if defined(JALLIB_ANS0) == true then
+ if defined(JANSEL_ANS0) == true then
if an_pin_num == 0 then
- JALLIB_ANS0 = false
+ JANSEL_ANS0 = false
end if
end if
- if defined(JALLIB_ANS1) == true then
+ if defined(JANSEL_ANS1) == true then
if an_pin_num == 1 then
- JALLIB_ANS1 = false
+ JANSEL_ANS1 = false
end if
end if
- if defined(JALLIB_ANS2) == true then
+ if defined(JANSEL_ANS2) == true then
if an_pin_num == 2 then
- JALLIB_ANS2 = false
+ JANSEL_ANS2 = false
end if
end if
- if defined(JALLIB_ANS3) == true then
+ if defined(JANSEL_ANS3) == true then
if an_pin_num == 3 then
- JALLIB_ANS3 = false
+ JANSEL_ANS3 = false
end if
end if
- if defined(JALLIB_ANS4) == true then
+ if defined(JANSEL_ANS4) == true then
if an_pin_num == 4 then
- JALLIB_ANS4 = false
+ JANSEL_ANS4 = false
end if
end if
- if defined(JALLIB_ANS5) == true then
+ if defined(JANSEL_ANS5) == true then
if an_pin_num == 5 then
- JALLIB_ANS5 = false
+ JANSEL_ANS5 = false
end if
end if
- if defined(JALLIB_ANS6) == true then
+ if defined(JANSEL_ANS6) == true then
if an_pin_num == 6 then
- JALLIB_ANS6 = false
+ JANSEL_ANS6 = false
end if
end if
- if defined(JALLIB_ANS7) == true then
+ if defined(JANSEL_ANS7) == true then
if an_pin_num == 7 then
- JALLIB_ANS7 = false
+ JANSEL_ANS7 = false
end if
end if
- if defined(JALLIB_ANS8) == true then
+ if defined(JANSEL_ANS8) == true then
if an_pin_num == 8 then
- JALLIB_ANS8 = false
+ JANSEL_ANS8 = false
end if
end if
- if defined(JALLIB_ANS9) == true then
+ if defined(JANSEL_ANS9) == true then
if an_pin_num == 9 then
- JALLIB_ANS9 = false
+ JANSEL_ANS9 = false
end if
end if
- if defined(JALLIB_ANS10) == true then
+ if defined(JANSEL_ANS10) == true then
if an_pin_num == 10 then
- JALLIB_ANS10 = false
+ JANSEL_ANS10 = false
end if
end if
- if defined(JALLIB_ANS11) == true then
+ if defined(JANSEL_ANS11) == true then
if an_pin_num == 11 then
- JALLIB_ANS11 = false
+ JANSEL_ANS11 = false
end if
end if
- if defined(JALLIB_ANS12) == true then
+ if defined(JANSEL_ANS12) == true then
if an_pin_num == 12 then
- JALLIB_ANS12 = false
+ JANSEL_ANS12 = false
end if
end if
- if defined(JALLIB_ANS13) == true then
+ if defined(JANSEL_ANS13) == true then
if an_pin_num == 13 then
- JALLIB_ANS13 = false
+ JANSEL_ANS13 = false
end if
end if
- if defined(JALLIB_ANS14) == true then
+ if defined(JANSEL_ANS14) == true then
if an_pin_num == 14 then
- JALLIB_ANS14 = false
+ JANSEL_ANS14 = false
end if
end if
- if defined(JALLIB_ANS15) == true then
+ if defined(JANSEL_ANS15) == true then
if an_pin_num == 15 then
- JALLIB_ANS15 = false
+ JANSEL_ANS15 = false
end if
end if
- if defined(JALLIB_ANS16) == true then
+ if defined(JANSEL_ANS16) == true then
if an_pin_num == 16 then
- JALLIB_ANS16 = false
+ JANSEL_ANS16 = false
end if
end if
- if defined(JALLIB_ANS17) == true then
+ if defined(JANSEL_ANS17) == true then
if an_pin_num == 17 then
- JALLIB_ANS17 = false
+ JANSEL_ANS17 = false
end if
end if
- if defined(JALLIB_ANS18) == true then
+ if defined(JANSEL_ANS18) == true then
if an_pin_num == 18 then
- JALLIB_ANS18 = false
+ JANSEL_ANS18 = false
end if
end if
- if defined(JALLIB_ANS19) == true then
+ if defined(JANSEL_ANS19) == true then
if an_pin_num == 19 then
- JALLIB_ANS19 = false
+ JANSEL_ANS19 = false
end if
end if
- if defined(JALLIB_ANS20) == true then
+ if defined(JANSEL_ANS20) == true then
if an_pin_num == 20 then
- JALLIB_ANS20 = false
+ JANSEL_ANS20 = false
end if
end if
- if defined(JALLIB_ANS21) == true then
+ if defined(JANSEL_ANS21) == true then
if an_pin_num == 21 then
- JALLIB_ANS21 = false
+ JANSEL_ANS21 = false
end if
end if
- if defined(JALLIB_ANS22) == true then
+ if defined(JANSEL_ANS22) == true then
if an_pin_num == 22 then
- JALLIB_ANS22 = false
+ JANSEL_ANS22 = false
end if
end if
end procedure
Modified: trunk/test/unittest/16f88_adc.jalt
==============================================================================
--- trunk/test/unittest/16f88_adc.jalt (original)
+++ trunk/test/unittest/16f88_adc.jalt Wed Jul 8 10:10:35 2009
@@ -187,40 +187,40 @@
asm nop
test_byte(TRISA) ;@assertEquals 3 test_porta_pin_an01_input
asm nop
-test_byte(TRISB) ;@assertEquals 0 test_portb_pin_an0_input
+test_byte(TRISB) ;@assertEquals 0 test_portb_pin_an01_input
set_analog_pin(2)
-- check pin on PORTA configured as inputs (6 is 0b0000_0111 => RA{0,1,2})
asm nop
test_byte(TRISA) ;@assertEquals 7 test_porta_pin_an012_input
asm nop
-test_byte(TRISB) ;@assertEquals 0 test_portb_pin_an0_input
+test_byte(TRISB) ;@assertEquals 0 test_portb_pin_an012_input
set_analog_pin(3)
-- check pin on PORTA configured as inputs (6 is 0b0000_0111 =>
RA{0,1,2,3})
asm nop
test_byte(TRISA) ;@assertEquals 15 test_porta_pin_an0123_input
asm nop
-test_byte(TRISB) ;@assertEquals 0 test_portb_pin_an0_input
+test_byte(TRISB) ;@assertEquals 0 test_portb_pin_an0123_input
set_analog_pin(4)
-- check pin on PORTA configured as inputs (6 is 0b0000_0111 => RA{0,1,2})
asm nop
test_byte(TRISA) ;@assertEquals 31 test_porta_pin_an01234_input
asm nop
-test_byte(TRISB) ;@assertEquals 0 test_portb_pin_an0_input
+test_byte(TRISB) ;@assertEquals 0 test_portb_pin_an01234_input
set_analog_pin(5)
-- check pin on PORTA configured as inputs (6 is 0b0000_0111 => RA{0,1,2})
asm nop
test_byte(TRISA) ;@assertEquals 31 test_porta_pin_an012345_input
asm nop
-test_byte(TRISB) ;@assertEquals 64 test_portb_pin_an0_input
+test_byte(TRISB) ;@assertEquals 64 test_portb_pin_an012345_input
set_analog_pin(6)
-- check pin on PORTA configured as inputs (6 is 0b0000_0111 => RA{0,1,2})
asm nop
test_byte(TRISA) ;@assertEquals 31 test_porta_pin_an0123456_input
asm nop
-test_byte(TRISB) ;@assertEquals 192 test_portb_pin_an0_input
+test_byte(TRISB) ;@assertEquals 192 test_portb_pin_an0123456_input
Modified: trunk/tools/adc/adc_channels.jal.tmpl
==============================================================================
--- trunk/tools/adc/adc_channels.jal.tmpl (original)
+++ trunk/tools/adc/adc_channels.jal.tmpl Wed Jul 8 10:10:35 2009
@@ -453,139 +453,9 @@
-- - bit ANSELH_ANSx (8 <= x <= 13, or 8 <= x <= 12)
--
-- There's a need for normalization...
- -- All ANS bits will looks like: JALLIB_ANSx
+ -- ANS bits are now normalized in device files :)
+ -- I (Seb) keep these grep & sed rules as tools to check future changes
- -- PICs: 10f220, 10f222, 12f510, 16f506, 16f526
- if defined(ADCON0_ANS) == true then
- var volatile bit JALLIB_ANS0 at ADCON0_ANS : 0
- var volatile bit JALLIB_ANS1 at ADCON0_ANS : 1
- end if
-
- -- PICs: 16f785, 16hv785
- if defined(ANSEL0_ANS0) == true then
- var volatile bit JALLIB_ANS0 is ANSEL0_ANS0
- var volatile bit JALLIB_ANS1 is ANSEL0_ANS1
- var volatile bit JALLIB_ANS2 is ANSEL0_ANS2
- var volatile bit JALLIB_ANS3 is ANSEL0_ANS3
- var volatile bit JALLIB_ANS4 is ANSEL0_ANS4
- var volatile bit JALLIB_ANS5 is ANSEL0_ANS5
- var volatile bit JALLIB_ANS6 is ANSEL0_ANS6
- var volatile bit JALLIB_ANS7 is ANSEL0_ANS7
- end if
- -- PICs: 16f785, 16hv785
- if defined(ANSEL1_ANS8) == true then
- var volatile bit JALLIB_ANS8 is ANSEL1_ANS8
- var volatile bit JALLIB_ANS9 is ANSEL1_ANS9
- var volatile bit JALLIB_ANS10 is ANSEL1_ANS10
- var volatile bit JALLIB_ANS11 is ANSEL1_ANS11
- end if
-
- -- PICs: 16f722, 16f723, 16f724, 16f726, 16f727, 16lf722, 16lf723,
16lf724, 16lf726, 16lf727
- if defined(ANSELA_ANSA) == true then
- var volatile bit JALLIB_ANS0 at ANSELA_ANSA : 0
- var volatile bit JALLIB_ANS1 at ANSELA_ANSA : 1
- var volatile bit JALLIB_ANS2 at ANSELA_ANSA : 2
- var volatile bit JALLIB_ANS3 at ANSELA_ANSA : 3
- var volatile bit JALLIB_ANS4 at ANSELA_ANSA : 4
- var volatile bit JALLIB_ANS5 at ANSELA_ANSA : 5
- end if
- -- PICs: 16f722, 16f723, 16f724, 16f726, 16f727, 16lf722, 16lf723,
16lf724, 16lf726, 16lf727
- if defined(ANSELB_ANSB) == true then
- var volatile bit JALLIB_ANS6 at ANSELB_ANSB : 0
- var volatile bit JALLIB_ANS7 at ANSELB_ANSB : 1
- var volatile bit JALLIB_ANS8 at ANSELB_ANSB : 2
- var volatile bit JALLIB_ANS9 at ANSELB_ANSB : 3
- var volatile bit JALLIB_ANS10 at ANSELB_ANSB : 4
- var volatile bit JALLIB_ANS11 at ANSELB_ANSB : 5
- end if
- -- PICs: 16f724, 16f727, 16lf724, 16lf727
- if defined(ANSELD_ANSD) == true then
- var volatile bit JALLIB_ANS12 at ANSELD_ANSD : 0
- var volatile bit JALLIB_ANS13 at ANSELD_ANSD : 1
- var volatile bit JALLIB_ANS14 at ANSELD_ANSD : 2
- var volatile bit JALLIB_ANS15 at ANSELD_ANSD : 3
- var volatile bit JALLIB_ANS16 at ANSELD_ANSD : 4
- var volatile bit JALLIB_ANS17 at ANSELD_ANSD : 5
- var volatile bit JALLIB_ANS18 at ANSELD_ANSD : 6
- var volatile bit JALLIB_ANS19 at ANSELD_ANSD : 7
- end if
- -- PICs: 16f724, 16f727, 16lf724, 16lf727
- if defined(ANSELE_ANSE) == true then
- var volatile bit JALLIB_ANS20 at ANSELE_ANSE : 0
- var volatile bit JALLIB_ANS21 at ANSELE_ANSE : 1
- var volatile bit JALLIB_ANS22 at ANSELE_ANSE : 2
- end if
-
- -- PICs: 16f677, 16f685, 16f687, 16f689, 16f690, 18f13k22, 18f13k50,
18f14k22,
- -- 18f14k50, 18lf13k22, 18lf13k50, 18lf14k22, 18lf14k50
- -- ANSELH_ANSELH can be associated (ie. "high part of") ANSEL_ANSx and
ANSEL_ANSELx
- if defined(ANSELH_ANSELH) == true then
- var volatile bit JALLIB_ANS8 at ANSELH_ANSELH : 0
- var volatile bit JALLIB_ANS9 at ANSELH_ANSELH : 1
- var volatile bit JALLIB_ANS10 at ANSELH_ANSELH : 2
- var volatile bit JALLIB_ANS11 at ANSELH_ANSELH : 3
- end if
-
- -- PICs: 12f609, 12f615, 12f675, 12f683, 12hv609, 12hv615
- if defined(ANSEL_ANS) == true then
- var volatile bit JALLIB_ANS0 at ANSEL_ANS : 0
- var volatile bit JALLIB_ANS1 at ANSEL_ANS : 1
- var volatile bit JALLIB_ANS2 at ANSEL_ANS : 2
- var volatile bit JALLIB_ANS3 at ANSEL_ANS : 3
- end if
-
- -- PICs: 16f610, 16f616, 16f676, 16f677, 16f684, 16f685, 16f687,
16f688, 16f689,
- -- 16f690, 16f88, 16f882, 16f883, 16f884, 16f886, 16f887,
16hv610, 16hv616,
- -- 18f23k20, 18f24k20, 18f25k20, 18f26k20, 18f43k20, 18f44k20,
18f45k20, 18f46k20
- if defined(ANSEL_ANS0) == true then
- -- ANS0 always comes with ANS1 and ANS4
- var volatile bit JALLIB_ANS0 is ANSEL_ANS0
- var volatile bit JALLIB_ANS1 is ANSEL_ANS1
- var volatile bit JALLIB_ANS4 is ANSEL_ANS4
- end if
- -- PICs: 16f616, 16f676, 16f677, 16f684, 16f685, 16f687, 16f688,
16f689, 16f690,
- -- 16f88, 16f882, 16f883, 16f884, 16f886, 16f887, 16hv616,
18f23k20, 18f24k20,
- -- 18f25k20, 18f26k20, 18f43k20, 18f44k20, 18f45k20, 18f46k20,
- if defined(ANSEL_ANS2) == true then
- var volatile bit JALLIB_ANS2 is ANSEL_ANS2
- end if
- -- PICs: 16f616, 16f676, 16f677, 16f684, 16f685, 16f687, 16f688,
16f689, 16f690,
- -- 16f88, 16f882, 16f883, 16f884, 16f886, 16f887, 16hv616,
18f23k20, 18f24k20,
- -- 18f25k20, 18f26k20, 18f43k20, 18f44k20, 18f45k20, 18f46k20,
- if defined(ANSEL_ANS3) == true then
- var volatile bit JALLIB_ANS3 is ANSEL_ANS3
- end if
- -- PICs: 16f610, 16f616, 16f676, 16f677, 16f684, 16f685, 16f687,
16f688, 16f689,
- -- 16f690, 16f88, 16f884, 16f887, 16hv610, 16hv616, 18f43k20,
18f44k20,
- -- 18f45k20, 18f46k20,
- if defined(ANSEL_ANS5) == true then
- -- ANS5 always comes with ANS6
- var volatile bit JALLIB_ANS5 is ANSEL_ANS5
- var volatile bit JALLIB_ANS6 is ANSEL_ANS6
- end if
- -- PICs: 16f610, 16f616, 16f676, 16f677, 16f684, 16f685, 16f687,
16f688, 16f689,
- -- 16f690, 16f884, 16f887, 16hv610, 16hv616, 18f43k20, 18f44k20,
18f45k20, 18f46k20,
- if defined(ANSEL_ANS7) == true then
- var volatile bit JALLIB_ANS7 is ANSEL_ANS7
- end if
- -- PICs: 18f13k22, 18f14k22, 18lf13k22, 18lf14k22
- if defined(ANSEL_ANSEL0) == true then
- -- ANSEL0 always comes with ANSEL1 and ANSEL2
- var volatile bit JALLIB_ANS0 is ANSEL_ANSEL0
- var volatile bit JALLIB_ANS1 is ANSEL_ANSEL1
- var volatile bit JALLIB_ANS2 is ANSEL_ANSEL2
- end if
- -- PICs: 18f13k22, 18f13k50, 18f14k22, 18f14k50, 18lf13k22, 18lf13k50,
18lf14k22, 18lf14k50
- if defined(ANSEL_ANSEL3) == true then
- -- ANSEL3 always comes with ANSEL4, ANSEL5, ANSEL6 and ANSEL7
- var volatile bit JALLIB_ANS3 is ANSEL_ANSEL3
- var volatile bit JALLIB_ANS4 is ANSEL_ANSEL4
- var volatile bit JALLIB_ANS5 is ANSEL_ANSEL5
- var volatile bit JALLIB_ANS6 is ANSEL_ANSEL6
- var volatile bit JALLIB_ANS7 is ANSEL_ANSEL7
- end if
-
- -- Now, it's normalized...
-- Provide helper func to configure pins either in digital or analog
mode
-- (/!\, true/false logic is inverted compared to PCFGx bits)
@@ -598,9 +468,9 @@
-- - set_analog_pin(4) will do the same for AN4
procedure set_analog_pin(byte in an_pin_num) is
#for i in range(23)
- if defined(JALLIB_ANS$i) == true then
+ if defined(JANSEL_ANS$i) == true then
if an_pin_num == $i then
- JALLIB_ANS$i = true
+ JANSEL_ANS$i = true
pin_AN${i}_direction = input
end if
end if
@@ -620,9 +490,9 @@
-- Note: the pin direction is not modified
procedure set_digital_pin(byte in an_pin_num) is
#for i in range(23)
- if defined(JALLIB_ANS$i) == true then
+ if defined(JANSEL_ANS$i) == true then
if an_pin_num == $i then
- JALLIB_ANS$i = false
+ JANSEL_ANS$i = false
end if
end if
#end for
Modified: trunk/tools/build/unittest.sh
==============================================================================
--- trunk/tools/build/unittest.sh (original)
+++ trunk/tools/build/unittest.sh Wed Jul 8 10:10:35 2009
@@ -1,7 +1,7 @@
#!/bin/bash
-###export JALLIB_ROOT=`pwd` # correct when set by buildbot
-export JALLIB_ROOT=`pwd`/../.. # run manually here
+export JALLIB_ROOT=`pwd` # correct when set by buildbot
+###export JALLIB_ROOT=`pwd`/../.. # run manually here
export JALLIB_REPOS=$JALLIB_ROOT/include
export JALLIB_UNITTESTDIR=$JALLIB_ROOT/test/unittest
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jallib" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/jallib?hl=en
-~----------~----~----~----~------~----~------~--~---