diff options
author | Jens Arnold <amiconn@rockbox.org> | 2005-06-04 23:15:52 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2005-06-04 23:15:52 +0000 |
commit | 5690f78fb23ec66aeadf5ecf8200b5610b3e59d2 (patch) | |
tree | 62bab156602ab905851fbb000c22d48bf2f8f85e | |
parent | c9cc73ec1988dae9e3d1a09347ceac2a4ecc1f67 (diff) | |
download | rockbox-5690f78fb23ec66aeadf5ecf8200b5610b3e59d2.tar.gz rockbox-5690f78fb23ec66aeadf5ecf8200b5610b3e59d2.zip |
Multiple choice LED configuration instead of HAVE_LED. Removes erroneous MMC icon display on iriver, and saves some code on Ondio. Removed invert_led() as it is no longer used.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6568 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/main.c | 4 | ||||
-rw-r--r-- | apps/recorder/icons.c | 4 | ||||
-rw-r--r-- | apps/recorder/icons.h | 4 | ||||
-rw-r--r-- | apps/recorder/recording.c | 16 | ||||
-rw-r--r-- | apps/status.c | 6 | ||||
-rw-r--r-- | firmware/SOURCES | 2 | ||||
-rw-r--r-- | firmware/drivers/ata.c | 8 | ||||
-rw-r--r-- | firmware/drivers/led.c | 32 | ||||
-rw-r--r-- | firmware/export/ata.h | 2 | ||||
-rw-r--r-- | firmware/export/config-fmrecorder.h | 4 | ||||
-rw-r--r-- | firmware/export/config-gmini120.h | 3 | ||||
-rw-r--r-- | firmware/export/config-gminisp.h | 3 | ||||
-rw-r--r-- | firmware/export/config-ondiofm.h | 3 | ||||
-rw-r--r-- | firmware/export/config-ondiosp.h | 3 | ||||
-rw-r--r-- | firmware/export/config-player.h | 4 | ||||
-rw-r--r-- | firmware/export/config-recorder.h | 4 | ||||
-rw-r--r-- | firmware/export/config-recorderv2.h | 4 | ||||
-rw-r--r-- | firmware/export/config.h | 5 | ||||
-rw-r--r-- | firmware/export/led.h | 3 | ||||
-rw-r--r-- | firmware/panic.c | 4 |
20 files changed, 62 insertions, 56 deletions
diff --git a/apps/main.c b/apps/main.c index 537c3da4dc..5a47e720e0 100644 --- a/apps/main.c +++ b/apps/main.c | |||
@@ -277,7 +277,7 @@ void init(void) | |||
277 | 277 | ||
278 | #ifdef AUTOROCK | 278 | #ifdef AUTOROCK |
279 | if (!usb_detect()) | 279 | if (!usb_detect()) |
280 | { | 280 | { |
281 | int fd; | 281 | int fd; |
282 | static const char filename[] = PLUGIN_DIR "/autostart.rock"; | 282 | static const char filename[] = PLUGIN_DIR "/autostart.rock"; |
283 | 283 | ||
@@ -303,8 +303,10 @@ int main(void) | |||
303 | app_main(); | 303 | app_main(); |
304 | 304 | ||
305 | while(1) { | 305 | while(1) { |
306 | #if CONFIG_LED == LED_REAL | ||
306 | led(true); sleep(HZ/10); | 307 | led(true); sleep(HZ/10); |
307 | led(false); sleep(HZ/10); | 308 | led(false); sleep(HZ/10); |
309 | #endif | ||
308 | } | 310 | } |
309 | return 0; | 311 | return 0; |
310 | } | 312 | } |
diff --git a/apps/recorder/icons.c b/apps/recorder/icons.c index 26e494e29d..ee8c69a05c 100644 --- a/apps/recorder/icons.c +++ b/apps/recorder/icons.c | |||
@@ -74,7 +74,7 @@ const unsigned char bitmap_icons_7x8[][7] = | |||
74 | {0x20,0x30,0x38,0x3c,0x38,0x30,0x20}, /* Up-arrow */ | 74 | {0x20,0x30,0x38,0x3c,0x38,0x30,0x20}, /* Up-arrow */ |
75 | }; | 75 | }; |
76 | 76 | ||
77 | #ifndef HAVE_LED | 77 | #if CONFIG_LED == LED_VIRTUAL |
78 | /* Disk/MMC activity */ | 78 | /* Disk/MMC activity */ |
79 | const unsigned char bitmap_icon_disk[12] = | 79 | const unsigned char bitmap_icon_disk[12] = |
80 | {0x15,0x3f,0x7d,0x7B,0x77,0x67,0x79,0x7b,0x57,0x4f,0x47,0x7f}; | 80 | {0x15,0x3f,0x7d,0x7B,0x77,0x67,0x79,0x7b,0x57,0x4f,0x47,0x7f}; |
@@ -405,7 +405,7 @@ void statusbar_icon_lock(void) | |||
405 | STATUSBAR_Y_POS, 5, 8, false); | 405 | STATUSBAR_Y_POS, 5, 8, false); |
406 | } | 406 | } |
407 | 407 | ||
408 | #ifndef HAVE_LED | 408 | #if CONFIG_LED == LED_VIRTUAL |
409 | /* | 409 | /* |
410 | * no real LED: disk activity in status bar | 410 | * no real LED: disk activity in status bar |
411 | */ | 411 | */ |
diff --git a/apps/recorder/icons.h b/apps/recorder/icons.h index d9d743a26c..48e9a167ee 100644 --- a/apps/recorder/icons.h +++ b/apps/recorder/icons.h | |||
@@ -63,7 +63,7 @@ enum icons_7x8 { | |||
63 | extern const unsigned char bitmap_icons_5x8[1][5]; | 63 | extern const unsigned char bitmap_icons_5x8[1][5]; |
64 | extern const unsigned char bitmap_icons_6x8[LastIcon][6]; | 64 | extern const unsigned char bitmap_icons_6x8[LastIcon][6]; |
65 | extern const unsigned char bitmap_icons_7x8[Icon_Last][7]; | 65 | extern const unsigned char bitmap_icons_7x8[Icon_Last][7]; |
66 | #ifndef HAVE_LED | 66 | #if CONFIG_LED == LED_VIRTUAL |
67 | extern const unsigned char bitmap_icon_disk[]; | 67 | extern const unsigned char bitmap_icon_disk[]; |
68 | #endif | 68 | #endif |
69 | 69 | ||
@@ -106,7 +106,7 @@ extern void statusbar_icon_lock(void); | |||
106 | #ifdef HAVE_RTC | 106 | #ifdef HAVE_RTC |
107 | extern void statusbar_time(int hour, int minute); | 107 | extern void statusbar_time(int hour, int minute); |
108 | #endif | 108 | #endif |
109 | #ifndef HAVE_LED | 109 | #if CONFIG_LED == LED_VIRTUAL |
110 | extern void statusbar_led(void); | 110 | extern void statusbar_led(void); |
111 | #endif | 111 | #endif |
112 | 112 | ||
diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c index 111995cbfe..84c90d2d86 100644 --- a/apps/recorder/recording.c +++ b/apps/recorder/recording.c | |||
@@ -307,7 +307,7 @@ bool recording_screen(void) | |||
307 | char path_buffer[MAX_PATH]; | 307 | char path_buffer[MAX_PATH]; |
308 | bool been_in_usb_mode = false; | 308 | bool been_in_usb_mode = false; |
309 | int last_audio_stat = -1; | 309 | int last_audio_stat = -1; |
310 | #ifdef HAVE_LED | 310 | #if CONFIG_LED == LED_REAL |
311 | bool led_state = false; | 311 | bool led_state = false; |
312 | int led_countdown = 2; | 312 | int led_countdown = 2; |
313 | #endif | 313 | #endif |
@@ -320,7 +320,7 @@ bool recording_screen(void) | |||
320 | }; | 320 | }; |
321 | 321 | ||
322 | cursor = 0; | 322 | cursor = 0; |
323 | #if defined(HAVE_LED) && !defined(SIMULATOR) | 323 | #if (CONFIG_LED == LED_REAL) && !defined(SIMULATOR) |
324 | ata_set_led_enabled(false); | 324 | ata_set_led_enabled(false); |
325 | #endif | 325 | #endif |
326 | mpeg_init_recording(); | 326 | mpeg_init_recording(); |
@@ -356,7 +356,7 @@ bool recording_screen(void) | |||
356 | while(!done) | 356 | while(!done) |
357 | { | 357 | { |
358 | int audio_stat = audio_status(); | 358 | int audio_stat = audio_status(); |
359 | #ifdef HAVE_LED | 359 | #if CONFIG_LED == LED_REAL |
360 | 360 | ||
361 | /* | 361 | /* |
362 | * Flash the LED while waiting to record. Turn it on while | 362 | * Flash the LED while waiting to record. Turn it on while |
@@ -401,7 +401,7 @@ bool recording_screen(void) | |||
401 | led(false); | 401 | led(false); |
402 | } | 402 | } |
403 | } | 403 | } |
404 | #endif /* HAVE_LED */ | 404 | #endif /* CONFIG_LED */ |
405 | 405 | ||
406 | /* Wait for a button a while (HZ/10) drawing the peak meter */ | 406 | /* Wait for a button a while (HZ/10) drawing the peak meter */ |
407 | button = peak_meter_draw_get_btn(0, 8 + h*2, LCD_WIDTH, h); | 407 | button = peak_meter_draw_get_btn(0, 8 + h*2, LCD_WIDTH, h); |
@@ -574,7 +574,7 @@ bool recording_screen(void) | |||
574 | case REC_SETTINGS: | 574 | case REC_SETTINGS: |
575 | if(audio_stat != AUDIO_STATUS_RECORD) | 575 | if(audio_stat != AUDIO_STATUS_RECORD) |
576 | { | 576 | { |
577 | #ifdef HAVE_LED | 577 | #if CONFIG_LED == LED_REAL |
578 | /* led is restored at begin of loop / end of function */ | 578 | /* led is restored at begin of loop / end of function */ |
579 | led(false); | 579 | led(false); |
580 | #endif | 580 | #endif |
@@ -607,7 +607,7 @@ bool recording_screen(void) | |||
607 | case REC_F2: | 607 | case REC_F2: |
608 | if(audio_stat != AUDIO_STATUS_RECORD) | 608 | if(audio_stat != AUDIO_STATUS_RECORD) |
609 | { | 609 | { |
610 | #ifdef HAVE_LED | 610 | #if CONFIG_LED == LED_REAL |
611 | /* led is restored at begin of loop / end of function */ | 611 | /* led is restored at begin of loop / end of function */ |
612 | led(false); | 612 | led(false); |
613 | #endif | 613 | #endif |
@@ -633,7 +633,7 @@ bool recording_screen(void) | |||
633 | { | 633 | { |
634 | if(audio_stat != AUDIO_STATUS_RECORD) | 634 | if(audio_stat != AUDIO_STATUS_RECORD) |
635 | { | 635 | { |
636 | #ifdef HAVE_LED | 636 | #if CONFIG_LED == LED_REAL |
637 | /* led is restored at begin of loop / end of function */ | 637 | /* led is restored at begin of loop / end of function */ |
638 | led(false); | 638 | led(false); |
639 | #endif | 639 | #endif |
@@ -839,7 +839,7 @@ bool recording_screen(void) | |||
839 | if (have_recorded) | 839 | if (have_recorded) |
840 | reload_directory(); | 840 | reload_directory(); |
841 | 841 | ||
842 | #if defined(HAVE_LED) && !defined(SIMULATOR) | 842 | #if (CONFIG_LED == LED_REAL) && !defined(SIMULATOR) |
843 | ata_set_led_enabled(true); | 843 | ata_set_led_enabled(true); |
844 | #endif | 844 | #endif |
845 | return been_in_usb_mode; | 845 | return been_in_usb_mode; |
diff --git a/apps/status.c b/apps/status.c index d7d3a21f5b..8d3d1748cb 100644 --- a/apps/status.c +++ b/apps/status.c | |||
@@ -60,7 +60,7 @@ struct status_info { | |||
60 | bool keylock; | 60 | bool keylock; |
61 | bool battery_safe; | 61 | bool battery_safe; |
62 | bool redraw_volume; /* true if the volume gauge needs updating */ | 62 | bool redraw_volume; /* true if the volume gauge needs updating */ |
63 | #ifndef HAVE_LED | 63 | #if CONFIG_LED == LED_VIRTUAL |
64 | bool led; /* disk LED simulation in the status bar */ | 64 | bool led; /* disk LED simulation in the status bar */ |
65 | #endif | 65 | #endif |
66 | }; | 66 | }; |
@@ -167,7 +167,7 @@ void status_draw(bool force_redraw) | |||
167 | #endif | 167 | #endif |
168 | info.repeat = global_settings.repeat_mode; | 168 | info.repeat = global_settings.repeat_mode; |
169 | info.playmode = current_playmode(); | 169 | info.playmode = current_playmode(); |
170 | #ifndef HAVE_LED | 170 | #if CONFIG_LED == LED_VIRTUAL |
171 | info.led = led_read(HZ/2); /* delay should match polling interval */ | 171 | info.led = led_read(HZ/2); /* delay should match polling interval */ |
172 | #endif | 172 | #endif |
173 | 173 | ||
@@ -248,7 +248,7 @@ void status_draw(bool force_redraw) | |||
248 | #ifdef HAVE_RTC | 248 | #ifdef HAVE_RTC |
249 | statusbar_time(info.hour, info.minute); | 249 | statusbar_time(info.hour, info.minute); |
250 | #endif | 250 | #endif |
251 | #ifndef HAVE_LED | 251 | #if CONFIG_LED == LED_VIRTUAL |
252 | if (info.led) | 252 | if (info.led) |
253 | statusbar_led(); | 253 | statusbar_led(); |
254 | #endif | 254 | #endif |
diff --git a/firmware/SOURCES b/firmware/SOURCES index 542081b7ca..4bf22ff6e7 100644 --- a/firmware/SOURCES +++ b/firmware/SOURCES | |||
@@ -52,7 +52,9 @@ drivers/lcd-recorder.c | |||
52 | #endif | 52 | #endif |
53 | #endif | 53 | #endif |
54 | drivers/power.c | 54 | drivers/power.c |
55 | #ifdef CONFIG_LED | ||
55 | drivers/led.c | 56 | drivers/led.c |
57 | #endif | ||
56 | #ifndef SIMULATOR | 58 | #ifndef SIMULATOR |
57 | drivers/adc.c | 59 | drivers/adc.c |
58 | #ifdef HAVE_MMC | 60 | #ifdef HAVE_MMC |
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c index c8ad3b3151..9bf1815e36 100644 --- a/firmware/drivers/ata.c +++ b/firmware/drivers/ata.c | |||
@@ -241,8 +241,10 @@ static volatile unsigned char* ata_control; | |||
241 | 241 | ||
242 | bool old_recorder = false; | 242 | bool old_recorder = false; |
243 | int ata_spinup_time = 0; | 243 | int ata_spinup_time = 0; |
244 | #ifdef CONFIG_LED | ||
244 | static bool ata_led_enabled = true; | 245 | static bool ata_led_enabled = true; |
245 | static bool ata_led_on = false; | 246 | static bool ata_led_on = false; |
247 | #endif | ||
246 | static bool spinup = false; | 248 | static bool spinup = false; |
247 | static bool sleeping = true; | 249 | static bool sleeping = true; |
248 | static long sleep_timeout = 5*HZ; | 250 | static long sleep_timeout = 5*HZ; |
@@ -475,12 +477,16 @@ static void copy_read_sectors(unsigned char* buf, int wordcount) | |||
475 | #endif | 477 | #endif |
476 | } | 478 | } |
477 | 479 | ||
480 | #ifdef CONFIG_LED | ||
478 | static void ata_led(bool on) { | 481 | static void ata_led(bool on) { |
479 | ata_led_on = on; | 482 | ata_led_on = on; |
480 | if (ata_led_enabled) { | 483 | if (ata_led_enabled) { |
481 | led(ata_led_on); | 484 | led(ata_led_on); |
482 | } | 485 | } |
483 | } | 486 | } |
487 | #else | ||
488 | #define ata_led(on) | ||
489 | #endif | ||
484 | 490 | ||
485 | int ata_read_sectors(IF_MV2(int drive,) | 491 | int ata_read_sectors(IF_MV2(int drive,) |
486 | unsigned long start, | 492 | unsigned long start, |
@@ -1468,6 +1474,7 @@ int ata_init(void) | |||
1468 | return 0; | 1474 | return 0; |
1469 | } | 1475 | } |
1470 | 1476 | ||
1477 | #if CONFIG_LED == LED_REAL | ||
1471 | void ata_set_led_enabled(bool enabled) { | 1478 | void ata_set_led_enabled(bool enabled) { |
1472 | ata_led_enabled = enabled; | 1479 | ata_led_enabled = enabled; |
1473 | if (ata_led_enabled) { | 1480 | if (ata_led_enabled) { |
@@ -1476,3 +1483,4 @@ void ata_set_led_enabled(bool enabled) { | |||
1476 | led(false); | 1483 | led(false); |
1477 | } | 1484 | } |
1478 | } | 1485 | } |
1486 | #endif | ||
diff --git a/firmware/drivers/led.c b/firmware/drivers/led.c index 4598175b79..ca4aadac71 100644 --- a/firmware/drivers/led.c +++ b/firmware/drivers/led.c | |||
@@ -23,16 +23,11 @@ | |||
23 | #include "system.h" | 23 | #include "system.h" |
24 | #include "kernel.h" | 24 | #include "kernel.h" |
25 | 25 | ||
26 | static bool current; | 26 | #if CONFIG_LED == LED_REAL |
27 | |||
28 | #ifdef HAVE_LED | ||
29 | |||
30 | static bool xor; | ||
31 | 27 | ||
32 | void led(bool on) | 28 | void led(bool on) |
33 | { | 29 | { |
34 | current = on; | 30 | if ( on ) |
35 | if ( on ^ xor ) | ||
36 | #ifdef GMINI_ARCH | 31 | #ifdef GMINI_ARCH |
37 | P2 |= 1; | 32 | P2 |= 1; |
38 | else | 33 | else |
@@ -48,21 +43,9 @@ void led(bool on) | |||
48 | #endif | 43 | #endif |
49 | } | 44 | } |
50 | 45 | ||
51 | void invert_led(bool on) | 46 | #elif CONFIG_LED == LED_VIRTUAL |
52 | { | ||
53 | if ( on ) | ||
54 | { | ||
55 | xor = 1; | ||
56 | } | ||
57 | else | ||
58 | { | ||
59 | xor = 0; | ||
60 | } | ||
61 | led(current); | ||
62 | } | ||
63 | |||
64 | #else /* no LED, just status update */ | ||
65 | 47 | ||
48 | static bool current; | ||
66 | static long last_on; /* timestamp of switching off */ | 49 | static long last_on; /* timestamp of switching off */ |
67 | 50 | ||
68 | void led(bool on) | 51 | void led(bool on) |
@@ -74,15 +57,10 @@ void led(bool on) | |||
74 | current = on; | 57 | current = on; |
75 | } | 58 | } |
76 | 59 | ||
77 | void invert_led(bool on) | ||
78 | { | ||
79 | (void)on; /* no invert feature */ | ||
80 | } | ||
81 | |||
82 | bool led_read(int delayticks) /* read by status bar update */ | 60 | bool led_read(int delayticks) /* read by status bar update */ |
83 | { | 61 | { |
84 | /* reading "off" is delayed by user-supplied monoflop value */ | 62 | /* reading "off" is delayed by user-supplied monoflop value */ |
85 | return (current || TIME_BEFORE(current_tick, last_on+delayticks)); | 63 | return (current || TIME_BEFORE(current_tick, last_on+delayticks)); |
86 | } | 64 | } |
87 | 65 | ||
88 | #endif // #ifdef HAVE_LED | 66 | #endif /* CONFIG_LED */ |
diff --git a/firmware/export/ata.h b/firmware/export/ata.h index 2043de915a..e9dc54c6fe 100644 --- a/firmware/export/ata.h +++ b/firmware/export/ata.h | |||
@@ -61,7 +61,9 @@ extern int ata_write_sectors(IF_MV2(int drive,) unsigned long start, int count, | |||
61 | extern void ata_delayed_write(unsigned long sector, const void* buf); | 61 | extern void ata_delayed_write(unsigned long sector, const void* buf); |
62 | extern void ata_flush(void); | 62 | extern void ata_flush(void); |
63 | extern void ata_spin(void); | 63 | extern void ata_spin(void); |
64 | #if CONFIG_LED == LED_REAL | ||
64 | extern void ata_set_led_enabled(bool enabled); | 65 | extern void ata_set_led_enabled(bool enabled); |
66 | #endif | ||
65 | extern unsigned short* ata_get_identify(void); | 67 | extern unsigned short* ata_get_identify(void); |
66 | 68 | ||
67 | extern long last_disk_activity; | 69 | extern long last_disk_activity; |
diff --git a/firmware/export/config-fmrecorder.h b/firmware/export/config-fmrecorder.h index ec410cb02a..b7f8621f67 100644 --- a/firmware/export/config-fmrecorder.h +++ b/firmware/export/config-fmrecorder.h | |||
@@ -67,8 +67,8 @@ | |||
67 | /* The start address index for ROM builds */ | 67 | /* The start address index for ROM builds */ |
68 | #define ROM_START 0x14010 | 68 | #define ROM_START 0x14010 |
69 | 69 | ||
70 | /* Define this for programmable LED available */ | 70 | /* Software controlled LED */ |
71 | #define HAVE_LED | 71 | #define CONFIG_LED LED_REAL |
72 | 72 | ||
73 | /* Define this for LCD backlight available */ | 73 | /* Define this for LCD backlight available */ |
74 | #define CONFIG_BACKLIGHT BL_RTC /* on I2C controlled RTC port */ | 74 | #define CONFIG_BACKLIGHT BL_RTC /* on I2C controlled RTC port */ |
diff --git a/firmware/export/config-gmini120.h b/firmware/export/config-gmini120.h index 473f1cfa7f..f1c20ee240 100644 --- a/firmware/export/config-gmini120.h +++ b/firmware/export/config-gmini120.h | |||
@@ -54,7 +54,8 @@ | |||
54 | 54 | ||
55 | #define GMINI_ARCH | 55 | #define GMINI_ARCH |
56 | 56 | ||
57 | #define HAVE_LED | 57 | /* Software controlled LED */ |
58 | #define CONFIG_LED LED_REAL | ||
58 | 59 | ||
59 | /* Define this if you have adjustable CPU frequency */ | 60 | /* Define this if you have adjustable CPU frequency */ |
60 | #define HAVE_ADJUSTABLE_CPU_FREQ | 61 | #define HAVE_ADJUSTABLE_CPU_FREQ |
diff --git a/firmware/export/config-gminisp.h b/firmware/export/config-gminisp.h index 431cf2f3ef..5cf8a76204 100644 --- a/firmware/export/config-gminisp.h +++ b/firmware/export/config-gminisp.h | |||
@@ -48,7 +48,8 @@ | |||
48 | 48 | ||
49 | #define GMINI_ARCH | 49 | #define GMINI_ARCH |
50 | 50 | ||
51 | #define HAVE_LED | 51 | /* Software controlled LED */ |
52 | #define CONFIG_LED LED_REAL | ||
52 | 53 | ||
53 | /* Define this if you have adjustable CPU frequency */ | 54 | /* Define this if you have adjustable CPU frequency */ |
54 | #define HAVE_ADJUSTABLE_CPU_FREQ | 55 | #define HAVE_ADJUSTABLE_CPU_FREQ |
diff --git a/firmware/export/config-ondiofm.h b/firmware/export/config-ondiofm.h index cce88e591b..2380f220c0 100644 --- a/firmware/export/config-ondiofm.h +++ b/firmware/export/config-ondiofm.h | |||
@@ -85,6 +85,9 @@ | |||
85 | /* define this if media can be exchanged on the fly */ | 85 | /* define this if media can be exchanged on the fly */ |
86 | #define HAVE_HOTSWAP | 86 | #define HAVE_HOTSWAP |
87 | 87 | ||
88 | /* Virtual LED (icon) */ | ||
89 | #define CONFIG_LED LED_VIRTUAL | ||
90 | |||
88 | #define CONFIG_LCD LCD_SSD1815 | 91 | #define CONFIG_LCD LCD_SSD1815 |
89 | 92 | ||
90 | #define BOOTFILE_EXT ".ajz" | 93 | #define BOOTFILE_EXT ".ajz" |
diff --git a/firmware/export/config-ondiosp.h b/firmware/export/config-ondiosp.h index 58cb4085ae..66062fa0f3 100644 --- a/firmware/export/config-ondiosp.h +++ b/firmware/export/config-ondiosp.h | |||
@@ -73,6 +73,9 @@ | |||
73 | /* define this if media can be exchanged on the fly */ | 73 | /* define this if media can be exchanged on the fly */ |
74 | #define HAVE_HOTSWAP | 74 | #define HAVE_HOTSWAP |
75 | 75 | ||
76 | /* Virtual LED (icon) */ | ||
77 | #define CONFIG_LED LED_VIRTUAL | ||
78 | |||
76 | #define CONFIG_LCD LCD_SSD1815 | 79 | #define CONFIG_LCD LCD_SSD1815 |
77 | 80 | ||
78 | #define BOOTFILE_EXT ".ajz" | 81 | #define BOOTFILE_EXT ".ajz" |
diff --git a/firmware/export/config-player.h b/firmware/export/config-player.h index 8b85bfdfae..eee9e97530 100644 --- a/firmware/export/config-player.h +++ b/firmware/export/config-player.h | |||
@@ -60,8 +60,8 @@ | |||
60 | /* The start address index for ROM builds */ | 60 | /* The start address index for ROM builds */ |
61 | #define ROM_START 0xD010 | 61 | #define ROM_START 0xD010 |
62 | 62 | ||
63 | /* Define this for programmable LED available */ | 63 | /* Software controlled LED */ |
64 | #define HAVE_LED | 64 | #define CONFIG_LED LED_REAL |
65 | 65 | ||
66 | /* Define this for LCD backlight available */ | 66 | /* Define this for LCD backlight available */ |
67 | #define CONFIG_BACKLIGHT BL_PA14_LO /* port PA14, low active */ | 67 | #define CONFIG_BACKLIGHT BL_PA14_LO /* port PA14, low active */ |
diff --git a/firmware/export/config-recorder.h b/firmware/export/config-recorder.h index a3a354feea..61c76d480d 100644 --- a/firmware/export/config-recorder.h +++ b/firmware/export/config-recorder.h | |||
@@ -61,8 +61,8 @@ | |||
61 | /* The start address index for ROM builds */ | 61 | /* The start address index for ROM builds */ |
62 | #define ROM_START 0x11010 | 62 | #define ROM_START 0x11010 |
63 | 63 | ||
64 | /* Define this for programmable LED available */ | 64 | /* Software controlled LED */ |
65 | #define HAVE_LED | 65 | #define CONFIG_LED LED_REAL |
66 | 66 | ||
67 | /* Define this for LCD backlight available */ | 67 | /* Define this for LCD backlight available */ |
68 | #define CONFIG_BACKLIGHT BL_RTC /* on I2C controlled RTC port */ | 68 | #define CONFIG_BACKLIGHT BL_RTC /* on I2C controlled RTC port */ |
diff --git a/firmware/export/config-recorderv2.h b/firmware/export/config-recorderv2.h index b9a011802c..e042a78ead 100644 --- a/firmware/export/config-recorderv2.h +++ b/firmware/export/config-recorderv2.h | |||
@@ -67,8 +67,8 @@ | |||
67 | /* The start address index for ROM builds */ | 67 | /* The start address index for ROM builds */ |
68 | #define ROM_START 0x12010 | 68 | #define ROM_START 0x12010 |
69 | 69 | ||
70 | /* Define this for programmable LED available */ | 70 | /* Software controlled LED */ |
71 | #define HAVE_LED | 71 | #define CONFIG_LED LED_REAL |
72 | 72 | ||
73 | /* Define this for LCD backlight available */ | 73 | /* Define this for LCD backlight available */ |
74 | #define CONFIG_BACKLIGHT BL_RTC /* on I2C controlled RTC port */ | 74 | #define CONFIG_BACKLIGHT BL_RTC /* on I2C controlled RTC port */ |
diff --git a/firmware/export/config.h b/firmware/export/config.h index 56001e32ad..6faaa49ffa 100644 --- a/firmware/export/config.h +++ b/firmware/export/config.h | |||
@@ -74,6 +74,11 @@ | |||
74 | #define I2C_GMINI 2 /* Gmini style */ | 74 | #define I2C_GMINI 2 /* Gmini style */ |
75 | #define I2C_H100 3 /* iRiver h100 style */ | 75 | #define I2C_H100 3 /* iRiver h100 style */ |
76 | 76 | ||
77 | /* CONFIG_LED */ | ||
78 | #define LED_REAL 1 /* SW controlled LED (Archos recorders, player, Gmini) */ | ||
79 | #define LED_VIRTUAL 2 /* Virtual LED (icon) (Archos Ondio) */ | ||
80 | /* else HW controlled LED (iRiver H1x0) */ | ||
81 | |||
77 | /* now go and pick yours */ | 82 | /* now go and pick yours */ |
78 | #if defined(ARCHOS_PLAYER) | 83 | #if defined(ARCHOS_PLAYER) |
79 | #include "config-player.h" | 84 | #include "config-player.h" |
diff --git a/firmware/export/led.h b/firmware/export/led.h index 052da2633b..f1b3b95447 100644 --- a/firmware/export/led.h +++ b/firmware/export/led.h | |||
@@ -23,8 +23,7 @@ | |||
23 | #include <stdbool.h> | 23 | #include <stdbool.h> |
24 | 24 | ||
25 | extern void led( bool on ); | 25 | extern void led( bool on ); |
26 | extern void invert_led( bool on ); | 26 | #if CONFIG_LED == LED_VIRTUAL |
27 | #ifndef HAVE_LED | ||
28 | extern bool led_read(int delayticks); /* read for status bar */ | 27 | extern bool led_read(int delayticks); /* read for status bar */ |
29 | #endif | 28 | #endif |
30 | 29 | ||
diff --git a/firmware/panic.c b/firmware/panic.c index bc46c82824..37a185f990 100644 --- a/firmware/panic.c +++ b/firmware/panic.c | |||
@@ -36,7 +36,9 @@ void panicf( const char *fmt, ...) | |||
36 | va_list ap; | 36 | va_list ap; |
37 | 37 | ||
38 | #ifndef SIMULATOR | 38 | #ifndef SIMULATOR |
39 | #if CONFIG_LED == LED_REAL | ||
39 | bool state = false; | 40 | bool state = false; |
41 | #endif | ||
40 | 42 | ||
41 | /* Disable interrupts */ | 43 | /* Disable interrupts */ |
42 | #if CONFIG_CPU == SH7034 | 44 | #if CONFIG_CPU == SH7034 |
@@ -76,7 +78,7 @@ void panicf( const char *fmt, ...) | |||
76 | DEBUGF(panic_buf); | 78 | DEBUGF(panic_buf); |
77 | while (1) | 79 | while (1) |
78 | { | 80 | { |
79 | #ifndef SIMULATOR | 81 | #if (CONFIG_LED == LED_REAL) && !defined(SIMULATOR) |
80 | volatile long i; | 82 | volatile long i; |
81 | led (state); | 83 | led (state); |
82 | state = state?false:true; | 84 | state = state?false:true; |