RS232 control for TVOne products
Revision 17:68b9bb89da2b, committed 2012-12-04
- Comitter:
- tobyspark
- Date:
- Tue Dec 04 19:09:06 2012 +0000
- Parent:
- 16:ed8d08386034
- Child:
- 18:d765b0d9271c
- Commit message:
- Timer overflow if idle fix (unverified)
Changed in this revision
spk_tvone_mbed.cpp | Show annotated file Show diff for this revision Revisions of this file |
spk_tvone_mbed.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/spk_tvone_mbed.cpp Sun Dec 02 01:06:50 2012 +0000 +++ b/spk_tvone_mbed.cpp Tue Dec 04 19:09:06 2012 +0000 @@ -40,6 +40,7 @@ minimumCommandPeriod = 30; timer.start(); + timerCheckTicker.attach(this, &SPKTVOne::timerCheck, 60); // Link up debug Serial object // Passing in shared object as debugging is shared between all DVI mixer functions @@ -311,6 +312,16 @@ *errorDO = 0; } +void SPKTVOne::timerCheck() { + // timers are based on 32-bit int microsecond counters, so can only time up to a maximum of 2^31-1 microseconds i.e. 30 minutes. + // this method is called once a minute, and resets the timer if we've been idle for 25mins. + if (timer.read_ms() > 1000*25) + { + if (debug) debug->printf("TVOne Timer reset at %ims", timer.read_ms()); + timer.reset(); + } +} + bool SPKTVOne::uploadEDID(FILE *file, int edidSlotIndex) { bool success;
--- a/spk_tvone_mbed.h Sun Dec 02 01:06:50 2012 +0000 +++ b/spk_tvone_mbed.h Tue Dec 04 19:09:06 2012 +0000 @@ -60,6 +60,8 @@ Serial *debug; Timer timer; + Ticker timerCheckTicker; + void timerCheck(); DigitalOut *writeDO; DigitalOut *errorDO;