summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Gekov <george.gekov@arm.com>2021-08-03 11:18:41 +0100
committerIsabella Gottardi <isabella.gottardi@arm.com>2021-08-05 08:33:15 +0000
commit93e59512c3b7871d32503afeef54f5f72603beb9 (patch)
treef58039703685cbaba754fec33203ac1a1084b6e8
parentf085fa5a2859178741f39563b4d9d68ca41d916a (diff)
downloadml-embedded-evaluation-kit-93e59512c3b7871d32503afeef54f5f72603beb9.tar.gz
MLECO-2138: Fix line feeding with GCC
Signed-off-by: George Gekov <george.gekov@arm.com> Change-Id: I32c05897085554f469bedc55e4e2800788121c55
-rw-r--r--source/use_case/ad/src/MainLoop.cc1
-rw-r--r--source/use_case/ad/src/UseCaseHandler.cc16
-rw-r--r--source/use_case/asr/src/MainLoop.cc1
-rw-r--r--source/use_case/img_class/src/MainLoop.cc1
-rw-r--r--source/use_case/kws/src/MainLoop.cc1
-rw-r--r--source/use_case/kws_asr/src/MainLoop.cc1
6 files changed, 14 insertions, 7 deletions
diff --git a/source/use_case/ad/src/MainLoop.cc b/source/use_case/ad/src/MainLoop.cc
index 6431509..3c2f9cc 100644
--- a/source/use_case/ad/src/MainLoop.cc
+++ b/source/use_case/ad/src/MainLoop.cc
@@ -40,6 +40,7 @@ static void DisplayMenu()
printf(" %u. Show NN model info\n", MENU_OPT_SHOW_MODEL_INFO);
printf(" %u. List audio signals\n\n", MENU_OPT_LIST_AUDIO_CLIPS);
printf(" Choice: ");
+ fflush(stdout);
}
diff --git a/source/use_case/ad/src/UseCaseHandler.cc b/source/use_case/ad/src/UseCaseHandler.cc
index ec35156..0c78179 100644
--- a/source/use_case/ad/src/UseCaseHandler.cc
+++ b/source/use_case/ad/src/UseCaseHandler.cc
@@ -266,21 +266,23 @@ namespace app {
/* Display each result */
uint32_t rowIdx1 = dataPsnTxtStartY1 + 2 * dataPsnTxtYIncr;
- std::string resultStr = std::string{"Average anomaly score is: "} + std::to_string(result) +
- std::string("\n") + std::string("Anomaly threshold is: ") + std::to_string(threshold) +
- std::string("\n");
+ std::string anomalyScore = std::string{"Average anomaly score is: "} + std::to_string(result);
+ std::string anomalyThreshold = std::string("Anomaly threshold is: ") + std::to_string(threshold);
+ std::string anomalyResult;
if (result > threshold) {
- resultStr += std::string("Anomaly detected!");
+ anomalyResult += std::string("Anomaly detected!");
} else {
- resultStr += std::string("Everything fine, no anomaly detected!");
+ anomalyResult += std::string("Everything fine, no anomaly detected!");
}
platform.data_psn->present_data_text(
- resultStr.c_str(), resultStr.size(),
+ anomalyScore.c_str(), anomalyScore.size(),
dataPsnTxtStartX1, rowIdx1, false);
- info("%s\n", resultStr.c_str());
+ info("%s\n", anomalyScore.c_str());
+ info("%s\n", anomalyThreshold.c_str());
+ info("%s\n", anomalyResult.c_str());
return true;
}
diff --git a/source/use_case/asr/src/MainLoop.cc b/source/use_case/asr/src/MainLoop.cc
index 24b6fcd..42bb08e 100644
--- a/source/use_case/asr/src/MainLoop.cc
+++ b/source/use_case/asr/src/MainLoop.cc
@@ -44,6 +44,7 @@ static void DisplayMenu()
printf(" %u. Show NN model info\n", MENU_OPT_SHOW_MODEL_INFO);
printf(" %u. List audio clips\n\n", MENU_OPT_LIST_AUDIO_CLIPS);
printf(" Choice: ");
+ fflush(stdout);
}
/** @brief Verify input and output tensor are of certain min dimensions. */
diff --git a/source/use_case/img_class/src/MainLoop.cc b/source/use_case/img_class/src/MainLoop.cc
index 255f8e0..61a09dd 100644
--- a/source/use_case/img_class/src/MainLoop.cc
+++ b/source/use_case/img_class/src/MainLoop.cc
@@ -44,6 +44,7 @@ static void DisplayMenu()
printf(" %u. Show NN model info\n", MENU_OPT_SHOW_MODEL_INFO);
printf(" %u. List images\n\n", MENU_OPT_LIST_IMAGES);
printf(" Choice: ");
+ fflush(stdout);
}
void main_loop(hal_platform& platform)
diff --git a/source/use_case/kws/src/MainLoop.cc b/source/use_case/kws/src/MainLoop.cc
index 48cdad4..80254d0 100644
--- a/source/use_case/kws/src/MainLoop.cc
+++ b/source/use_case/kws/src/MainLoop.cc
@@ -44,6 +44,7 @@ static void DisplayMenu()
printf(" %u. Show NN model info\n", MENU_OPT_SHOW_MODEL_INFO);
printf(" %u. List audio clips\n\n", MENU_OPT_LIST_AUDIO_CLIPS);
printf(" Choice: ");
+ fflush(stdout);
}
void main_loop(hal_platform& platform)
diff --git a/source/use_case/kws_asr/src/MainLoop.cc b/source/use_case/kws_asr/src/MainLoop.cc
index 3a69315..ed9034f 100644
--- a/source/use_case/kws_asr/src/MainLoop.cc
+++ b/source/use_case/kws_asr/src/MainLoop.cc
@@ -49,6 +49,7 @@ static void DisplayMenu()
printf(" %u. Show NN model info\n", MENU_OPT_SHOW_MODEL_INFO);
printf(" %u. List audio clips\n\n", MENU_OPT_LIST_AUDIO_CLIPS);
printf(" Choice: ");
+ fflush(stdout);
}
/** @brief Gets the number of MFCC features for a single window. */