diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2008-05-21 08:42:11 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2008-05-21 08:42:11 +0000 |
commit | a9c20f5789c13b486d217024a020f9d6163e2d51 (patch) | |
tree | 5da52ca9cc7a28ba21ced042cb739e6160d5f87b /firmware/target/arm/imx31/gigabeat-s/adc-imx31.c | |
parent | 5f796087b009fee1ae60904b0355cc7febe3330f (diff) | |
download | rockbox-a9c20f5789c13b486d217024a020f9d6163e2d51.tar.gz rockbox-a9c20f5789c13b486d217024a020f9d6163e2d51.zip |
Gigabeat S:
1) Rework event handling and static registration mechanism. No target-
specific code in mc13783 driver. GPIO event driver interfaces more
cleanly.
2) Somewhat related - enable thread priority for bootloader which is
desireable here (ffs is used for GPIO event enabling anyway and that
goes along with priority).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17593 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/imx31/gigabeat-s/adc-imx31.c')
-rw-r--r-- | firmware/target/arm/imx31/gigabeat-s/adc-imx31.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/firmware/target/arm/imx31/gigabeat-s/adc-imx31.c b/firmware/target/arm/imx31/gigabeat-s/adc-imx31.c index d26d708da1..2f4e45c3b1 100644 --- a/firmware/target/arm/imx31/gigabeat-s/adc-imx31.c +++ b/firmware/target/arm/imx31/gigabeat-s/adc-imx31.c | |||
@@ -77,11 +77,11 @@ unsigned short adc_read(int channel) | |||
77 | 77 | ||
78 | mutex_unlock(&adc_mtx); | 78 | mutex_unlock(&adc_mtx); |
79 | 79 | ||
80 | /* Channels 0-3/8-11 in ADD1, 0-4/12-15 in ADD2 */ | 80 | /* Channels 0-3/8-11 in ADD1, 4-7/12-15 in ADD2 */ |
81 | return (channel & 4) ? MC13783_ADD2r(data) : MC13783_ADD1r(data); | 81 | return (channel & 4) ? MC13783_ADD2r(data) : MC13783_ADD1r(data); |
82 | } | 82 | } |
83 | 83 | ||
84 | /* Called when conversion is complete */ | 84 | /* Called by mc13783 interrupt thread when conversion is complete */ |
85 | void adc_done(void) | 85 | void adc_done(void) |
86 | { | 86 | { |
87 | wakeup_signal(&adc_wake); | 87 | wakeup_signal(&adc_wake); |
@@ -100,7 +100,8 @@ void adc_init(void) | |||
100 | MC13783_RTHEN | MC13783_CHRGICON); | 100 | MC13783_RTHEN | MC13783_CHRGICON); |
101 | /* Enable ADC, set multi-channel mode */ | 101 | /* Enable ADC, set multi-channel mode */ |
102 | mc13783_write(MC13783_ADC1, MC13783_ADEN); | 102 | mc13783_write(MC13783_ADC1, MC13783_ADEN); |
103 | /* Enable the ADCDONE interrupt - notifications are dispatched by | 103 | |
104 | * event handler. */ | 104 | /* Enable ADCDONE event */ |
105 | mc13783_clear(MC13783_INTERRUPT_MASK0, MC13783_ADCDONEM); | 105 | mc13783_write(MC13783_INTERRUPT_STATUS0, MC13783_ADCDONEI); |
106 | mc13783_enable_event(MC13783_ADCDONE_EVENT); | ||
106 | } | 107 | } |