diff --git a/app/by_buzzer.c b/app/by_buzzer.c index b4df4d0..f437f08 100644 --- a/app/by_buzzer.c +++ b/app/by_buzzer.c @@ -10,6 +10,7 @@ uint32_t a[40] = {0}; void queue_init(void) { + queue_long = 0; memset(a, 0, sizeof(a)); } @@ -22,7 +23,7 @@ void queue_add_element(int element) } void queue_pop_element(void) { - memmove(a, &a[1], queue_long * sizeof(a)); + memmove(a, &a[1], (queue_long - 1) * sizeof(a[0])); if (queue_long > 0) { queue_long--; } diff --git a/app/main.c b/app/main.c index 85fa16a..242b38c 100644 --- a/app/main.c +++ b/app/main.c @@ -56,7 +56,7 @@ int main(void) ips200_init(IPS200_TYPE_SPI); by_led_init(); - // by_buzzer_init(); + by_buzzer_init(); by_button_init(); jj_bt_init(); @@ -71,7 +71,7 @@ int main(void) // by_tiny_frame_read(0x0D, 0x4059, &data_test); while (1) { Page_Run(); - // by_buzzer_run(); + by_buzzer_run(); tiny_frame_param[0].f32 = pure_angle; tiny_frame_param[1].f32 = near_angle; by_tiny_frame_write(0x0D, 0x0000, tiny_frame_param[0].u32); diff --git a/libraries/zf_device/zf_device_ips200.c b/libraries/zf_device/zf_device_ips200.c index d71a1c0..99b7c99 100644 --- a/libraries/zf_device/zf_device_ips200.c +++ b/libraries/zf_device/zf_device_ips200.c @@ -326,8 +326,8 @@ static void ips200_set_region(uint16 x1, uint16 y1, uint16 x2, uint16 y2) ips200_write_16bit_data(x2+80); ips200_write_command(0x2b); - ips200_write_16bit_data(y1+20); - ips200_write_16bit_data(y2+20); + ips200_write_16bit_data(y1); + ips200_write_16bit_data(y2); ips200_write_command(0x2c); }