Alvaro Cassinelli
/
skinGames_forktest
just a test
Fork of scoreLight_Advanced by
Diff: main.cpp
- Revision:
- 13:9f03eac02700
- Parent:
- 11:62f7183a03e7
- Child:
- 14:0fc33a3a7b4b
diff -r 0de9cd2bced5 -r 9f03eac02700 main.cpp --- a/main.cpp Thu Apr 12 08:38:44 2012 +0000 +++ b/main.cpp Thu Apr 12 09:50:47 2012 +0000 @@ -121,6 +121,7 @@ // draw the config once befor activating the laser buffer: blobconf.draw(); + lsr.startFullDisplay(); // RENRERER (attn: setConfigToRender must be called when the blobconf is set - i.e., the number of blobs and number of points/blob is fixed) lsr.setConfigToRender(&blobconf); @@ -142,13 +143,7 @@ while (true) { - //NOTE: the updating period needs to be calculated as a function of the number of diplays points and the "refresh" rate of the laser. - // THIS IS THE EQUICALENT OF "VERTICAL SYNCH"... - // if (measureUpdatePeriod.read_ms()>4) { // 4 or 5 ms seems to be the minimum time required for performing one main loop (for a blob of 40 points) - // with laser rendering ISR every 110us (total loop time 4300us, 3100us of effective loop time, and each laser interrupt about 30us) - if (lsr.endedDisplay) { - - lsr.endedDisplay=false; + if (lsr.endedFullDisplay()) { // measureUpdatePeriod.stop(); // measureUpdatePeriod.reset(); @@ -161,6 +156,9 @@ // draw the config (note: each kind of blob renders differently) blobconf.draw(); + + lsr.startFullDisplay(); // this start the point-display counter (wherever the actual laser is). Before update and draw, the counter needs to be reset. + // __enable_irq();