![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Usb Device Interface, protocol, and programming homework #4 Audio Control device
Dependencies: C12832_lcd USBDevice mbed
Diff: MyDisplayClass.cpp
- Revision:
- 1:948ffad3284f
- Parent:
- 0:69eb9d19fb91
- Child:
- 3:6da430f4818a
diff -r 69eb9d19fb91 -r 948ffad3284f MyDisplayClass.cpp --- a/MyDisplayClass.cpp Tue Jul 30 22:35:10 2013 +0000 +++ b/MyDisplayClass.cpp Wed Jul 31 22:20:00 2013 +0000 @@ -3,6 +3,8 @@ MyDisplayClass::MyDisplayClass(){ lcd=new C12832_LCD(); volume=new bargraph(lcd,32); + volumeDisplayEnable=false; + graphicModeEnable=false; } void MyDisplayClass::drawNoConnection(C12832_LCD *lcd) { @@ -57,18 +59,17 @@ } -void MyDisplayClass::update(int state,int features){ - if((features&0x1) == 0x1) - if((features&0x2) == 0x2) { +void MyDisplayClass::update(int state){ + if(volumeDisplayEnable) + if(graphicModeEnable) { volume->updateBargraph(); } else { lcd->locate(3,3); lcd->printf("Volume: %2d",volume->level); } - if((features&0x2) == 0x2) + if(graphicModeEnable) UpdateStatus(state); else UpdateTextStatus(state); } -