mirror of
https://github.com/vsergeev/c-periphery.git
synced 2026-09-23 05:03:37 +08:00
tests/spi: add tostring check to interactive test
This commit is contained in:
@@ -123,6 +123,7 @@ bool getc_yes(void) {
|
||||
}
|
||||
|
||||
void test_interactive(void) {
|
||||
char str[256];
|
||||
spi_t *spi;
|
||||
uint8_t buf[] = { 0x55, 0xaa, 0x0f, 0xf0 };
|
||||
|
||||
@@ -138,6 +139,12 @@ void test_interactive(void) {
|
||||
printf("Press enter to continue...\n");
|
||||
getc(stdin);
|
||||
|
||||
/* Check tostring */
|
||||
passert(spi_tostring(spi, str, sizeof(str)) > 0);
|
||||
printf("SPI description: %s\n", str);
|
||||
printf("SPI description looks OK? y/n\n");
|
||||
passert(getc_yes());
|
||||
|
||||
/* Mode 0 transfer */
|
||||
printf("Press enter to start transfer...");
|
||||
getc(stdin);
|
||||
|
||||
Reference in New Issue
Block a user