1
0
Fork 0
forked from len0rd/rockbox

x1000: remove LCD fast sleep define

All the X1000 targets use "fast" sleep, as opposed to the normal
HAVE_LCD_SLEEP define which creates a user-configurable option.
Remove the ifdefs to make the code a bit easier to read.

Change-Id: Ibb80c92a8e23191651fee61fc8cf6f4e4fac8750
This commit is contained in:
Aidan MacDonald 2025-04-18 00:04:17 +01:00 committed by Solomon Peachy
parent 7e2019fde9
commit b71337f1fd
4 changed files with 2 additions and 32 deletions

View file

@ -55,7 +55,6 @@
#define HAVE_LCD_BITMAP
#define HAVE_LCD_ENABLE
#define HAVE_LCD_SHUTDOWN
#define LCD_X1000_FASTSLEEP
//#define LCD_X1000_DMA_WAITFORFRAME
#define HAVE_BACKLIGHT

View file

@ -38,7 +38,6 @@
#define HAVE_LCD_COLOR
#define HAVE_LCD_BITMAP
#define HAVE_LCD_ENABLE
#define LCD_X1000_FASTSLEEP
/* Backlight defines */
#define HAVE_BACKLIGHT

View file

@ -35,7 +35,6 @@
#define HAVE_LCD_COLOR
#define HAVE_LCD_BITMAP
#define HAVE_LCD_ENABLE
#define LCD_X1000_FASTSLEEP
#define LCD_X1000_DMA_WAIT_FOR_FRAME
/* Backlight defines */

View file

@ -65,10 +65,8 @@ static fb_data shadowfb[LCD_HEIGHT*LCD_WIDTH] __attribute__((aligned(64)));
/* Signals DMA copy to shadow FB is done */
static volatile int fbcopy_done;
#if defined(HAVE_LCD_SLEEP) || defined(LCD_X1000_FASTSLEEP)
/* True if we're in sleep mode */
static bool lcd_sleeping = false;
#endif
static bool lcd_on = false;
/* Check if running with interrupts disabled (eg: panic screen) */
@ -464,7 +462,7 @@ void lcd_shutdown(void)
}
#endif
#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP)
#if defined(HAVE_LCD_ENABLE)
bool lcd_active(void)
{
return lcd_on;
@ -481,18 +479,13 @@ void lcd_enable(bool en)
#endif
/* Deal with sleep mode */
#if defined(HAVE_LCD_SLEEP) || defined(LCD_X1000_FASTSLEEP)
#if defined(LCD_X1000_FASTSLEEP)
if(state && !en) {
lcd_tgt_sleep(true);
lcd_sleeping = true;
} else
#endif
if(!state && en && lcd_sleeping) {
} else if(!state && en && lcd_sleeping) {
lcd_tgt_sleep(false);
lcd_sleeping = false;
}
#endif
/* Handle turning the LCD back on */
if(!state && en)
@ -507,26 +500,6 @@ void lcd_enable(bool en)
}
#endif
#if defined(HAVE_LCD_SLEEP)
#if defined(LCD_X1000_FASTSLEEP)
# error "Do not define HAVE_LCD_SLEEP if target has LCD_X1000_FASTSLEEP"
#endif
void lcd_awake(void)
{
/* Nothing to do */
}
void lcd_sleep(void)
{
if(!lcd_sleeping) {
lcd_enable(false);
lcd_tgt_sleep(true);
lcd_sleeping = true;
}
}
#endif
void lcd_update(void)
{
if(!lcd_wait_frame())