| | |
| | | #include "gd32e23x.h" |
| | | #include "pwm.h" |
| | | #include "motor.h" |
| | | #include "bldc_ctrl.h" |
| | | static uint32_t RttDataOutPutFlag = 0; |
| | | static void RTT_KeyValue(uint32_t key); |
| | | extern void RTT_TaskInit(void) |
| | |
| | | } |
| | | if (0 != RttDataOutPutFlag) |
| | | { |
| | | SEGGER_RTT_printf(0, "%d\n", output_index++); |
| | | // SEGGER_RTT_printf(0, "%d\n", output_index++); |
| | | output_index = (uint32_t)get_motor_speed(); |
| | | SEGGER_RTT_printf(0, "motor speed is:%d!\n", output_index); |
| | | } |
| | | } |
| | | |
| | |
| | | case 'd': |
| | | case 'D': |
| | | RttDataOutPutFlag = !RttDataOutPutFlag; |
| | | SEGGER_RTT_printf(0, "Index:\tTemp\tBase\tCP\tleakCurr\tCurr\tAC_Vot\tState\tError\n"); |
| | | SEGGER_RTT_printf(0, "RTT Output data stop or start!\n"); |
| | | break; |
| | | case 'v': |
| | | case 'V': |
| | |
| | | SEGGER_RTT_printf(0, "Software Compile time is :%s %s\n\r", &COMPILE_DATE, &COMPILE_TIME); |
| | | break; |
| | | case 'o': |
| | | timer_channel_output_mode_config(TIMER0, MOTOR_OUT_CH_W, TIMER_OC_MODE_PWM0); |
| | | timer_channel_output_state_config(TIMER0, MOTOR_OUT_CH_W, TIMER_CCX_ENABLE); |
| | | case 'O': |
| | | set_bldcm_speed(2000); |
| | | set_bldcm_enable(); |
| | | break; |
| | | case 's': |
| | | timer_channel_output_state_config(TIMER0, MOTOR_OUT_CH_W, TIMER_CCX_DISABLE); |
| | | case 'S': |
| | | set_bldcm_disable(); |
| | | break; |
| | | default: |
| | | break;` |
| | | break; |
| | | } |
| | | } |