diff options
Diffstat (limited to 'board/keyborg/board.c')
-rw-r--r-- | board/keyborg/board.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/board/keyborg/board.c b/board/keyborg/board.c index 1e4096f90c..7616a0aaac 100644 --- a/board/keyborg/board.c +++ b/board/keyborg/board.c @@ -9,6 +9,7 @@ #include "debug.h" #include "master_slave.h" #include "registers.h" +#include "spi_comm.h" #include "system.h" #include "task.h" #include "util.h" @@ -21,9 +22,27 @@ int main(void) master_slave_init(); + /* We want master SPI_NSS low and slave SPI_NSS high */ + STM32_GPIO_BSRR(GPIO_A) = (1 << (1 + 16)) | (1 << 6); + + master_slave_sync(10); + + if (master_slave_is_master()) + spi_master_init(); + else + spi_slave_init(); + + master_slave_sync(100); + while (1) { i++; task_wait_event(SECOND); - debug_printf("Timer check - %d seconds\n", i); + if (master_slave_is_master()) { + debug_printf("Hello x 50..."); + if (spi_hello_test(50) == EC_SUCCESS) + debug_printf("Passed\n"); + else + debug_printf("Failed\n"); + } } } |