diff options
author | Jörg Hohensohn <hohensoh@rockbox.org> | 2004-12-18 10:29:47 +0000 |
---|---|---|
committer | Jörg Hohensohn <hohensoh@rockbox.org> | 2004-12-18 10:29:47 +0000 |
commit | fee861747999d358e9f5f58841697c09c9ea9b4f (patch) | |
tree | ffd51ea2ca9aa7fd0e330fec6fde384d925e9e13 /firmware | |
parent | 417753da7d9e128971bd0032d56b495845c1c805 (diff) | |
download | rockbox-fee861747999d358e9f5f58841697c09c9ea9b4f.tar.gz rockbox-fee861747999d358e9f5f58841697c09c9ea9b4f.zip |
multiple choice configuration CONFIG_BACKLIGHT instead of HAVE_BACKLIGHT, allows better control of how to do this per model
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5491 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/backlight.c | 38 | ||||
-rw-r--r-- | firmware/export/config-fmrecorder.h | 2 | ||||
-rw-r--r-- | firmware/export/config-h100.h | 2 | ||||
-rw-r--r-- | firmware/export/config-player.h | 2 | ||||
-rw-r--r-- | firmware/export/config-recorder.h | 2 | ||||
-rw-r--r-- | firmware/export/config-recorderv2.h | 2 | ||||
-rw-r--r-- | firmware/export/config.h | 6 |
7 files changed, 29 insertions, 25 deletions
diff --git a/firmware/backlight.c b/firmware/backlight.c index fea22a06a4..de3ebe3e05 100644 --- a/firmware/backlight.c +++ b/firmware/backlight.c | |||
@@ -28,7 +28,7 @@ | |||
28 | #include "power.h" | 28 | #include "power.h" |
29 | #include "system.h" | 29 | #include "system.h" |
30 | 30 | ||
31 | #ifdef HAVE_BACKLIGHT | 31 | #ifdef CONFIG_BACKLIGHT |
32 | 32 | ||
33 | const char backlight_timeout_value[19] = | 33 | const char backlight_timeout_value[19] = |
34 | { | 34 | { |
@@ -51,30 +51,30 @@ static unsigned int backlight_timeout = 5; | |||
51 | 51 | ||
52 | static void __backlight_off(void) | 52 | static void __backlight_off(void) |
53 | { | 53 | { |
54 | #ifdef IRIVER_H100 | 54 | #if CONFIG_BACKLIGHT == BL_IRIVER |
55 | GPIO1_OUT |= 0x00020000; | 55 | GPIO1_OUT |= 0x00020000; |
56 | #else | 56 | #elif CONFIG_BACKLIGHT == BL_RTC |
57 | #ifdef HAVE_RTC | ||
58 | /* Disable square wave */ | 57 | /* Disable square wave */ |
59 | rtc_write(0x0a, rtc_read(0x0a) & ~0x40); | 58 | rtc_write(0x0a, rtc_read(0x0a) & ~0x40); |
60 | #else | 59 | #elif CONFIG_BACKLIGHT == BL_PA14_LO /* Player */ |
61 | and_b(~0x40, &PAIORH); | 60 | and_b(~0x40, &PAIORH); /* let it float (up) */ |
62 | #endif | 61 | #elif CONFIG_BACKLIGHT == BL_PA14_HI /* Ondio */ |
62 | and_b(~0x40, &PADRH); /* drive it low */ | ||
63 | #endif | 63 | #endif |
64 | } | 64 | } |
65 | 65 | ||
66 | static void __backlight_on(void) | 66 | static void __backlight_on(void) |
67 | { | 67 | { |
68 | #ifdef IRIVER_H100 | 68 | #if CONFIG_BACKLIGHT == BL_IRIVER |
69 | GPIO1_OUT &= ~0x00020000; | 69 | GPIO1_OUT &= ~0x00020000; |
70 | #else | 70 | #elif CONFIG_BACKLIGHT == BL_RTC |
71 | #ifdef HAVE_RTC | ||
72 | /* Enable square wave */ | 71 | /* Enable square wave */ |
73 | rtc_write(0x0a, rtc_read(0x0a) | 0x40); | 72 | rtc_write(0x0a, rtc_read(0x0a) | 0x40); |
74 | #else | 73 | #elif CONFIG_BACKLIGHT == BL_PA14_LO /* Player */ |
75 | and_b(~0x40, &PADRH); | 74 | and_b(~0x40, &PADRH); /* drive an set low */ |
76 | or_b(0x40, &PAIORH); | 75 | or_b(0x40, &PAIORH); |
77 | #endif | 76 | #elif CONFIG_BACKLIGHT == BL_PA14_HI /* Ondio */ |
77 | or_b(0x40, &PADRH); /* drive it high */ | ||
78 | #endif | 78 | #endif |
79 | } | 79 | } |
80 | 80 | ||
@@ -187,15 +187,13 @@ void backlight_init(void) | |||
187 | create_thread(backlight_thread, backlight_stack, | 187 | create_thread(backlight_thread, backlight_stack, |
188 | sizeof(backlight_stack), backlight_thread_name); | 188 | sizeof(backlight_stack), backlight_thread_name); |
189 | 189 | ||
190 | #ifdef HAVE_LCD_CHARCELLS | 190 | #if CONFIG_BACKLIGHT == BL_IRIVER |
191 | GPIO1_ENABLE |= 0x00020000; | ||
192 | GPIO1_FUNCTION |= 0x00020000; | ||
193 | #elif CONFIG_BACKLIGHT == BL_PA14_LO || CONFIG_BACKLIGHT == BL_PA14_HI | ||
191 | PACR1 &= ~0x3000; /* Set PA14 (backlight control) to GPIO */ | 194 | PACR1 &= ~0x3000; /* Set PA14 (backlight control) to GPIO */ |
192 | or_b(0x40, &PAIORH); /* ..and output */ | 195 | or_b(0x40, &PAIORH); /* ..and output */ |
193 | #endif | 196 | #endif |
194 | |||
195 | #ifdef IRIVER_H100 | ||
196 | GPIO1_ENABLE |= 0x00020000; | ||
197 | GPIO1_FUNCTION |= 0x00020000; | ||
198 | #endif | ||
199 | backlight_on(); | 197 | backlight_on(); |
200 | } | 198 | } |
201 | 199 | ||
@@ -210,5 +208,5 @@ void backlight_set_timeout(int index) {(void)index;} | |||
210 | bool backlight_get_on_when_charging(void) {return 0;} | 208 | bool backlight_get_on_when_charging(void) {return 0;} |
211 | void backlight_set_on_when_charging(bool yesno) {(void)yesno;} | 209 | void backlight_set_on_when_charging(bool yesno) {(void)yesno;} |
212 | 210 | ||
213 | #endif /* #ifdef HAVE_BACKLIGHT */ | 211 | #endif /* #ifdef CONFIG_BACKLIGHT */ |
214 | 212 | ||
diff --git a/firmware/export/config-fmrecorder.h b/firmware/export/config-fmrecorder.h index 0903e66c6d..c20c36ea43 100644 --- a/firmware/export/config-fmrecorder.h +++ b/firmware/export/config-fmrecorder.h | |||
@@ -71,7 +71,7 @@ | |||
71 | #define HAVE_LED | 71 | #define HAVE_LED |
72 | 72 | ||
73 | /* Define this for LCD backlight available */ | 73 | /* Define this for LCD backlight available */ |
74 | #define HAVE_BACKLIGHT | 74 | #define CONFIG_BACKLIGHT BL_RTC /* on I2C controlled RTC port */ |
75 | 75 | ||
76 | /* Define this if you have a software controlled poweroff */ | 76 | /* Define this if you have a software controlled poweroff */ |
77 | #define HAVE_SW_POWEROFF | 77 | #define HAVE_SW_POWEROFF |
diff --git a/firmware/export/config-h100.h b/firmware/export/config-h100.h index 9e56aa2c59..405e839dd5 100644 --- a/firmware/export/config-h100.h +++ b/firmware/export/config-h100.h | |||
@@ -25,7 +25,7 @@ | |||
25 | #define ROM_START 0x11010 | 25 | #define ROM_START 0x11010 |
26 | 26 | ||
27 | /* Define this for LCD backlight available */ | 27 | /* Define this for LCD backlight available */ |
28 | #define HAVE_BACKLIGHT | 28 | #define CONFIG_BACKLIGHT BL_IRIVER /* port controlled */ |
29 | 29 | ||
30 | /* Define this to the CPU frequency */ | 30 | /* Define this to the CPU frequency */ |
31 | #define CPU_FREQ 11289600 | 31 | #define CPU_FREQ 11289600 |
diff --git a/firmware/export/config-player.h b/firmware/export/config-player.h index 5a8f080669..6ef61234ad 100644 --- a/firmware/export/config-player.h +++ b/firmware/export/config-player.h | |||
@@ -64,6 +64,6 @@ | |||
64 | #define HAVE_LED | 64 | #define HAVE_LED |
65 | 65 | ||
66 | /* Define this for LCD backlight available */ | 66 | /* Define this for LCD backlight available */ |
67 | #define HAVE_BACKLIGHT | 67 | #define CONFIG_BACKLIGHT BL_PA14_LO /* port PA14, low active */ |
68 | 68 | ||
69 | #endif /* SIMULATOR */ | 69 | #endif /* SIMULATOR */ |
diff --git a/firmware/export/config-recorder.h b/firmware/export/config-recorder.h index eefe5e371b..79fd116d4f 100644 --- a/firmware/export/config-recorder.h +++ b/firmware/export/config-recorder.h | |||
@@ -65,7 +65,7 @@ | |||
65 | #define HAVE_LED | 65 | #define HAVE_LED |
66 | 66 | ||
67 | /* Define this for LCD backlight available */ | 67 | /* Define this for LCD backlight available */ |
68 | #define HAVE_BACKLIGHT | 68 | #define CONFIG_BACKLIGHT BL_RTC /* on I2C controlled RTC port */ |
69 | 69 | ||
70 | /* Define this for S/PDIF output available */ | 70 | /* Define this for S/PDIF output available */ |
71 | #define HAVE_SPDIF_OUT | 71 | #define HAVE_SPDIF_OUT |
diff --git a/firmware/export/config-recorderv2.h b/firmware/export/config-recorderv2.h index 575a88fd7c..028a27095c 100644 --- a/firmware/export/config-recorderv2.h +++ b/firmware/export/config-recorderv2.h | |||
@@ -71,7 +71,7 @@ | |||
71 | #define HAVE_LED | 71 | #define HAVE_LED |
72 | 72 | ||
73 | /* Define this for LCD backlight available */ | 73 | /* Define this for LCD backlight available */ |
74 | #define HAVE_BACKLIGHT | 74 | #define CONFIG_BACKLIGHT BL_RTC /* on I2C controlled RTC port */ |
75 | 75 | ||
76 | /* Define this if you have a software controlled poweroff */ | 76 | /* Define this if you have a software controlled poweroff */ |
77 | #define HAVE_SW_POWEROFF | 77 | #define HAVE_SW_POWEROFF |
diff --git a/firmware/export/config.h b/firmware/export/config.h index cda5c8cee7..7c0e285bbe 100644 --- a/firmware/export/config.h +++ b/firmware/export/config.h | |||
@@ -46,6 +46,12 @@ | |||
46 | #define BATT_4AA_NIMH 1500 | 46 | #define BATT_4AA_NIMH 1500 |
47 | #define BATT_3AAA_ALKALINE 1000 | 47 | #define BATT_3AAA_ALKALINE 1000 |
48 | 48 | ||
49 | /* CONFIG_BACKLIGHT */ | ||
50 | #define BL_PA14_LO 0 /* Player, PA14 low active */ | ||
51 | #define BL_RTC 1 /* Recorder, RTC square wave output */ | ||
52 | #define BL_PA14_HI 2 /* Ondio, PA14 high active */ | ||
53 | #define BL_IRIVER 3 /* IRiver GPIO */ | ||
54 | |||
49 | /* now go and pick yours */ | 55 | /* now go and pick yours */ |
50 | #if defined(ARCHOS_PLAYER) | 56 | #if defined(ARCHOS_PLAYER) |
51 | #include "config-player.h" | 57 | #include "config-player.h" |