This is the vcdMaker demo project. See http://vcdmaker.org for details. vcdMaker is supposed to help engineers to debug their applications and systems. It transforms text log files into the VCD format which can be easily displayed as a waveform.

Dependencies:   mbed vcdLogger vcdSignal

Files at this revision

API Documentation at this revision

Comitter:
ketjow
Date:
Wed Dec 07 09:16:38 2016 +0000
Parent:
2:a13cde5c679c
Commit message:
Sync signal added

Changed in this revision

Signals/sync.cpp Show annotated file Show diff for this revision Revisions of this file
Signals/sync.hpp Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
vcdSignal.lib Show annotated file Show diff for this revision Revisions of this file
diff -r a13cde5c679c -r 6d5e16097db0 Signals/sync.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Signals/sync.cpp	Wed Dec 07 09:16:38 2016 +0000
@@ -0,0 +1,20 @@
+#include "sync.hpp"
+  
+Sync::Sync(const string& name, const PinName pin, Logger& logger) : DigitalIn(pin), Signal(name,1,logger)
+{
+}
+    
+void Sync::PrintState()
+{
+  string  suffix("");
+  int32_t time_ref = 0;
+  if (read())
+  {
+    /* Do nothing */
+  }
+  else
+  {
+    string msg("Sync triggered");
+    PrintEvent(msg, time_ref);
+  }
+}
\ No newline at end of file
diff -r a13cde5c679c -r 6d5e16097db0 Signals/sync.hpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Signals/sync.hpp	Wed Dec 07 09:16:38 2016 +0000
@@ -0,0 +1,11 @@
+
+#include "mbed.h"
+#include "signal.hpp"
+
+class Sync : public DigitalIn, public Signal
+{
+  public:
+  Sync(const string& name, const PinName pin, Logger& logger);
+  
+  void PrintState();
+};
diff -r a13cde5c679c -r 6d5e16097db0 main.cpp
--- a/main.cpp	Sat May 28 19:25:39 2016 +0000
+++ b/main.cpp	Wed Dec 07 09:16:38 2016 +0000
@@ -26,6 +26,7 @@
 #include "slider.hpp"
 #include "magnetometer.hpp"
 #include "accelerometer.hpp"
+#include "sync.hpp"
 
 #define NO_OF_LINES      ((uint32_t)75)
 #define NO_OF_CHARACTERS ((uint32_t)100)
@@ -44,7 +45,7 @@
 Logger*       uniLogger;
 
 // Signals
-Button        sync("FRDM.Sync",PTA13,slogger);
+Sync          sync("FRDM.Sync",PTA13,slogger);
 Button        sw1("FRDM.Buttons.SW1",PTC3,slogger);
 Button        sw3("FRDM.Buttons.SW3",PTC12,slogger);
 Light         light("FRDM.Sensors.Light",PTE22,slogger);
diff -r a13cde5c679c -r 6d5e16097db0 vcdSignal.lib
--- a/vcdSignal.lib	Sat May 28 19:25:39 2016 +0000
+++ b/vcdSignal.lib	Wed Dec 07 09:16:38 2016 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/ketjow/code/vcdSignal/#abd95c8ed6c1
+http://mbed.org/users/ketjow/code/vcdSignal/#5be5e7e966cd