diff --git a/main.c b/main.c index 6ef0e6e..c94265e 100644 --- a/main.c +++ b/main.c @@ -53,6 +53,8 @@ int main(int argc, char *argv[]) pinConfig(pinA0, input, def_stage, pullDown, def_speed); setupInit(); // This is the sescond call of System init the assebly start code is calling it before the main. + + usartInit( usart2, pinA2, pinA15, @@ -67,14 +69,21 @@ int main(int argc, char *argv[]) //blinks 10 times to indicate the sicsessfull init if the device - for(i = 0 ; i < 10 ; i++) - { + for(i = 0 ; i < 10 ; i++) { delayMs(100); pinToggle(pinB3); delayMs(100); } pinWrite(pinB3,0); + + pinInit(pinA5); + pinInit(pinA6); + pinInit(pinA7); + + pinSetAlternate(pinA5, 0); // SPI1_SCK + pinSetAlternate(pinA6, 0); // SPI1_MISO + pinSetAlternate(pinA7, 0); // SPI1_MOSI spi_init(SPI_CH_1); for(i = 10; i > 0; i--) {