message: clang-format main_functions.cc
diff: @@ -10,7 +10,6 @@ See the License for the specific language governing permissions and
  limitations under the License.
  ==============================================================================*/
  -
  #include <stdio.h>
  #include <stdlib.h>
  #include <fstream>
  @@ -19,13 +18,12 @@ limitations under the License.
  #include "tensorflow/lite/micro/examples/micro_speech/command_responder.h"
  #include "tensorflow/lite/micro/examples/micro_speech/feature_provider.h"
  #include "tensorflow/lite/micro/examples/micro_speech/micro_features/micro_model_settings.h"
  -#include "tensorflow/lite/micro/examples/micro_speech/recognize_commands.h"
  #include "tensorflow/lite/micro/examples/micro_speech/micro_features/model.h"
  -#include "tensorflow/lite/schema/schema_generated.h"
  +#include "tensorflow/lite/micro/examples/micro_speech/recognize_commands.h"
  #include "tensorflow/lite/micro/micro_interpreter.h"
  -#include "tensorflow/lite/version.h"
  #include "tensorflow/lite/micro/micro_mutable_op_resolver.h"
  -
  +#include "tensorflow/lite/schema/schema_generated.h"
  +#include "tensorflow/lite/version.h"
  extern int32_t g_latest_audio_timestamp;
  void setup_tf();
  @@ -36,16 +34,14 @@ int detection_loop();
  void read_samples();
  int32_t LatestAudioTimestamp();
  extern "C" {
  -void setup()
  -{
  +void setup() {
  init_audio();
  setup_tf();
  }
  }
  extern "C" {
  -void loop()
  -{
  +void loop() {
  // get audio samples
  // run detection
  GetAudio();
  @@ -53,8 +49,6 @@ void loop()
  }
  }
  -
  -
  // Globals, used for compatibility with Arduino-style sketches.
  namespace {
  tflite::ErrorReporter* error_reporter = nullptr;
  @@ -73,8 +67,6 @@ constexpr int kTensorArenaSize = 10 * 1024;
  uint8_t tensor_arena[kTensorArenaSize];
  } // namespace
  -
  -
  // The name of this function is important for Arduino compatibility.
  void setup_tf() {
  // Set up logging. Google style is to avoid globals or statics because of
  @@ -88,7 +80,10 @@ void setup_tf() {
  // copying or parsing, it's a very lightweight operation.
  model = tflite::GetModel(g_model);
  if (model->version() != TFLITE_SCHEMA_VERSION) {
  - TF_LITE_REPORT_ERROR(error_reporter, "Model provided is schema version %d not equal to supported version %d.",model->version(), TFLITE_SCHEMA_VERSION);
  + TF_LITE_REPORT_ERROR(error_reporter,
  + "Model provided is schema version %d not equal to "
  + "supported version %d.",
  + model->version(), TFLITE_SCHEMA_VERSION);
  return;
  }
  @@ -115,8 +110,7 @@ void setup_tf() {
  }
  // Build an interpreter to run the model with.
  static tflite::MicroInterpreter static_interpreter(
  - model, micro_op_resolver, tensor_arena, kTensorArenaSize,
  - error_reporter);
  + model, micro_op_resolver, tensor_arena, kTensorArenaSize, error_reporter);
  interpreter = &static_interpreter;
  // Allocate memory from the tensor_arena for the model's tensors.
  @@ -151,10 +145,7 @@ void setup_tf() {
  previous_time = 0;
  }
  -
  -
  int detection_loop() {
  -
  // Fetch the spectrogram for the current time.
  int retVal = 0;
  const int32_t current_time = LatestAudioTimestamp();
  @@ -210,6 +201,4 @@ frame_counter++;
  is_new_command);
  return retVal;
  -
  }
  -
  