Skip to content

Commit

Permalink
parser: fix usage bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Marije Baalman committed Sep 24, 2013
1 parent 14e6389 commit 3af58ad
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions hidapi_parser/hidapi_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ int hid_parse_report_descriptor( char* descr_buf, int size, struct hid_device_de
case HID_INPUT:
#ifdef DEBUG_PARSER
printf("input: %i", next_val);
printf("\tcurrent_usage_index: %i", current_usage_index);
#endif
// add the elements for this report
for ( j=0; j<current_report_count; j++ ){
Expand Down Expand Up @@ -370,16 +371,17 @@ int hid_parse_report_descriptor( char* descr_buf, int size, struct hid_device_de
descriptor->num_elements++;
prev_element = new_element;
}
// current_usage_min = -1;
// current_usage_max = -1;
// current_usage_index = 0;
current_usage_min = -1;
current_usage_max = -1;
current_usage_index = 0;
// current_physical_min = 0;
// current_physical_max = 0;
// current_unit_exponent = 0;
break;
case HID_OUTPUT:
#ifdef DEBUG_PARSER
printf("output: %i", next_val);
printf("\tcurrent_usage_index: %i", current_usage_index);
#endif
// add the elements for this report
for ( j=0; j<current_report_count; j++ ){
Expand Down Expand Up @@ -421,16 +423,17 @@ int hid_parse_report_descriptor( char* descr_buf, int size, struct hid_device_de
descriptor->num_elements++;
prev_element = new_element;
}
// current_usage_min = -1;
// current_usage_max = -1;
// current_usage_index = 0;
current_usage_min = -1;
current_usage_max = -1;
current_usage_index = 0;
// current_physical_min = 0;
// current_physical_max = 0;
// current_unit_exponent = 0;
break;
case HID_FEATURE:
#ifdef DEBUG_PARSER
printf("feature: %i", next_val);
printf("\tcurrent_usage_index: %i", current_usage_index);
#endif
// add the elements for this report
for ( j=0; j<current_report_count; j++ ){
Expand Down Expand Up @@ -472,9 +475,9 @@ int hid_parse_report_descriptor( char* descr_buf, int size, struct hid_device_de
descriptor->num_elements++;
prev_element = new_element;
}
// current_usage_min = -1;
// current_usage_max = -1;
// current_usage_index = 0;
current_usage_min = -1;
current_usage_max = -1;
current_usage_index = 0;
// current_physical_min = 0;
// current_physical_max = 0;
// current_unit_exponent = 0;
Expand Down

0 comments on commit 3af58ad

Please sign in to comment.