Abhishekmishra2808 commented on code in PR #3772: URL: https://github.com/apache/nuttx-apps/pull/3772#discussion_r3965808539
########## mlearning/tflite-micro/Makefile: ########## @@ -106,11 +109,42 @@ endif # extra hardware support. -include $(TFLM_DIR)/tensorflow/lite/micro/nuttx/Makefile +PROGNAME := +PRIORITY := +STACKSIZE := +MAINSRC := + ifneq ($(CONFIG_TFLITEMICRO_TOOL),) -MAINSRC = tflm_tool.cc -PROGNAME = tflm -PRIORITY = $(CONFIG_TFLITEMICRO_TOOL_PRIORITY) -STACKSIZE = $(CONFIG_TFLITEMICRO_TOOL_STACKSIZE) +PROGNAME += tflm +PRIORITY += $(CONFIG_TFLITEMICRO_TOOL_PRIORITY) +STACKSIZE += $(CONFIG_TFLITEMICRO_TOOL_STACKSIZE) +MAINSRC += tflm_tool.cc +endif + +ifneq ($(CONFIG_TFLITEMICRO_HELLOWORLD),) +TFLM_HW_DIR := $(TFLM_UNPACK)/tensorflow/lite/micro/examples/hello_world +TFLM_HW_MODELS := $(TFLM_HW_DIR)/models + +ifeq ($(wildcard $(TFLM_UNPACK)/.git),) +$(TFLM_HW_MODELS)/hello_world_float_model_data.h \ +$(TFLM_HW_MODELS)/hello_world_int8_model_data.h: tflite-micro.zip +endif + +$(TFLM_HW_MODELS)/hello_world_float_model_data.h: + $(Q) ( cd $(TFLM_HW_MODELS) && xxd -i hello_world_float.tflite ) | \ + sed -e 's/hello_world_float_tflite/g_hello_world_float_model_data/g' > $@ + +$(TFLM_HW_MODELS)/hello_world_int8_model_data.h: + $(Q) ( cd $(TFLM_HW_MODELS) && xxd -i hello_world_int8.tflite ) | \ + sed -e 's/hello_world_int8_tflite/g_hello_world_int8_model_data/g' > $@ Review Comment: xxd `-i hello_world_int8.tflite` names the array `hello_world_int8_tflite`. Upstream hello_world_test.cc includes hello_world_int8_model_data.h and uses g_hello_world_int8_model_data (same for the float model). CMake already generates those g_* names. The sed only rewrites the xxd symbol so the Makefile hello-world binary matches the names the test already expects. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
