Fix implicit conversion from float to double for hello_world on Sparkfun Edge.

Fixes #42517

Manually tested that the following command succeeds with this change:
make -f tensorflow/lite/micro/tools/make/Makefile TARGET=sparkfun_edge hello_world_bin -j8
This commit is contained in:
Advait Jain 2020-08-24 12:17:39 -07:00
parent 0a088ab764
commit 2af52821aa

View File

@ -55,7 +55,7 @@ void HandleOutput(tflite::ErrorReporter* error_reporter, float x_value,
// The blue LED is lit for all negative values
am_devices_led_on(am_bsp_psLEDs, AM_BSP_LED_BLUE);
// The red LED is lit in only some cases
if (y_value <= -0.75) {
if (y_value <= -0.75f) {
am_devices_led_on(am_bsp_psLEDs, AM_BSP_LED_RED);
} else {
am_devices_led_off(am_bsp_psLEDs, AM_BSP_LED_RED);
@ -68,13 +68,14 @@ void HandleOutput(tflite::ErrorReporter* error_reporter, float x_value,
// The green LED is lit for all positive values
am_devices_led_on(am_bsp_psLEDs, AM_BSP_LED_GREEN);
// The yellow LED is lit in only some cases
if (y_value >= 0.75) {
if (y_value >= 0.75f) {
am_devices_led_on(am_bsp_psLEDs, AM_BSP_LED_YELLOW);
} else {
am_devices_led_off(am_bsp_psLEDs, AM_BSP_LED_YELLOW);
}
}
// Log the current X and Y values
TF_LITE_REPORT_ERROR(error_reporter, "x_value: %f, y_value: %f\n", x_value,
y_value);
TF_LITE_REPORT_ERROR(error_reporter, "x_value: %f, y_value: %f\n",
static_cast<double>(x_value),
static_cast<double>(y_value));
}