This application translates HTTP GET requests into the proper RS232 commands to control a Sharp Aquos TV
Dependencies: EthernetInterface mbed-rtos mbed
Diff: DebugPort.h
- Revision:
- 2:3637af74f7f0
- Parent:
- 0:427a14ebab60
--- a/DebugPort.h Tue Jul 29 23:10:14 2014 +0000 +++ b/DebugPort.h Sat Sep 06 23:47:21 2014 +0000 @@ -10,6 +10,8 @@ DigitalOut* led_green; DigitalOut* led_blue; + int m_level; + public: void setLED(bool r, bool g, bool b) { *led_red = !r; @@ -18,6 +20,8 @@ } DebugPort() { + m_level = 0; + m_pc = new Serial(USBTX,USBRX); led_red = new DigitalOut(LED_RED); led_green = new DigitalOut(LED_GREEN); @@ -36,8 +40,9 @@ } void send(const char* msg, int level=0) { m_pc->printf(msg); - if(level>0) { // major fail. stop processing and toggle led - while(true) { + m_level=level; + if(m_level>0) { // major fail. stop processing and toggle led + for(int i =0; i<10; ++i) { setLED(0,0,0); wait(0.1); setLED(1,0,0); @@ -45,8 +50,13 @@ } } } + + int level() { + int ret=m_level; + m_level=0; + return ret; + } }; - #endif \ No newline at end of file