From dfc471c4f68eba0c054e61dbb3567ee89e3a036f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Thu, 9 Mar 2017 07:04:55 +0100 Subject: Update spiblink example to use examples.mk --- examples/spiblink/master/master.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 examples/spiblink/master/master.c (limited to 'examples/spiblink/master/master.c') diff --git a/examples/spiblink/master/master.c b/examples/spiblink/master/master.c new file mode 100644 index 0000000..73a8aa9 --- /dev/null +++ b/examples/spiblink/master/master.c @@ -0,0 +1,17 @@ +#include +#include +#include +#include + +int main() { + io_setin(CONFIG_BUTTON_IO, IO_PULLUP); + io_setout(CONFIG_LED_IO); + + spi_init(SPI_MODE_MASTER); + // SREG |= _BV(7); // Enable interrupts TODO I don't think that we need this + + while (1) { + io_set(CONFIG_LED_IO, io_get(CONFIG_BUTTON_IO)); + spi_send(io_get(CONFIG_BUTTON_IO)); + } +} -- cgit v1.2.3