Browse Source

Bugfix: Extra garbage was sent on SPI with new commands

Pelle Nilsson 11 years ago
parent
commit
819b9dfea9
2 changed files with 4 additions and 4 deletions
  1. 1 1
      knc-asic
  2. 3 3
      titan-asic.c

+ 1 - 1
knc-asic

@@ -1 +1 @@
-Subproject commit f15761c85e1cf35e28aeab519ef57d857d263fd4
+Subproject commit 7dab964737ec47640d2b00faacdb36d098ae6b9c

+ 3 - 3
titan-asic.c

@@ -193,11 +193,11 @@ bool knc_titan_get_work_status(const char *repr, void * const ctx, int asic, int
 {
 {
 	uint8_t request[2];
 	uint8_t request[2];
 	int request_length;
 	int request_length;
-	int response_length = 12;
+	int response_length = 2 + 2 * KNC_STATUS_BYTE_ERROR_COUNTERS;
 	uint8_t response[response_length];
 	uint8_t response[response_length];
 	int status;
 	int status;
 	uint8_t num_request_busy_byte;
 	uint8_t num_request_busy_byte;
-	uint16_t num_status_byte_error_counters[4];
+	uint16_t num_status_byte_error_counters[KNC_STATUS_BYTE_ERROR_COUNTERS];
 
 
 	request_length = knc_prepare_titan_work_status(request, asic);
 	request_length = knc_prepare_titan_work_status(request, asic);
 
 
@@ -207,7 +207,7 @@ bool knc_titan_get_work_status(const char *repr, void * const ctx, int asic, int
 		return false;
 		return false;
 	}
 	}
 
 
-	status = knc_decode_work_status(response + 2, &num_request_busy_byte, num_status_byte_error_counters);
+	status = knc_decode_work_status(response, &num_request_busy_byte, num_status_byte_error_counters);
 	if (status) {
 	if (status) {
 		applog(LOG_INFO, "%s[%d]: get_work_status got undefined response", repr, asic);
 		applog(LOG_INFO, "%s[%d]: get_work_status got undefined response", repr, asic);
 		return false;
 		return false;