summaryrefslogtreecommitdiff
path: root/firmware/target/coldfire/iaudio/x5/lcd-x5.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/coldfire/iaudio/x5/lcd-x5.c')
-rwxr-xr-xfirmware/target/coldfire/iaudio/x5/lcd-x5.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/firmware/target/coldfire/iaudio/x5/lcd-x5.c b/firmware/target/coldfire/iaudio/x5/lcd-x5.c
index 7c155eac8f..c06521ef54 100755
--- a/firmware/target/coldfire/iaudio/x5/lcd-x5.c
+++ b/firmware/target/coldfire/iaudio/x5/lcd-x5.c
@@ -139,17 +139,20 @@ inline void lcd_write_data(const unsigned short* p_bytes, int count)
139 139
140int lcd_default_contrast(void) 140int lcd_default_contrast(void)
141{ 141{
142 return 16; 142 return DEFAULT_CONTRAST_SETTING;
143} 143}
144 144
145void lcd_set_contrast(int val) 145void lcd_set_contrast(int val)
146{ 146{
147 if (val >= 15) // val must'nt be 15 or 31 147 /* Clamp val in range 0-14, 16-30 */
148 ++val; 148 if (val < 1)
149 if (val > 30) 149 val = 0;
150 return; 150 else if (val <= 15)
151 151 --val;
152 lcd_write_reg(0x0e, 0x201e + (val << 8)); 152 else if (val > 30)
153 val = 30;
154
155 lcd_write_reg(0x0e, 0x2018 + (val << 8));
153} 156}
154 157
155void lcd_set_invert_display(bool yesno) 158void lcd_set_invert_display(bool yesno)