#include "app/app.h" #include "bsp/bsp.h" #include "os/os_task.h" #include "libs/logger.h" #include "libs/utils.h" #include "foc/motor/motor.h" #include "foc/samples.h" #include "prot/can_foc_msg.h" #include "prot/can_message.h" #include "libs/time_measure.h" #include "app/nv_storage.h" static u32 _app_low_task(void *args); extern void PMSM_FOC_LogDebug(void); extern measure_time_t g_meas_hall; extern measure_time_t g_meas_foc; extern measure_time_t g_meas_timeup; static void mc_exec_log(void) { sys_debug("intval = %d, exec = %d, err = %d, %d, %d, count = %d\n", g_meas_foc.intval_time, g_meas_foc.exec_time, g_meas_foc.intval_time_error, g_meas_foc.intval_low_err, g_meas_foc.intval_hi_err, g_meas_foc.exec_count); sys_debug("timeup intval = %d, err = %d\n\n", g_meas_timeup.intval_time, g_meas_timeup.intval_time_error); PMSM_FOC_LogDebug(); } void app_start(void){ set_log_level(MOD_SYSTEM, L_debug); can_message_init(); restore_config(); mc_init(); shark_task_create(_app_low_task, NULL); sys_debug("mc start\n"); shark_task_run(); } static void _can_report_info(void) { //can_report_speed(0x45, PMSM_FOC_GetSpeed()); } static u32 _app_low_task(void *args) { wdog_reload(); _can_report_info(); mc_exec_log(); return 1000; }