a fork of priustroller

Dependencies:   mbed

Fork of priustroller_current by N K

Revision:
53:ef62d7a958f2
Parent:
24:f1ff9c7256b5
--- a/debug/debug.cpp	Sun Apr 26 10:52:08 2015 +0000
+++ b/debug/debug.cpp	Sat May 02 00:21:00 2015 +0000
@@ -9,12 +9,15 @@
     _index = (int*)malloc(_channels*sizeof(int));
     for (int i = 0; i < _channels; i++) _index[i] = 0;
     _done = 0;
+    _triggered = 0;
     _buffer = (float*)malloc(_size * _channels * sizeof(float));
     _context->serial->printf("Debugger channels: %d\n\r", _channels);
     _context->serial->printf("Debugger depth: %d\n\r", _size);
 }
 
 void BufferedDebugger::Write(int channel, float f) {
+    if (_context->user->throttle > 0.1f) _triggered = 1;
+    if (!_triggered) return;
     if (_index[channel] * _channels + channel < _size * _channels) {
         _buffer[_channels * _index[channel] + channel] = f;
         _index[channel]++;