lib/builder.js
function() {
    var includes = "#include <ConfigurableFirmata.h>\n\n";

    includes += this.transport.createConfigBlock();

    for (var i = 0, len = this.selectedFeatures.length; i < len; i++) {
      var feature = this.allFeatures[this.selectedFeatures[i]];

      if (feature.dependencies) {
        for (var j = 0; j < feature.dependencies.length; j++) {
          var d = feature.dependencies[j];
          // prevent duplicate includes
          if (d.className && !this.dependencies[d.className]) {
            includes += "#include <" + d.className + ".h>\n";
            this.dependencies[d.className] = true;
          }
        }
      }

      includes += "#include <" + feature.className + ".h>\n";
      includes += feature.className + " " + feature.instanceName + ";\n\n";
    }

    // necessary until Servo can be decoupled from analog output
    if (servoEnabled && !analogOutputEnabled) {
      includes += "#include <AnalogOutputFirmata.h>\n";
      includes += "AnalogOutputFirmata analogOutput;\n\n";
    }

    // always include FirmataExt
    includes += "#include <FirmataExt.h>\n";
    includes += "FirmataExt firmataExt;\n\n";

    return includes;
  }
function() {
    var includes = "#include <ConfigurableFirmata.h>\n\n";

    includes += this.transport.createConfigBlock();

    for (var i = 0, len = this.selectedFeatures.length; i < len; i++) {
      var feature = this.allFeatures[this.selectedFeatures[i]];

      if (feature.dependencies) {
        for (var j = 0; j < feature.dependencies.length; j++) {
          var d = feature.dependencies[j];
          // prevent duplicate includes
          if (d.className && !this.dependencies[d.className]) {
            includes += "#include <" + d.className + ".h>\n";
            this.dependencies[d.className] = true;
          }
        }
      }

      includes += "#include <" + feature.className + ".h>\n";
      includes += feature.className + " " + feature.instanceName + ";\n\n";
    }

    // necessary until Servo can be decoupled from analog output
    if (servoEnabled && !analogOutputEnabled) {
      includes += "#include <AnalogOutputFirmata.h>\n";
      includes += "AnalogOutputFirmata analogOutput;\n\n";
    }

    // always include FirmataExt
    includes += "#include <FirmataExt.h>\n";
    includes += "FirmataExt firmataExt;\n\n";

    return includes;
  }
function ( ) { var includes = "#include <ConfigurableFirmata.h>\n\n" ; includes += this . transport . createConfigBlock ( ) ; for ( var i = 0 , len = this . selectedFeatures . length ; i < len ; i ++ ) { var feature = this . allFeatures [ this . selectedFeatures [ i ] ] ; if ( feature . dependencies ) { for ( var j = 0 ; j < feature . dependencies . length ; j ++ ) { var d = feature . dependencies [ j ] ; // prevent duplicate includes if ( d . className && ! this . dependencies [ d . className ] ) { includes += "#include <" + d . className + ".h>\n" ; this . dependencies [ d . className ] = true ; } } } includes += "#include <" + feature . className + ".h>\n" ; includes += feature . className + " " + feature . instanceName + ";\n\n" ; } // necessary until Servo can be decoupled from analog output if ( servoEnabled && ! analogOutputEnabled ) { includes += "#include <AnalogOutputFirmata.h>\n" ; includes += "AnalogOutputFirmata analogOutput;\n\n" ; } // always include FirmataExt includes += "#include <FirmataExt.h>\n" ; includes += "FirmataExt firmataExt;\n\n" ; return includes ; }
Creates the block of includes, macros and global variables at the top of the file.
@private
Creates the block of includes macros and global variables at the top of the file .