Browse Source

update,恢复到更改主动上报最小上报周期为20ms版本

new_pcb
tianjialong 2 years ago
parent
commit
c8c4e3d15a
  1. 32
      MDK-ARM/LWIP.uvguix.29643
  2. 5
      usersrc/udpclient.c
  3. 2
      usersrc/udpclient.h
  4. 73
      usersrc/usermain.c

32
MDK-ARM/LWIP.uvguix.29643
File diff suppressed because it is too large
View File

5
usersrc/udpclient.c

@ -460,8 +460,3 @@ protocol_active_and_trigger_report_t *udp_client_get_active_report_data_structer
{
return &active_report_data_structer;
}
bool udp_client_get_genlock_and_esync_active_flag(void)
{
return genlock_and_esync_active_flag;
}

2
usersrc/udpclient.h

@ -13,5 +13,3 @@ void udp_client_genlock_and_esync_active(void);
bool *udp_client_genlock_and_esync_active_flag_ret(void);
protocol_active_and_trigger_report_t *udp_client_get_active_report_data_structer(void);
bool udp_client_get_genlock_and_esync_active_flag(void);

73
usersrc/usermain.c

@ -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)
{

Loading…
Cancel
Save