ao_cmd_init();
// ao_led_init(LEDS_AVAILABLE);
ao_lcd_stm_init();
+ ao_lcd_font_init();
// ao_add_task(&demo_task, ao_demo, "demo");
ao_start_scheduler();
void ao_lcd_stm_init(void);
+void ao_lcd_font_init(void);
+
void ao_lcd_font_string(char *s);
#endif /* _AO_ARCH_H_ */
while (pos < 6)
ao_lcd_font_char(pos++, ' ', 0);
}
+
+static void
+ao_lcd_font_text(void)
+{
+ char string[20];
+ uint8_t c = 0;
+ ao_cmd_white();
+ while (ao_cmd_lex_c != '\n' && c < sizeof (string) - 1) {
+ 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_font_cmds[] = {
+ { ao_lcd_font_text, "t <string>\0Write <string> to LCD" },
+ { 0, NULL }
+};
+
+void
+ao_lcd_font_init(void)
+{
+ ao_cmd_register(ao_lcd_font_cmds);
+}
+
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 <com> <seg> <value>\0Set LCD segment" },
{ ao_lcd_stm_clear, "C\0Clear LCD" },
- { ao_lcd_stm_text, "t <string>\0Write <string> to LCD" },
{ 0, NULL },
};