Skip to content

Commit

Permalink
updat espidf project templates
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippvK committed Jan 8, 2025
1 parent d4f350c commit 2b61500
Show file tree
Hide file tree
Showing 12 changed files with 39 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ menu "MLonMCU Options"
help
Compare model outputs with expected results (if available). Only works in DEBUG mode.

config MLONMCU_MODLE_DIR
config MLONMCU_MODEL_DIR
string "Model Directory"
depends on MLONMCU_VALIDATE
default "$(MODEL_DIR)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@
#define EXIT_MLIF_INVALID_SIZE (EXIT_MLIF_BASE + 1)
#define EXIT_MLIF_MISSMATCH (EXIT_MLIF_BASE + 2)

void mlonmcu_exit(int status);

#endif // SUPPORT_EXIT_H
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,17 @@
*/
#include "ml_interface.h"
#include "printing.h"
#include "exit.h"

#include <string.h>
#include <stdio.h>
#include <stdlib.h>

void mlonmcu_exit(int status) {
printf("MLONMCU EXIT: %d\n", status);
exit(status);
}

void mlif_run() {
mlif_init();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ limitations under the License.
cmake_minimum_required(VERSION 3.5)

SET(TVM_SRC ${CONFIG_TVM_DIR})
SET(TVM_CRT_CONFIG_DIR ${CONFIG_TVM_CRT_CONFIG_DIR})

IF (NOT ${TVM_SRC} STREQUAL "")

Expand All @@ -35,8 +36,8 @@ SET(TVM_HEADERS

IF(TVM_CRT_CONFIG_DIR)
LIST(APPEND TVM_HEADERS ${TVM_CRT_CONFIG_DIR})
ELSE()
LIST(APPEND TVM_HEADERS ${TVM_SRC}/apps/bundle_deploy/crt_config)
# ELSE()
# LIST(APPEND TVM_HEADERS ${TVM_SRC}/apps/bundle_deploy/crt_config)
ENDIF()

idf_component_register(
Expand All @@ -63,4 +64,3 @@ TARGET_INCLUDE_DIRECTORIES(${COMPONENT_LIB} PUBLIC
ELSE()
idf_component_register()
ENDIF()

Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,9 @@ menu "TVM Build Options"
default "$(TVM_SRC)"
help
TVM directory path.
config TVM_CRT_CONFIG_DIR
string "Path to crt_config"
default "crt_config"
help
TVM crt_config path.
endmenu
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "pins.h"
#include "driver/gpio.h"

void gpio_init()
{
Expand All @@ -11,4 +12,3 @@ void gpio_init()
gpio_set_direction(GPIO_LED_BLUE, GPIO_MODE_OUTPUT);
#endif
}

Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef MICRO_KWS_PINS_H_
#define MICRO_KWS_PINS_H_

#include "sdkconfig.h"

void gpio_init(void);

#if defined(CONFIG_IDF_TARGET_ESP32C3)
Expand Down
2 changes: 1 addition & 1 deletion resources/platforms/espidf/project/components/mlif/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ menu "MLonMCU Options"
help
Compare model outputs with expected results (if available). Only works in DEBUG mode.

config MLONMCU_MODLE_DIR
config MLONMCU_MODEL_DIR
string "Model Directory"
depends on MLONMCU_VALIDATE
default "$(MODEL_DIR)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@
#define EXIT_MLIF_INVALID_SIZE (EXIT_MLIF_BASE + 1)
#define EXIT_MLIF_MISSMATCH (EXIT_MLIF_BASE + 2)

void mlonmcu_exit(int status);

#endif // SUPPORT_EXIT_H
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,17 @@
*/
#include "ml_interface.h"
#include "printing.h"
#include "exit.h"

#include <string.h>
#include <stdio.h>
#include <stdlib.h>

void mlonmcu_exit(int status) {
printf("MLONMCU EXIT: %d\n", status);
exit(status);
}

__attribute__((weak)) bool mlif_request_input(void *model_input_ptr, size_t model_input_sz) {
static int num_done = 0;
if (num_done == num_data_buffers_in) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ limitations under the License.
cmake_minimum_required(VERSION 3.5)

SET(TVM_SRC ${CONFIG_TVM_DIR})
SET(TVM_CRT_CONFIG_DIR ${CONFIG_TVM_CRT_CONFIG_DIR})

IF (NOT ${TVM_SRC} STREQUAL "")

Expand All @@ -35,8 +36,8 @@ SET(TVM_HEADERS

IF(TVM_CRT_CONFIG_DIR)
LIST(APPEND TVM_HEADERS ${TVM_CRT_CONFIG_DIR})
ELSE()
LIST(APPEND TVM_HEADERS ${TVM_SRC}/apps/bundle_deploy/crt_config)
# ELSE()
# LIST(APPEND TVM_HEADERS ${TVM_SRC}/apps/bundle_deploy/crt_config)
ENDIF()

idf_component_register(
Expand All @@ -63,4 +64,3 @@ TARGET_INCLUDE_DIRECTORIES(${COMPONENT_LIB} PUBLIC
ELSE()
idf_component_register()
ENDIF()

5 changes: 5 additions & 0 deletions resources/platforms/espidf/project/components/tvm-lib/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,9 @@ menu "TVM Build Options"
default "$(TVM_SRC)"
help
TVM directory path.
config TVM_CRT_CONFIG_DIR
string "Path to crt_config"
default "crt_config"
help
TVM crt_config path.
endmenu

0 comments on commit 2b61500

Please sign in to comment.