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:
parent
0a088ab764
commit
2af52821aa
@ -55,7 +55,7 @@ void HandleOutput(tflite::ErrorReporter* error_reporter, float x_value,
|
|||||||
// The blue LED is lit for all negative values
|
// The blue LED is lit for all negative values
|
||||||
am_devices_led_on(am_bsp_psLEDs, AM_BSP_LED_BLUE);
|
am_devices_led_on(am_bsp_psLEDs, AM_BSP_LED_BLUE);
|
||||||
// The red LED is lit in only some cases
|
// 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);
|
am_devices_led_on(am_bsp_psLEDs, AM_BSP_LED_RED);
|
||||||
} else {
|
} else {
|
||||||
am_devices_led_off(am_bsp_psLEDs, AM_BSP_LED_RED);
|
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
|
// The green LED is lit for all positive values
|
||||||
am_devices_led_on(am_bsp_psLEDs, AM_BSP_LED_GREEN);
|
am_devices_led_on(am_bsp_psLEDs, AM_BSP_LED_GREEN);
|
||||||
// The yellow LED is lit in only some cases
|
// 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);
|
am_devices_led_on(am_bsp_psLEDs, AM_BSP_LED_YELLOW);
|
||||||
} else {
|
} else {
|
||||||
am_devices_led_off(am_bsp_psLEDs, AM_BSP_LED_YELLOW);
|
am_devices_led_off(am_bsp_psLEDs, AM_BSP_LED_YELLOW);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Log the current X and Y values
|
// Log the current X and Y values
|
||||||
TF_LITE_REPORT_ERROR(error_reporter, "x_value: %f, y_value: %f\n", x_value,
|
TF_LITE_REPORT_ERROR(error_reporter, "x_value: %f, y_value: %f\n",
|
||||||
y_value);
|
static_cast<double>(x_value),
|
||||||
|
static_cast<double>(y_value));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user