summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/export/config-clip.h7
-rw-r--r--firmware/target/arm/as3525/sansa-clip/lcd-ssd1303.c14
2 files changed, 18 insertions, 3 deletions
diff --git a/firmware/export/config-clip.h b/firmware/export/config-clip.h
index 7fb6c41fba..4266b59a7f 100644
--- a/firmware/export/config-clip.h
+++ b/firmware/export/config-clip.h
@@ -61,6 +61,13 @@
61/* define this if you can flip your LCD */ 61/* define this if you can flip your LCD */
62#define HAVE_LCD_FLIP 62#define HAVE_LCD_FLIP
63 63
64/* Define this if your LCD can set contrast */
65#define HAVE_LCD_CONTRAST
66
67#define MIN_CONTRAST_SETTING 0
68#define MAX_CONTRAST_SETTING 50
69#define DEFAULT_CONTRAST_SETTING 30
70
64/* #define IRAM_LCDFRAMEBUFFER IDATA_ATTR *//* put the lcd frame buffer in IRAM */ 71/* #define IRAM_LCDFRAMEBUFFER IDATA_ATTR *//* put the lcd frame buffer in IRAM */
65 72
66#define CONFIG_KEYPAD SANSA_CLIP_PAD 73#define CONFIG_KEYPAD SANSA_CLIP_PAD
diff --git a/firmware/target/arm/as3525/sansa-clip/lcd-ssd1303.c b/firmware/target/arm/as3525/sansa-clip/lcd-ssd1303.c
index a794589647..f1e1c24b85 100644
--- a/firmware/target/arm/as3525/sansa-clip/lcd-ssd1303.c
+++ b/firmware/target/arm/as3525/sansa-clip/lcd-ssd1303.c
@@ -123,7 +123,7 @@ static bool display_on; /* used by lcd_enable */
123 123
124int lcd_default_contrast(void) 124int lcd_default_contrast(void)
125{ 125{
126 return 0x1f; 126 return DEFAULT_CONTRAST_SETTING;
127} 127}
128 128
129void lcd_set_contrast(int val) 129void lcd_set_contrast(int val)
@@ -143,8 +143,16 @@ void lcd_set_invert_display(bool yesno)
143/* turn the display upside down (call lcd_update() afterwards) */ 143/* turn the display upside down (call lcd_update() afterwards) */
144void lcd_set_flip(bool yesno) 144void lcd_set_flip(bool yesno)
145{ 145{
146 (void)yesno; 146 if (yesno)
147 /* TODO */ 147 {
148 lcd_write_command(LCD_SET_SEGMENT_REMAP);
149 lcd_write_command(LCD_SET_COM_OUTPUT_SCAN_DIRECTION);
150 }
151 else
152 {
153 lcd_write_command(LCD_SET_SEGMENT_REMAP_INV);
154 lcd_write_command(LCD_SET_COM_OUTPUT_SCAN_DIRECTION_INV);
155 }
148} 156}
149 157
150void lcd_enable(bool enable) 158void lcd_enable(bool enable)