app.c 515 B

123456789101112131415161718192021222324252627
  1. #include "app/app.h"
  2. #include "bsp/bsp.h"
  3. #include "os/timer.h"
  4. #include "os/co_task.h"
  5. #include "libs/logger.h"
  6. #include "prot/can_message.h"
  7. #include "foc/foc_api.h"
  8. static void _app_low_task(void *args);
  9. void app_start(void){
  10. set_log_level(MOD_SYSTEM, L_debug);
  11. can_message_init();
  12. foc_init();
  13. co_task_create(_app_low_task, NULL, 512);
  14. co_task_schedule();
  15. }
  16. static void _app_low_task(void *args) {
  17. while(1) {
  18. wdog_reload();
  19. sys_debug("speed %d RPM\n", foc_get_speed());
  20. co_task_delay(500);
  21. }
  22. }