This commit is contained in:
Glz
2024-03-03 16:27:16 +08:00
52 changed files with 2635 additions and 536 deletions

View File

@@ -21,51 +21,77 @@
* 许可证副本在 libraries 文件夹下 即该文件夹下的 LICENSE 文件
* 欢迎各位使用并传播本程序 但修改内容时必须保留逐飞科技的版权声明(即本声明)
********************************************************************************************************************/
#include "zf_common_headfile.h"
#include "gl_headfile.h"
#include "by_rt_button.h"
#include "./page/page.h"
#include "jj_blueteeth.h"
#include "jj_param.h"
#include "./page/page_ui_widget.h"
#include "page.h"
#include "by_tiny_frame.h"
#include "by_buzzer.h"
#include "by_led.h"
#include "jj_param.h"
#include "jj_blueteeth.h"
/** 测试完成后移除 **/
#include "by_tiny_frame_parse.h"
#include "by_tiny_frame_pack.h"
uint32_t data_test;
/** 测试完成后移除 **/
void test(by_tf_parse_frame_t frame_s, uint8_t status)
{
printf("parse done\r\n");
printf("--cmd: %0.2X\n--reg_addr: %0.4X\n--data: %0.8X\r\n", frame_s.cmd, frame_s.reg_addr, frame_s.data);
if (status) {
printf("noooooooo!\r\n");
} else {
printf("hhhhhhok\r\n");
}
}
int main(void)
{
clock_init(SYSTEM_CLOCK_120M);
clock_init(SYSTEM_CLOCK_144M);
system_delay_init();
debug_init();
mt9v03x_init();
ips200_init(IPS200_TYPE_SPI);
by_gpio_init();
by_exit_init();
by_led_init();
// by_buzzer_init();
by_button_init();
jj_bt_init();
by_buzzer_init();
jj_param_eeprom_init();
Page_Init();
pit_ms_init(TIM1_PIT, 1);
by_tiny_frame_init();
printf("start running\r\n");
tiny_frame_param[0].f32 = 100.5f;
// by_tiny_frame_read(0x0D, 0x4059, &data_test);
while (1) {
Page_Run();
jj_bt_run();
queue_pop_read();
// by_buzzer_run();
by_tiny_frame_write(0x0D, 0x0000, tiny_frame_param[0].u32);
by_tiny_frame_run();
system_delay_ms(10);
if (mt9v03x_finish_flag) {
// 该操作消耗大概 1970 个 tick折合约 110us
memcpy(mt9v03x_image_copy[0], mt9v03x_image[0], (sizeof(mt9v03x_image_copy) / sizeof(uint8_t)));
// adaptiveThreshold((uint8_t*)mt9v03x_image_copy, (uint8_t*)mt9v03x_image_copy, 188, 120, 7, 17);
// ips200_show_gray_image(0, 0, mt9v03x_image_copy[0], MT9V03X_W, MT9V03X_H, MT9V03X_W, MT9V03X_H, 0);
mt9v03x_finish_flag = 0;
state_type = COMMON_STATE;
img_processing();
get_corners();
aim_distance = COMMON_AIM;
tracking();
ElementJudge();
ElementRun();
MidLineTrack();
ips200_show_float(0,180,pure_angle,2,2);
ips200_show_int(0, 200, track_type, 2);
ips200_show_int(0, 220, garage_type, 2);
ips200_show_int(0, 240, cross_type, 2);
ips200_show_int(0, 260, circle_type, 2);
by_led_info_blink();
// state_type = COMMON_STATE;
// img_processing();
// get_corners();
// aim_distance = COMMON_AIM;
// tracking();
// ElementJudge();
// ElementRun();
// MidLineTrack();
}
}
}