|
|
@ -83,7 +83,27 @@ static void onkey(zkey_t *key, zkey_state_t key_state) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
static int32_t compute_uint16_t_minus_the_numbers(uint16_t now, uint16_t last) |
|
|
|
/** |
|
|
|
* @brief 处理从串口接收到的数据 |
|
|
|
*/ |
|
|
|
void port_mock_on_uart_rx(uart_t *uart) |
|
|
|
{ |
|
|
|
// 处理指令串口接收到的数据 |
|
|
|
if (uart->uarthandler == &DEBUG_UART) |
|
|
|
{ |
|
|
|
at_cmd_processer_push_data(uart->rxbuf); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) |
|
|
|
{ |
|
|
|
if (GPIO_Pin == GPIO_PIN_8) |
|
|
|
{ |
|
|
|
*udp_client_genlock_and_esync_active_flag_ret() = true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
int32_t compute_uint16_t_minus_the_numbers(uint16_t now, uint16_t last) |
|
|
|
{ |
|
|
|
int32_t diff1 = now - last; |
|
|
|
int32_t diff2 = UINT16_MAX - abs(diff1); |
|
|
@ -99,6 +119,20 @@ static int32_t compute_uint16_t_minus_the_numbers(uint16_t now, uint16_t last) |
|
|
|
return diffreal; |
|
|
|
} |
|
|
|
|
|
|
|
void netif_link_up_user_func(void) |
|
|
|
{ |
|
|
|
encoder_light_switch_set_color(CAMERA_ENCODER, ENCODER_LIGHT_COLOR_GREEN); |
|
|
|
encoder_light_switch_set_color(DRIVEN_ENCODER_GEAR, ENCODER_LIGHT_COLOR_GREEN); |
|
|
|
netif_link_status = true; |
|
|
|
} |
|
|
|
|
|
|
|
void netif_link_down_user_func(void) |
|
|
|
{ |
|
|
|
encoder_light_switch_set_color(CAMERA_ENCODER, ENCODER_LIGHT_COLOR_RED); |
|
|
|
encoder_light_switch_set_color(DRIVEN_ENCODER_GEAR, ENCODER_LIGHT_COLOR_RED); |
|
|
|
netif_link_status = false; |
|
|
|
} |
|
|
|
|
|
|
|
static void encoder_get_and_calculation(void) |
|
|
|
{ |
|
|
|
encoder_get_temp = __HAL_TIM_GET_COUNTER(encoder_get_camera_encoder_structer()->tim_handler); |
|
|
@ -118,43 +152,6 @@ static void encoder_get_and_calculation(void) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @brief 处理从串口接收到的数据 |
|
|
|
*/ |
|
|
|
void port_mock_on_uart_rx(uart_t *uart) |
|
|
|
{ |
|
|
|
// 处理指令串口接收到的数据 |
|
|
|
if (uart->uarthandler == &DEBUG_UART) |
|
|
|
{ |
|
|
|
at_cmd_processer_push_data(uart->rxbuf); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) |
|
|
|
{ |
|
|
|
if (GPIO_Pin == GPIO_PIN_8) |
|
|
|
{ |
|
|
|
if (udp_client_get_genlock_and_esync_active_flag()) |
|
|
|
{ /* 只有触发标志设置时才设置genlock标志 */ |
|
|
|
*udp_client_genlock_and_esync_active_flag_ret() = true; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
void netif_link_up_user_func(void) |
|
|
|
{ |
|
|
|
encoder_light_switch_set_color(CAMERA_ENCODER, ENCODER_LIGHT_COLOR_GREEN); |
|
|
|
encoder_light_switch_set_color(DRIVEN_ENCODER_GEAR, ENCODER_LIGHT_COLOR_GREEN); |
|
|
|
netif_link_status = true; |
|
|
|
} |
|
|
|
|
|
|
|
void netif_link_down_user_func(void) |
|
|
|
{ |
|
|
|
encoder_light_switch_set_color(CAMERA_ENCODER, ENCODER_LIGHT_COLOR_RED); |
|
|
|
encoder_light_switch_set_color(DRIVEN_ENCODER_GEAR, ENCODER_LIGHT_COLOR_RED); |
|
|
|
netif_link_status = false; |
|
|
|
} |
|
|
|
|
|
|
|
/* 重写了该函数,需要添加编码器采集部分的逻辑 */ |
|
|
|
void HAL_IncTick(void) |
|
|
|
{ |
|
|
|