X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fstm%2Fao_lcd_stm.c;h=b19094440a9ff8f1027510f026f8266a150e0396;hb=8fdde3e74c6dce35f90f4575ce6914516fc56aba;hp=2d2fa9b3833177c51dd576d1fc45198edd643e3b;hpb=6da2f5846f2d28ea1f09f60ef2cc3f68113ac62a;p=fw%2Faltos diff --git a/src/stm/ao_lcd_stm.c b/src/stm/ao_lcd_stm.c index 2d2fa9b3..b1909444 100644 --- a/src/stm/ao_lcd_stm.c +++ b/src/stm/ao_lcd_stm.c @@ -268,25 +268,10 @@ ao_lcd_stm_clear(void) stm_lcd.sr = (1 << STM_LCD_SR_UDR); } -static void -ao_lcd_stm_text(void) -{ - char string[7]; - uint8_t c = 0; - ao_cmd_white(); - while (ao_cmd_lex_c != '\n' && c < sizeof (string)) { - string[c++] = ao_cmd_lex_c; - ao_cmd_lex(); - } - string[c++] = '\0'; - ao_lcd_font_string(string); - stm_lcd.sr = (1 << STM_LCD_SR_UDR); -} const struct ao_cmds ao_lcd_stm_cmds[] = { { ao_lcd_stm_seg_set, "s \0Set LCD segment" }, { ao_lcd_stm_clear, "C\0Clear LCD" }, - { ao_lcd_stm_text, "t \0Write to LCD" }, { 0, NULL }, }; @@ -343,10 +328,14 @@ ao_lcd_stm_init(void) } } + /* Disable the LCD */ + stm_lcd.cr = 0; + /* duty cycle 1/3, radio 352, frame rate about 33Hz */ - stm_lcd.fcr = ((STM_LCD_FCR_PS_1 << STM_LCD_FCR_PS) | - (STM_LCD_FCR_DIV_31 << STM_LCD_FCR_DIV) | + stm_lcd.fcr = ((STM_LCD_FCR_PS_16 << STM_LCD_FCR_PS) | + (STM_LCD_FCR_DIV_20 << STM_LCD_FCR_DIV) | (4 << STM_LCD_FCR_CC) | + (0 << STM_LCD_FCR_DEAD) | (4 << STM_LCD_FCR_PON) | (0 << STM_LCD_FCR_UDDIE) | (0 << STM_LCD_FCR_SOFIE) | @@ -358,8 +347,8 @@ ao_lcd_stm_init(void) /* Program desired BIAS in LCD_CR */ /* Enable mux seg */ /* Internal voltage source */ - stm_lcd.cr = ((STM_LCD_CR_DUTY_1_4 << STM_LCD_CR_DUTY) | - (STM_LCD_CR_BIAS_1_3 << STM_LCD_CR_BIAS) | + stm_lcd.cr = ((STM_LCD_CR_DUTY_STATIC << STM_LCD_CR_DUTY) | + (STM_LCD_CR_BIAS_1_2 << STM_LCD_CR_BIAS) | (0 << STM_LCD_CR_VSEL) | (1 << STM_LCD_CR_MUX_SEG));