diff options
author | Karl Kurbjun <kkurbjun@gmail.com> | 2009-06-24 04:17:15 +0000 |
---|---|---|
committer | Karl Kurbjun <kkurbjun@gmail.com> | 2009-06-24 04:17:15 +0000 |
commit | 19cb4446919dff3b0c6e5a48c9b0192c01740ecc (patch) | |
tree | f9ebc1fc443e962a428ec0f3e3ff82c427864675 /firmware/target/arm/tms320dm320/mrobe-500 | |
parent | 1910d026b1593efd37da276397d0fa157d96d877 (diff) | |
download | rockbox-19cb4446919dff3b0c6e5a48c9b0192c01740ecc.tar.gz rockbox-19cb4446919dff3b0c6e5a48c9b0192c01740ecc.zip |
M:Robe 500: RTC is now working, Added some SPI flexibility per end device and modified the interrupt handler for the tsc2100 which should make it more reliable.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21483 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/tms320dm320/mrobe-500')
-rw-r--r-- | firmware/target/arm/tms320dm320/mrobe-500/adc-mr500.c | 7 | ||||
-rw-r--r-- | firmware/target/arm/tms320dm320/mrobe-500/backlight-mr500.c | 11 |
2 files changed, 13 insertions, 5 deletions
diff --git a/firmware/target/arm/tms320dm320/mrobe-500/adc-mr500.c b/firmware/target/arm/tms320dm320/mrobe-500/adc-mr500.c index e7e57a4f11..7d073f4fda 100644 --- a/firmware/target/arm/tms320dm320/mrobe-500/adc-mr500.c +++ b/firmware/target/arm/tms320dm320/mrobe-500/adc-mr500.c | |||
@@ -38,6 +38,9 @@ void adc_init(void) | |||
38 | /* Touchscreen data available interupt */ | 38 | /* Touchscreen data available interupt */ |
39 | void GIO14(void) | 39 | void GIO14(void) |
40 | { | 40 | { |
41 | /* Interrupts work properly when cleared first */ | ||
42 | IO_INTC_IRQ2 = (1<<3); /* IRQ_GIO14 == 35 */ | ||
43 | |||
41 | short tsadc = tsc2100_readreg(TSADC_PAGE, TSADC_ADDRESS); | 44 | short tsadc = tsc2100_readreg(TSADC_PAGE, TSADC_ADDRESS); |
42 | short adscm = (tsadc&TSADC_ADSCM_MASK)>>TSADC_ADSCM_SHIFT; | 45 | short adscm = (tsadc&TSADC_ADSCM_MASK)>>TSADC_ADSCM_SHIFT; |
43 | 46 | ||
@@ -62,8 +65,6 @@ void GIO14(void) | |||
62 | case 0x0B: | 65 | case 0x0B: |
63 | tsc2100_set_mode(true, 0x01); | 66 | tsc2100_set_mode(true, 0x01); |
64 | break; | 67 | break; |
65 | } | 68 | } |
66 | |||
67 | IO_INTC_IRQ2 = (1<<3); /* IRQ_GIO14 == 35 */ | ||
68 | } | 69 | } |
69 | 70 | ||
diff --git a/firmware/target/arm/tms320dm320/mrobe-500/backlight-mr500.c b/firmware/target/arm/tms320dm320/mrobe-500/backlight-mr500.c index 413790ae00..04778c8e50 100644 --- a/firmware/target/arm/tms320dm320/mrobe-500/backlight-mr500.c +++ b/firmware/target/arm/tms320dm320/mrobe-500/backlight-mr500.c | |||
@@ -29,10 +29,17 @@ | |||
29 | #include "spi-target.h" | 29 | #include "spi-target.h" |
30 | #include "lcd-target.h" | 30 | #include "lcd-target.h" |
31 | 31 | ||
32 | short read_brightness = 0x0; | ||
33 | |||
32 | static void _backlight_write_brightness(int brightness) | 34 | static void _backlight_write_brightness(int brightness) |
33 | { | 35 | { |
34 | uint8_t bl_command[] = {0xa4, 0x00, brightness, 0xbb}; | 36 | uint8_t bl_command[] = {0xA4, 0x00, brightness, 0xA4}; |
35 | spi_block_transfer(SPI_target_BACKLIGHT, false, bl_command, 4, 0, 0); | 37 | |
38 | uint8_t bl_read[] = {0xA8, 0x00}; | ||
39 | |||
40 | spi_block_transfer(SPI_target_BACKLIGHT, bl_read, 2, (char*)&read_brightness, 2); | ||
41 | |||
42 | spi_block_transfer(SPI_target_BACKLIGHT, bl_command, 4, 0, 0); | ||
36 | } | 43 | } |
37 | 44 | ||
38 | void _backlight_on(void) | 45 | void _backlight_on(void) |