add systick ; issue -- i2c transfer unstable

This commit is contained in:
2025-11-12 21:26:40 +08:00
parent 4dc04bdd7e
commit 79d7fca725
11 changed files with 241 additions and 165 deletions

View File

@@ -45,6 +45,9 @@ const float num_f = 0.123456f;
volatile uint16_t count = 0 ;
int pp = 7; //电机极对数
int Dir = 1; //电机编码器方向
int main(void)
{
SYSCFG_DL_init();
@@ -53,10 +56,12 @@ int main(void)
while (1) {
DL_GPIO_togglePins(LED_PORT,LED_PA0_PIN);
//MT6701_get_angle_degree();
delay_ms(20);
delay_ms(50);
volatile float angle_rad = GetAngle();
//printf("test \n");
printf("angle %.5f \n" , angle_rad);
volatile uint32_t tick = DL_SYSTICK_getValue();
printf("systick is %x \n",tick);
PWM_Channel1(count ++);
if(count == 750)