#include "SFBPins.h"

extern void __libc_csu_init (int argc, char **argv, char **envp);

extern void sketchEarlyInits();

extern void sketchLateInits();

extern void runSketch();

extern void flashAll(int);

#include "SFBAssert.h"

int main() {

  debugRGB(2,0);                /* show green if we hang after this */

  __libc_csu_init (0, 0, 0);  /* run C++ static initializers */

  /*
   * As of this point, (at least) the following services are now
   * initialized:
   *
   * - SFBAlarms: Can schedule alarms on Alarms
   *
   * - SFBReactor: Can register packet handlers on Body
   */

  debugRGB(4,0);                /* show red if we hang after this */

  sketchEarlyInits();

  debugRGB(1,0);                /* show blue if we hang after this */

  sketchLateInits();

  debugRGB(0,1);                /* grand pause */

  runSketch();

  return 0; /* NOT REACHED */
}
