|
@ -2,6 +2,7 @@ |
|
|
#include "zboard.h" |
|
|
#include "zboard.h" |
|
|
#include <stdio.h> |
|
|
#include <stdio.h> |
|
|
#include "zport.h" |
|
|
#include "zport.h" |
|
|
|
|
|
#include "udpclient.h" |
|
|
|
|
|
|
|
|
static encoder_light_state_t camera_encoder_state = STANDBY; |
|
|
static encoder_light_state_t camera_encoder_state = STANDBY; |
|
|
static encoder_light_state_t driven_encoder_gear_state = STANDBY; |
|
|
static encoder_light_state_t driven_encoder_gear_state = STANDBY; |
|
@ -138,3 +139,29 @@ encoder_light_state_t encoder_get_state(encoder_usage_t encoder) |
|
|
} |
|
|
} |
|
|
return ENCODER_STATE_NUMBER_AND_ERR_STATE; |
|
|
return ENCODER_STATE_NUMBER_AND_ERR_STATE; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void encoder_all_encoder_clear_counter_and_structer_count(void) |
|
|
|
|
|
{ |
|
|
|
|
|
udp_client_get_active_report_data_structer()->encoder_1_count = 0; |
|
|
|
|
|
udp_client_get_active_report_data_structer()->encoder_2_count = 0; |
|
|
|
|
|
encoder_all_clear_counter(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void encoder_switch_encoder_clear_count_and_structer_count(encoder_usage_t encoder) |
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
switch (encoder) |
|
|
|
|
|
{ |
|
|
|
|
|
case CAMERA_ENCODER: |
|
|
|
|
|
udp_client_get_active_report_data_structer()->encoder_1_count = 0; |
|
|
|
|
|
encoder_clear_counter(CAMERA_ENCODER); |
|
|
|
|
|
break; |
|
|
|
|
|
case DRIVEN_ENCODER_GEAR: |
|
|
|
|
|
udp_client_get_active_report_data_structer()->encoder_2_count = 0; |
|
|
|
|
|
encoder_clear_counter(DRIVEN_ENCODER_GEAR); |
|
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
default: |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
} |