void hw_init(void) { hw_init_clock(); hw_init_gpio(); hw_init_ltdc(); hw_init_timer(); }
int main(void) { halInit(); chSysInit(); chThdSleepMilliseconds(1000); hw_init_gpio(); LED_RED_OFF(); LED_GREEN_OFF(); conf_general_init(); ledpwm_init(); mc_configuration mcconf; conf_general_read_mc_configuration(&mcconf); mc_interface_init(&mcconf); commands_init(); comm_usb_init(); app_configuration appconf; conf_general_read_app_configuration(&appconf); app_init(&appconf); timeout_init(); timeout_configure(appconf.timeout_msec, appconf.timeout_brake_current); #if CAN_ENABLE comm_can_init(); #endif #if WS2811_ENABLE ws2811_init(); led_external_init(); #endif #if ENCODER_ENABLE encoder_init(); #endif #if SERVO_OUT_ENABLE #if SERVO_OUT_SIMPLE servo_simple_init(); #else servo_init(); #endif #endif // Threads chThdCreateStatic(periodic_thread_wa, sizeof(periodic_thread_wa), NORMALPRIO, periodic_thread, NULL); chThdCreateStatic(sample_send_thread_wa, sizeof(sample_send_thread_wa), NORMALPRIO - 1, sample_send_thread, NULL); chThdCreateStatic(timer_thread_wa, sizeof(timer_thread_wa), NORMALPRIO, timer_thread, NULL); for(;;) { chThdSleepMilliseconds(5000); } }
int main(void) { halInit(); chSysInit(); hw_init_gpio(); ledpwm_init(); mcpwm_init(); comm_init(); app_init(); // Threads chThdCreateStatic(periodic_thread_wa, sizeof(periodic_thread_wa), NORMALPRIO, periodic_thread, NULL); chThdCreateStatic(sample_send_thread_wa, sizeof(sample_send_thread_wa), NORMALPRIO, sample_send_thread, NULL); chThdCreateStatic(timer_thread_wa, sizeof(timer_thread_wa), NORMALPRIO, timer_thread, NULL); for(;;) { chThdSleepMilliseconds(100); } }