Merge branch 'master' of http://git.brisky.space:441/btl143/firmware_clover
This commit is contained in:
85
app/main.c
85
app/main.c
@@ -21,13 +21,31 @@
|
||||
* 许可证副本在 libraries 文件夹下 即该文件夹下的 LICENSE 文件
|
||||
* 欢迎各位使用并传播本程序 但修改内容时必须保留逐飞科技的版权声明(即本声明)
|
||||
********************************************************************************************************************/
|
||||
#include "zf_common_headfile.h"
|
||||
#include "gl_headfile.h"
|
||||
#include "./page/page.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"
|
||||
/** 测试完成后移除 **/
|
||||
|
||||
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)
|
||||
{
|
||||
|
||||
@@ -36,7 +54,6 @@ int main(void)
|
||||
debug_init();
|
||||
// mt9v03x_init();
|
||||
ips200_init(IPS200_TYPE_SPI);
|
||||
usb_cdc_init();
|
||||
|
||||
by_led_init();
|
||||
by_buzzer_init();
|
||||
@@ -44,30 +61,56 @@ int main(void)
|
||||
|
||||
jj_bt_init();
|
||||
jj_param_eeprom_init();
|
||||
// jj_bt_init();
|
||||
// jj_param_eeprom_init();
|
||||
|
||||
Page_Init();
|
||||
|
||||
pit_ms_init(TIM6_PIT, 2);
|
||||
pit_ms_init(TIM1_PIT, 2);
|
||||
// pit_ms_init(TIM6_PIT, 2);
|
||||
// pit_ms_init(TIM1_PIT, 2);
|
||||
|
||||
by_tiny_frame_init();
|
||||
printf("start running\r\n");
|
||||
|
||||
/** 测试完成后移除 **/
|
||||
// by_tiny_frame_parse_handle_register(test);
|
||||
by_tiny_frame_parse_start_listern();
|
||||
|
||||
by_tf_pack_frame_t frame_now;
|
||||
|
||||
frame_now.cmd = 0x06;
|
||||
frame_now.data = 0x19260817;
|
||||
frame_now.reg_addr = 0x4059;
|
||||
frame_now.slave_id = 0x0D;
|
||||
/** 测试完成后移除 **/
|
||||
|
||||
while (1) {
|
||||
Page_Run();
|
||||
queue_pop_read();
|
||||
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;
|
||||
by_led_info_blink();
|
||||
state_type = COMMON_STATE;
|
||||
img_processing();
|
||||
get_corners();
|
||||
aim_distance = COMMON_AIM;
|
||||
tracking();
|
||||
ElementJudge();
|
||||
ElementRun();
|
||||
MidLineTrack();
|
||||
}
|
||||
by_buzzer_run();
|
||||
|
||||
/** 测试完成后移除 **/
|
||||
by_tiny_frame_run();
|
||||
// by_tiny_frame_pack_send(&frame_now);
|
||||
system_delay_ms(10);
|
||||
by_tiny_frame_parse_timer_handle();
|
||||
/** 测试完成后移除 **/
|
||||
|
||||
// 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;
|
||||
// by_led_info_blink();
|
||||
// state_type = COMMON_STATE;
|
||||
// img_processing();
|
||||
// get_corners();
|
||||
// aim_distance = COMMON_AIM;
|
||||
// tracking();
|
||||
// ElementJudge();
|
||||
// ElementRun();
|
||||
// MidLineTrack();
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user