LCD implementation of our project.
Dependencies: mbed mbed-rtos MLX90614
Diff: Menu.cpp
- Revision:
- 3:688b62ff6474
- Parent:
- 2:fcde41900fa5
- Child:
- 4:024e6a9c2ebf
--- a/Menu.cpp Sat Apr 04 18:24:21 2015 +0000 +++ b/Menu.cpp Sun Apr 26 16:29:53 2015 +0000 @@ -1,16 +1,7 @@ #include "Menu.h" void Menu::display(void){ - ui->setCurrent(this); - ui->setHeaderTitle(this->title); - //if it is a menu item, go to referenced screen - if(isScreen){ - items[0]->display(); - return; - } - //otherwise it's a menu, display items - current_line = FIRST_ITEM_LINE; //set first item on screen as selected - selected = 0; + //display items display_items(0); //display items starting from index 0 } @@ -51,22 +42,19 @@ selected--; //display items from the next selected item current_line = LAST_ITEM_LINE; //current selected line will be top of screen - printf("got up, selected is: %d; current line is: %d\n", selected, current_line); } //it is not first on the screen else{ current_line--; selected--; - printf("selected is: %d; current line is: %d\n", selected, current_line); } st7565->clear(); display_items(selected/ITEMS_PER_SCREEN * ITEMS_PER_SCREEN); return; } else if(c == NL && items[selected]->isSelectable){ - //switch to other screen - ui->setCurrent(items[selected]); - ui->display(); + //set selected screen so that UI knows which screen we selected to display + this->setSelectedScreen(items[selected]); } }