[LIS302DL] fix error reposting, clean up old unused code
This commit is contained in:
parent
28efb35679
commit
abfcc5bab5
@ -55,8 +55,6 @@ static void print_error_message(HAL_StatusTypeDef result, size_t *err_count, siz
|
|||||||
display_write_data_seq("TIMEOUT");
|
display_write_data_seq("TIMEOUT");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
HAL_Delay(2000);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void retrieve_data(size_t *err_count, uint8_t *data_xyz, char *postfix)
|
static void retrieve_data(size_t *err_count, uint8_t *data_xyz, char *postfix)
|
||||||
@ -115,52 +113,8 @@ int LIS302DL_run_test(void)
|
|||||||
|
|
||||||
retrieve_data(&err_count, data_xyz, "");
|
retrieve_data(&err_count, data_xyz, "");
|
||||||
|
|
||||||
DISPLAY_CLEAR;
|
|
||||||
display_write_data_seq("LIS302DL Accel");
|
|
||||||
|
|
||||||
// output retrieved values
|
|
||||||
print_at(data_xyz[2], 14);
|
|
||||||
print_at(data_xyz[1], 11);
|
|
||||||
print_at(data_xyz[0], 8);
|
|
||||||
|
|
||||||
// print the execution stats
|
// print the execution stats
|
||||||
if (err_count) {
|
if (!err_count) {
|
||||||
DISPLAY_SET_CURSOR(1, 4);
|
|
||||||
display_write_data_byte('0' + (err_count / 10) % 10);
|
|
||||||
display_write_data_byte('0' + err_count % 10);
|
|
||||||
display_write_data_seq(" errs");
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
} else {
|
|
||||||
DISPLAY_SET_CURSOR(1, 4);
|
|
||||||
display_write_data_seq("OK");
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int LIS302DL_run_test_dynamic(void)
|
|
||||||
{
|
|
||||||
DISPLAY_CLEAR;
|
|
||||||
display_write_data_seq("LIS302DL Accel D");
|
|
||||||
|
|
||||||
size_t err_count = 0;
|
|
||||||
uint8_t data_xyz[3];
|
|
||||||
|
|
||||||
retrieve_data(&err_count, data_xyz, "D");
|
|
||||||
|
|
||||||
DISPLAY_CLEAR;
|
|
||||||
display_write_data_seq("LIS302DL Accel D");
|
|
||||||
|
|
||||||
// print the execution stats
|
|
||||||
if (err_count) {
|
|
||||||
DISPLAY_SET_CURSOR(1, 4);
|
|
||||||
display_write_data_byte('0' + err_count / 10 % 10);
|
|
||||||
display_write_data_byte('0' + err_count % 10);
|
|
||||||
display_write_data_seq(" errs");
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
} else {
|
|
||||||
DISPLAY_SET_CURSOR(1, 4);
|
DISPLAY_SET_CURSOR(1, 4);
|
||||||
display_write_data_seq("OK");
|
display_write_data_seq("OK");
|
||||||
|
|
||||||
@ -168,7 +122,7 @@ int LIS302DL_run_test_dynamic(void)
|
|||||||
print_at(data_xyz[2], 14);
|
print_at(data_xyz[2], 14);
|
||||||
print_at(data_xyz[1], 11);
|
print_at(data_xyz[1], 11);
|
||||||
print_at(data_xyz[0], 8);
|
print_at(data_xyz[0], 8);
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return !!err_count;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user