   OutputPin m_pin;
 };
 
-// Pulse generators
-Pulse red(&clock, 1, Board::D7);
-Pulse green(&wall, 1, Board::D8);
-Pulse blue(&bark, 1, Board::D9);
+// Pulse generators from the different clocks (logic analyzer channel colors)
+Pulse black(&clock, 1, Board::D7);
+Pulse brown(&wall, 1, Board::D8);
+Pulse red(&bark, 1, Board::D9);
 
 void setup()
 {

  // Count loop cycles
  static int32_t cycle = 1;

  // Wait for clock tick
  clock_t start = clock.time();
  clock_t now;
  while (1) {
    now = clock.time();
    if (now != start) break;
    yield();
  }

  // Calculate the clock drift in seconds
  int32_t rtc = wall.time() - now;
  int32_t wdg = bark.time() - now;

  // Print the clocks, drift and error rate (milli-seconds per second)
  trace << cycle << ':' << now
	<< PSTR(":RTC:")

#include "Cosa/Trace.hh"
#include "Cosa/IOStream/Driver/UART.hh"

// -------------------------------------------------------------------
// Calibration values for some of the boards that are used in the Cosa
// build and tests. Note that there are variations between individual
// boards due to factory calibration and the quality of the crystal
// (+- 50 ppm) or ceramic resonator (+-.5%) and PCB layout.
// -------------------------------------------------------------------
// #define BOARD_INFO "Anarduino Miniwireless"
// #define RTC_CALIBRATION_MS 0
// #define WATCHDOG_CALIBRATION_MS -66
// -------------------------------------------------------------------
// #define BOARD_INFO "Duemilanove Clone (Funduino 2012 May)"
// #define RTC_CALIBRATION_MS 0
// #define WATCHDOG_CALIBRATION_MS -12
// -------------------------------------------------------------------
// #define BOARD_INO "Leonardo (Made in Italy)"
// #define RTC_CALIBRATION_MS 0
// #define WATCHDOG_CALIBRATION_MS -95
// -------------------------------------------------------------------
// #define BOARD_INO "Lilypad Clone (GEtech)"
// #define RTC_CALIBRATION_MS -1
// #define WATCHDOG_CALIBRATION_MS -140
// -------------------------------------------------------------------
// #define BOARD_INFO "Mega 2560 Clone"
// #define RTC_CALIBRATION_MS -2
// #define WATCHDOG_CALIBRATION_MS -63
// -------------------------------------------------------------------
// #define BOARD_INFO "Mega 2560 Clone (Funduino)"
// #define RTC_CALIBRATION_MS 0
// #define WATCHDOG_CALIBRATION_MS -108
// -------------------------------------------------------------------
// #define BOARD_INFO "Microduino Core"
// #define RTC_CALIBRATION_MS 0
// #define WATCHDOG_CALIBRATION_MS -69
// -------------------------------------------------------------------
// #define BOARD_INFO "Microduino Core+"
// #define RTC_CALIBRATION_MS 1
// #define WATCHDOG_CALIBRATION_MS -112
// -------------------------------------------------------------------
// #define BOARD_INFO "Microduino Core32U4"
// #define RTC_CALIBRATION_MS 0
// #define WATCHDOG_CALIBRATION_MS -8
// -------------------------------------------------------------------
// #define BOARD_INFO "Moteino"
// #define RTC_CALIBRATION_MS 0
// #define WATCHDOG_CALIBRATION_MS -118
// -------------------------------------------------------------------
// #define BOARD_INFO "Nano Clone (DCCduino)"
// #define RTC_CALIBRATION_MS 0
// #define WATCHDOG_CALIBRATION_MS -24
// -------------------------------------------------------------------
// #define BOARD_INFO "Pro-Micro Clone"
// #define RTC_CALIBRATION_MS 0
// #define WATCHDOG_CALIBRATION_MS 0
// -------------------------------------------------------------------
// #define BOARD_INFO "Pro-Mini Clone (Tinyos, 3.3V/8M)"
// #define RTC_CALIBRATION_MS -2
// #define WATCHDOG_CALIBRATION_MS -61
// -------------------------------------------------------------------
// #define BOARD_INFO "Pro-Mini Clone (white reset button)"
// #define RTC_CALIBRATION_MS 0
// #define WATCHDOG_CALIBRATION_MS 26
// -------------------------------------------------------------------
// #define BOARD_INFO "Pro-Mini Clone (Deek Robot, red reset button)"
// #define RTC_CALIBRATION_MS 0
// #define WATCHDOG_CALIBRATION_MS -1
// -------------------------------------------------------------------
// #define BOARD_INFO "Pro-Mini Clone (Deek Robot, 10 top pins)"
// #define RTC_CALIBRATION_MS 0
// #define WATCHDOG_CALIBRATION_MS 0
// -------------------------------------------------------------------
// #define BOARD_INFO "Uno R3 Clone (GEtech)"
// #define RTC_CALIBRATION_MS 0
// #define WATCHDOG_CALIBRATION_MS -112
// -------------------------------------------------------------------
// #define BOARD_INFO "Uno R3 Clone (VISduino)"
// #define RTC_CALIBRATION_MS 0
// #define WATCHDOG_CALIBRATION_MS -22
// -------------------------------------------------------------------
// #define BOARD_INFO "Wildfire"
// #define RTC_CALIBRATION_MS 0
// #define WATCHDOG_CALIBRATION_MS -122
// -------------------------------------------------------------------

// Wall-clocks; Square Wave from external RTC, internal RTC and
// Watchdog based seconds level clocks
#if defined(ARDUINO_MEGA)					\
  || defined(ARDUINO_PRO_MICRO)
Alarm::Clock clock(Board::EXT3);
#elif defined(ARDUINO_LEONARDO)	   				\
  || defined(MICRODUINO_CORE_PLUS)				\
  || defined(MICRODUINO_CORE32U4)
Alarm::Clock clock(Board::EXT2);
#else
Alarm::Clock clock(Board::EXT1);
#endif
RTC::Clock wall;
Watchdog::Clock bark;

