Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| abfcc5bab5 | |||
| 28efb35679 |
@@ -44,8 +44,6 @@ int EEPROM_24AA02E48_run_test(void)
|
||||
display_write_data_seq("TIMEOUT");
|
||||
break;
|
||||
}
|
||||
|
||||
HAL_Delay(2000);
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
@@ -78,29 +76,16 @@ int EEPROM_24AA02E48_run_test(void)
|
||||
display_write_data_seq("TIMEOUT");
|
||||
break;
|
||||
}
|
||||
|
||||
HAL_Delay(2000);
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DISPLAY_CLEAR;
|
||||
display_write_data_seq("24AA02E48 EEPROM");
|
||||
|
||||
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("E ");
|
||||
display_write_data_seq((char *) data_buffer);
|
||||
|
||||
return 1;
|
||||
} else {
|
||||
if (!err_count) {
|
||||
DISPLAY_SET_CURSOR(1, 4);
|
||||
display_write_data_seq("OK ");
|
||||
display_write_data_seq((char *) data_buffer);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
return !!err_count;
|
||||
}
|
||||
|
||||
@@ -55,8 +55,6 @@ static void print_error_message(HAL_StatusTypeDef result, size_t *err_count, siz
|
||||
display_write_data_seq("TIMEOUT");
|
||||
break;
|
||||
}
|
||||
|
||||
HAL_Delay(2000);
|
||||
}
|
||||
|
||||
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, "");
|
||||
|
||||
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
|
||||
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 {
|
||||
if (!err_count) {
|
||||
DISPLAY_SET_CURSOR(1, 4);
|
||||
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[1], 11);
|
||||
print_at(data_xyz[0], 8);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
return !!err_count;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user