add test number tags automatically written to framebuffers and accomodate module formatting to make room for those
This commit is contained in:
parent
c9b90a679e
commit
d145aa3661
|
@ -13,9 +13,9 @@ int EEPROM_24AA02E48_run_test(void)
|
|||
size_t err_count = 0;
|
||||
|
||||
// write the Address Pointer register
|
||||
uint8_t data_buffer[13];
|
||||
data_buffer[12] = '\0';
|
||||
data_buffer[0] = 0xF4;
|
||||
uint8_t data_buffer[9];
|
||||
data_buffer[8] = '\0';
|
||||
data_buffer[0] = 0xF8;
|
||||
|
||||
for (size_t t = 0; t < 5; t++) {
|
||||
op_result = HAL_I2C_Master_Transmit(&hi2c1, 0xA0, data_buffer, 1, 2000);
|
||||
|
@ -26,7 +26,7 @@ int EEPROM_24AA02E48_run_test(void)
|
|||
DISPLAY_CLEAR;
|
||||
display_write_data_seq("24AA02E48 EEPROM");
|
||||
|
||||
DISPLAY_SET_CURSOR(1, 0);
|
||||
DISPLAY_SET_CURSOR(1, 4);
|
||||
display_write_data_seq("W ");
|
||||
display_write_data_byte('1' + t);
|
||||
display_write_data_seq("/5 ");
|
||||
|
@ -52,7 +52,7 @@ int EEPROM_24AA02E48_run_test(void)
|
|||
}
|
||||
|
||||
for (size_t t = 0; t < 5; t++) {
|
||||
op_result = HAL_I2C_Master_Receive(&hi2c1, 0xA1, data_buffer, 12, 2000);
|
||||
op_result = HAL_I2C_Master_Receive(&hi2c1, 0xA1, data_buffer, 8, 2000);
|
||||
|
||||
if (op_result) {
|
||||
err_count++;
|
||||
|
@ -60,7 +60,7 @@ int EEPROM_24AA02E48_run_test(void)
|
|||
DISPLAY_CLEAR;
|
||||
display_write_data_seq("24AA02E48 EEPROM");
|
||||
|
||||
DISPLAY_SET_CURSOR(1, 0);
|
||||
DISPLAY_SET_CURSOR(1, 4);
|
||||
display_write_data_seq("R ");
|
||||
display_write_data_byte('1' + t);
|
||||
display_write_data_seq("/5 ");
|
||||
|
@ -89,15 +89,15 @@ int EEPROM_24AA02E48_run_test(void)
|
|||
display_write_data_seq("24AA02E48 EEPROM");
|
||||
|
||||
if (err_count) {
|
||||
DISPLAY_SET_CURSOR(1, 0);
|
||||
display_write_data_byte('0' + err_count / 10 % 10);
|
||||
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 {
|
||||
DISPLAY_SET_CURSOR(1, 1);
|
||||
DISPLAY_SET_CURSOR(1, 4);
|
||||
display_write_data_seq("OK ");
|
||||
display_write_data_seq((char *) data_buffer);
|
||||
|
||||
|
|
|
@ -54,13 +54,13 @@ int CS43L22_run_test(void)
|
|||
display_write_data_seq("CS43L22 Audio");
|
||||
|
||||
if (err_count) {
|
||||
DISPLAY_SET_CURSOR(1, 1);
|
||||
DISPLAY_SET_CURSOR(1, 4);
|
||||
display_write_data_byte('0' + err_count % 10);
|
||||
display_write_data_seq(" Errors");
|
||||
|
||||
return 1;
|
||||
} else {
|
||||
DISPLAY_SET_CURSOR(1, 1);
|
||||
DISPLAY_SET_CURSOR(1, 4);
|
||||
display_write_data_seq("OK");
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -50,14 +50,14 @@ static void DNI_print(int temperature)
|
|||
}
|
||||
|
||||
if (add_sign) {
|
||||
DISPLAY_SET_CURSOR(1, 0);
|
||||
DISPLAY_SET_CURSOR(1, 4);
|
||||
display_write_data_byte('-');
|
||||
}
|
||||
}
|
||||
|
||||
static void DNI_print_celsius(int temperature)
|
||||
{
|
||||
DISPLAY_SET_CURSOR(1, 7);
|
||||
DISPLAY_SET_CURSOR(1, 10);
|
||||
DISPLAY_SET_DECREMENT;
|
||||
display_write_data_seq("C ");
|
||||
|
||||
|
@ -66,7 +66,7 @@ static void DNI_print_celsius(int temperature)
|
|||
|
||||
static void DNI_print_fahrenheit(int temperature)
|
||||
{
|
||||
DISPLAY_SET_CURSOR(1, 7);
|
||||
DISPLAY_SET_CURSOR(1, 10);
|
||||
DISPLAY_SET_DECREMENT;
|
||||
display_write_data_seq("F ");
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ static void print_error_message(HAL_StatusTypeDef result, size_t *err_count, siz
|
|||
DISPLAY_CLEAR;
|
||||
display_write_data_seq("LIS302DL Accel ");
|
||||
display_write_data_seq(postfix);
|
||||
DISPLAY_SET_CURSOR(1, 0);
|
||||
DISPLAY_SET_CURSOR(1, 4);
|
||||
display_write_data_seq(prefix);
|
||||
display_write_data_byte(' ');
|
||||
|
||||
|
@ -125,14 +125,14 @@ int LIS302DL_run_test(void)
|
|||
|
||||
// print the execution stats
|
||||
if (err_count) {
|
||||
DISPLAY_SET_CURSOR(1, 0);
|
||||
display_write_data_byte('0' + err_count / 10 % 10);
|
||||
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, 1);
|
||||
DISPLAY_SET_CURSOR(1, 4);
|
||||
display_write_data_seq("OK");
|
||||
|
||||
return 0;
|
||||
|
@ -152,23 +152,23 @@ int LIS302DL_run_test_dynamic(void)
|
|||
DISPLAY_CLEAR;
|
||||
display_write_data_seq("LIS302DL Accel D");
|
||||
|
||||
// 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, 0);
|
||||
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, 1);
|
||||
DISPLAY_SET_CURSOR(1, 4);
|
||||
display_write_data_seq("OK");
|
||||
|
||||
// output retrieved values
|
||||
print_at(data_xyz[2], 14);
|
||||
print_at(data_xyz[1], 11);
|
||||
print_at(data_xyz[0], 8);
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ extern I2C_HandleTypeDef hi2c1;
|
|||
|
||||
static void print_error_message(HAL_StatusTypeDef result, size_t *err_count, size_t t, char *prefix)
|
||||
{
|
||||
DISPLAY_SET_CURSOR(1, 0);
|
||||
DISPLAY_SET_CURSOR(1, 4);
|
||||
display_write_data_seq(prefix);
|
||||
display_write_data_byte(' ');
|
||||
|
||||
|
@ -82,12 +82,12 @@ int LSM9DS1_test_accel(void)
|
|||
FAILSAFE_POST_OP_ACCEL("R");
|
||||
|
||||
if (!err_count) {
|
||||
DISPLAY_SET_CURSOR(1, 1);
|
||||
DISPLAY_SET_CURSOR(1, 4);
|
||||
display_write_data_seq("OK");
|
||||
|
||||
return 0;
|
||||
} else {
|
||||
DISPLAY_SET_CURSOR(1, 0);
|
||||
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(" errors");
|
||||
|
@ -124,12 +124,12 @@ int LSM9DS1_test_magnet(void)
|
|||
FAILSAFE_POST_OP_MAGNET("R");
|
||||
|
||||
if (!err_count) {
|
||||
DISPLAY_SET_CURSOR(1, 1);
|
||||
DISPLAY_SET_CURSOR(1, 4);
|
||||
display_write_data_seq("OK");
|
||||
|
||||
return 0;
|
||||
} else {
|
||||
DISPLAY_SET_CURSOR(1, 0);
|
||||
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(" errors");
|
||||
|
|
|
@ -22,12 +22,12 @@ int MP45DT02_run_test(void)
|
|||
display_write_data_seq("MP45DT02 Mic");
|
||||
|
||||
if (!t) {
|
||||
DISPLAY_SET_CURSOR(1, 1);
|
||||
DISPLAY_SET_CURSOR(1, 4);
|
||||
display_write_data_seq("OK");
|
||||
} else {
|
||||
DISPLAY_SET_CURSOR(1, 0);
|
||||
DISPLAY_SET_CURSOR(1, 4);
|
||||
display_write_data_byte('0' + t);
|
||||
display_write_data_seq(" full 0 samples");
|
||||
display_write_data_seq(" 0 samples");
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -37,9 +37,9 @@ int MP45DT02_run_test(void)
|
|||
DISPLAY_CLEAR;
|
||||
display_write_data_seq("MP45DT02 Mic");
|
||||
|
||||
DISPLAY_SET_CURSOR(1, 0);
|
||||
DISPLAY_SET_CURSOR(1, 4);
|
||||
display_write_data_byte('1' + t);
|
||||
display_write_data_seq("/5: no 1 sampled");
|
||||
display_write_data_seq("/5: all zeros");
|
||||
|
||||
HAL_Delay(1000);
|
||||
}
|
||||
|
@ -48,8 +48,8 @@ int MP45DT02_run_test(void)
|
|||
DISPLAY_CLEAR;
|
||||
display_write_data_seq("MP45DT02 Mic");
|
||||
|
||||
DISPLAY_SET_CURSOR(1, 0);
|
||||
display_write_data_seq("No good samples!");
|
||||
DISPLAY_SET_CURSOR(1, 4);
|
||||
display_write_data_seq("NO ONES");
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ int PCA9685_run_test(void)
|
|||
|
||||
DISPLAY_CLEAR;
|
||||
display_write_data_seq("PCA9685 PWM");
|
||||
DISPLAY_SET_CURSOR(1, 0);
|
||||
DISPLAY_SET_CURSOR(1, 4);
|
||||
|
||||
display_write_data_seq("B");
|
||||
display_write_data_byte('0' + i);
|
||||
|
@ -64,14 +64,14 @@ int PCA9685_run_test(void)
|
|||
display_write_data_seq("PCA9685 PWM");
|
||||
|
||||
if (err_count) {
|
||||
DISPLAY_SET_CURSOR(1, 0);
|
||||
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(" errors");
|
||||
|
||||
return 1;
|
||||
} else {
|
||||
DISPLAY_SET_CURSOR(1, 1);
|
||||
DISPLAY_SET_CURSOR(1, 4);
|
||||
display_write_data_seq("OK");
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -30,7 +30,7 @@ int SST25VF016B_run_test(void)
|
|||
DISPLAY_CLEAR;
|
||||
display_write_data_seq("SST25VF016B Flas");
|
||||
|
||||
DISPLAY_SET_CURSOR(1, 0);
|
||||
DISPLAY_SET_CURSOR(1, 4);
|
||||
display_write_data_byte('1' + t);
|
||||
display_write_data_seq("/5 ");
|
||||
|
||||
|
@ -58,7 +58,7 @@ int SST25VF016B_run_test(void)
|
|||
display_write_data_seq("SST25VF016B Flas");
|
||||
|
||||
if (err_count) {
|
||||
DISPLAY_SET_CURSOR(1, 1);
|
||||
DISPLAY_SET_CURSOR(1, 4);
|
||||
display_write_data_byte('0' + err_count % 10);
|
||||
display_write_data_seq(" Errors");
|
||||
|
||||
|
@ -67,7 +67,7 @@ int SST25VF016B_run_test(void)
|
|||
for (size_t i = 0; i < 4; i += 2) {
|
||||
// odd reads MUST result in 0xBF
|
||||
if (rx_buffer[4+i] != 0xBF) {
|
||||
DISPLAY_SET_CURSOR(1, 0);
|
||||
DISPLAY_SET_CURSOR(1, 4);
|
||||
display_write_data_byte('B');
|
||||
display_write_data_byte('1'+i);
|
||||
display_write_data_seq(" WRONG");
|
||||
|
@ -81,7 +81,7 @@ int SST25VF016B_run_test(void)
|
|||
for (size_t i = 1; i < 4; i += 2) {
|
||||
// even reads MUST result in 0x41
|
||||
if (rx_buffer[4+i] != 0x41) {
|
||||
DISPLAY_SET_CURSOR(1, 0);
|
||||
DISPLAY_SET_CURSOR(1, 4);
|
||||
display_write_data_byte('B');
|
||||
display_write_data_byte('1'+i);
|
||||
display_write_data_seq(" WRONG");
|
||||
|
@ -92,7 +92,7 @@ int SST25VF016B_run_test(void)
|
|||
}
|
||||
}
|
||||
|
||||
DISPLAY_SET_CURSOR(1, 1);
|
||||
DISPLAY_SET_CURSOR(1, 4);
|
||||
display_write_data_seq("OK");
|
||||
}
|
||||
|
||||
|
|
|
@ -265,6 +265,13 @@ int main(void)
|
|||
if (cleanup_functions[display_current_frame-1])
|
||||
cleanup_functions[display_current_frame-1]();
|
||||
|
||||
// write test number tag onto this framebuffer
|
||||
DISPLAY_SET_CURSOR(1, 0);
|
||||
DISPLAY_SET_INCREMENT;
|
||||
display_write_data_byte('T');
|
||||
display_write_data_byte('0' + (display_current_frame / 10) % 10);
|
||||
display_write_data_byte('0' + display_current_frame % 10);
|
||||
|
||||
display_to_direct();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue